Advertisement
infinite_ammo

Conversation

Apr 4th, 2012
221
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.92 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class Conversation : MonoBehaviour
  6. {
  7.     [System.Serializable]
  8.     public class Block
  9.     {
  10.         public Block()
  11.         {
  12.             isOpen = true;
  13.             name = "";
  14.             dialog = "";
  15.             branches = new List<Branch>();
  16.         }
  17.  
  18.         public void AddNewBranch()
  19.         {
  20.             branches.Add(new Branch());
  21.         }
  22.  
  23.         public void RemoveBranch(Branch branch)
  24.         {
  25.             branches.Remove(branch);
  26.         }
  27.  
  28.         public string name;
  29.         public string dialog;
  30.         public int dispositionChange;
  31.         public bool isOpen;
  32.         public List<Branch> branches;
  33.     }
  34.  
  35.     [System.Serializable]
  36.     public class Branch
  37.     {
  38.         public Branch()
  39.         {
  40.             dialog = "";
  41.             gotoBlock = "";
  42.         }
  43.         public string dialog;
  44.         public string gotoBlock;
  45.     }
  46.  
  47.     public List<Block> blocks;
  48.  
  49.     public void AddNewBlock()
  50.     {
  51.         blocks.Add(new Block());
  52.     }
  53.  
  54.     public void RemoveBlock(Block block)
  55.     {
  56.         blocks.Remove(block);
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement