Esempio n. 1
0
        internal static void Edit(ConversationScript conversationScript, ConversationPiece conversationPiece)
        {
            var w = ScriptableWizard.DisplayWizard <ConversationPieceDialog>("Edit Conversation Piece", "Update");

            w.targets = (from i in conversationScript.items select i.id).ToArray();
            w.originalConversationPiece = conversationPiece;
            w.conversationPiece         = conversationPiece;
            w.conversationScript        = conversationScript;
            w.isUpdate = true;
        }
Esempio n. 2
0
        internal static void New(ConversationScript conversationScript)
        {
            var w = ScriptableWizard.DisplayWizard <ConversationPieceDialog>("New Conversation Piece", "Create");

            w.conversationScript = conversationScript;
            w.conversationPiece  = new ConversationPiece()
            {
                id = "", text = "", options = new List <ConversationOption>()
            };
            w.isUpdate = false;
        }
 void OnEnable()
 {
     script = target as ConversationScript;
     // list = new ReorderableList(serializedObject, serializedObject.FindProperty("items"), true, true, true, true);
     list = new ReorderableList(script.items, typeof(ConversationPiece), true, true, true, true);
     list.drawElementCallback = OnDrawElement;
     list.onAddCallback      += OnAdd;
     list.onRemoveCallback   += OnRemove;
     list.drawHeaderCallback += OnDrawHeader;
     list.onSelectCallback   += OnSelect;
     Undo.undoRedoPerformed  -= OnUndoRedo;
     Undo.undoRedoPerformed  += OnUndoRedo;
 }