Esempio n. 1
0
        void OnEnable()
        {
            if (!target)
            {
                return;
            }
            OnSceneGUIHelper.Register(OnSceneGUI);
            Mission     selectedMission = target as Mission;
            List <Team> teams           = selectedMission.Teams;
            int         last            = SessionState.GetInt("MissionEditor_LastTeamIndex", 0);

            if (teams.Count == 0 && last < teams.Count)
            {
                return;
            }

            if (auxWindow == null)
            {
                TeamEditor teamEdit = Editor.CreateInstance <TeamEditor>();
                if (teams.Count > SessionState.GetInt("MissionEditor_LastTeamIndex", 0))
                {
                    teamEdit.Do(teams[SessionState.GetInt("MissionEditor_LastTeamIndex", 0)], selectedMission);
                    teamEdit.SetParent(this);
                    auxWindow = teamEdit;
                }
            }
            MissionCondition.ConditionType a = selectedMission.WinDondition == null ? MissionCondition.ConditionType.Custom : selectedMission.WinDondition.conditionType;
            MissionCondition.ConditionType b = selectedMission.LoseCondition == null ? MissionCondition.ConditionType.Custom : selectedMission.LoseCondition.conditionType;

            ConditionTypes = new MissionCondition.ConditionType[] { a, b };
            UpdateDictionaries();
        }
Esempio n. 2
0
        void Init()
        {
            // Remove delegate listener if it has previously
            // been assigned.
            OnSceneGUIHelper.RegisterSecondary(OnSceneGUI);
            // Add (or re-add) the delegate.


            objList = ScriptableObject.CreateInstance <PathSerializedObject>();
            if (modifiedList != null)
            {
                objList.list = EditorTools.GenericCopier <List <GridPosition> > .DeepCopy(modifiedList);
            }
            serializedObject = new UnityEditor.SerializedObject(objList);
            list             = CreateList(serializedObject, serializedObject.FindProperty("list"));
            OnPathChange();
        }
Esempio n. 3
0
 void OnDisable()
 {
     OnSceneGUIHelper.UnRegister(OnSceneGUI);
     AssetDatabase.SaveAssets();
 }
Esempio n. 4
0
 void OnDestroy()
 {
     OnSceneGUIHelper.UnRegisterSecondary(OnSceneGUI);
     callback = null;
     ScriptableObject.DestroyImmediate(objList);
 }