Пример #1
0
        public StateLink AddStateLink()
        {
            StateLink sl = CreateInstance <StateLink>();

            sl.Init(this);
            GuidManager.GetGameByChain(this).Dirty = true;
            links.Add(sl);
            return(sl);
        }
Пример #2
0
 public void RemoveStateLink(StateLink link)
 {
     links.Remove(link);
     GuidManager.GetGameByChain(this).Dirty = true;
 }
Пример #3
0
        public override void OnInspectorGUI()
        {
            if (inspectedFlag != dialog.playing)
            {
                if (dialog.playing)
                {
                    qw = QuestWindow.Init(GuidManager.GetGameByChain(dialog.PersonChain));
                    //qw.DebugPathGame(DialogPlayer.Instance.currentState);
                }
                else
                {
                    if (qw)
                    {
                        qw.Close();
                    }
                }
                inspectedFlag = dialog.playing;
            }
            GUILayout.BeginHorizontal();
            GUILayout.Label("Dialogs pack:");
            dialog.game = (PathGame)EditorGUILayout.ObjectField(dialog.game, typeof(PathGame), false);
            GUILayout.EndHorizontal();
            if (dialog.game && dialog.game.chains.Count > 0)
            {
                GUILayout.BeginHorizontal();
                GUILayout.Label("Dialog:");

                if (!dialog.game.chains.Contains(dialog.PersonChain))
                {
                    Debug.Log(dialog.game.chains[0]);
                    dialog.PersonChain = dialog.game.chains[0];
                    if (dialog.PersonChain)
                    {
                        SetEvents();
                    }
                }
                Chain ch = dialog.game.chains[EditorGUILayout.Popup(dialog.game.chains.IndexOf(dialog.PersonChain), dialog.game.chains.Select(x => x.dialogName).ToArray())];
                if (dialog.PersonChain != ch)
                {
                    dialog.PersonChain = ch;

                    if (dialog.PersonChain)
                    {
                        SetEvents();
                    }
                }
                GUILayout.EndHorizontal();
                int i = 0;
                foreach (KeyValuePair <Path, PathEvent> pathEvent in dialog.PathEventsList)
                {
                    string aim = "";

                    if (pathEvent.Key.aimState != null)
                    {
                        aim = pathEvent.Key.aimState.description;
                    }
                    GUILayout.Label(pathEvent.Key.text + "->" + aim);
                    Undo.RecordObject(target, "Changed event");
                    EditorGUILayout.PropertyField(dialogProperty.GetArrayElementAtIndex(i));
                    dialogObject.ApplyModifiedProperties();
                    i++;
                }
            }
        }