示例#1
0
        // INITIALIZERS: -----------------------------------------------------------------------------------------------

        private void OnEnable()
        {
            if (target == null || serializedObject == null)
            {
                return;
            }
            this.trigger = (Trigger)target;

            SerializedProperty spIgniters = serializedObject.FindProperty("igniters");

            this.spIgnitersKeys   = spIgniters.FindPropertyRelative("keys");
            this.spIgnitersValues = spIgniters.FindPropertyRelative("values");

            if (this.spIgnitersKeys.arraySize == 0)
            {
                Igniter igniter = this.trigger.gameObject.AddComponent <IgniterStart>();
                igniter.Setup(this.trigger);
                igniter.enabled = false;

                this.spIgnitersKeys.InsertArrayElementAtIndex(0);
                this.spIgnitersValues.InsertArrayElementAtIndex(0);

                this.spIgnitersKeys.GetArrayElementAtIndex(0).intValue = Trigger.ALL_PLATFORMS_KEY;
                this.spIgnitersValues.GetArrayElementAtIndex(0).objectReferenceValue = igniter;

                this.serializedObject.ApplyModifiedPropertiesWithoutUndo();
                this.serializedObject.Update();
            }

            this.UpdateIgnitersPlatforms();

            this.ignitersIndex = EditorPrefs.GetInt(KEY_IGNITER_INDEX_PREF, 0);
            if (this.ignitersIndex >= this.spIgnitersKeys.arraySize)
            {
                this.ignitersIndex = this.spIgnitersKeys.arraySize - 1;
                EditorPrefs.SetInt(KEY_IGNITER_INDEX_PREF, this.ignitersIndex);
            }

            this.spItems      = serializedObject.FindProperty("items");
            this.sortableList = new EditorSortableList();

            this.spMinDistance         = serializedObject.FindProperty("minDistance");
            this.spMinDistanceToPlayer = serializedObject.FindProperty("minDistanceToPlayer");
        }
示例#2
0
        // INITIALIZERS: --------------------------------------------------------------------------

        private void OnEnable()
        {
            if (target == null || serializedObject == null)
            {
                return;
            }

            this.forceInitialize = true;
            this.instance        = (IConditionsList)target;
            this.spConditions    = serializedObject.FindProperty(PROP_CONDITIONS);

            this.UpdateSubEditors(instance.conditions);
            this.editorSortableList = new EditorSortableList();

            if (this.target != null)
            {
                this.target.hideFlags = HideFlags.HideInInspector | HideFlags.HideInHierarchy;
            }
        }
示例#3
0
        // INITIALIZERS: -----------------------------------------------------------------------------------------------

        private void OnEnable()
        {
            if (target == null || serializedObject == null)
            {
                return;
            }
            this.forceInitialize = true;

            this.instance         = (Event)target;
            this.spInteractions   = serializedObject.FindProperty(PROP_INTERACTIONS);
            this.spDefaultActions = serializedObject.FindProperty(PROP_DEFREAC);

            if (this.instance.defaultActions != null)
            {
                this.actionsEditor = Editor.CreateEditor(this.instance.defaultActions) as ActionsEditor;
            }

            serializedObject.ApplyModifiedProperties();
            serializedObject.Update();

            this.UpdateSubEditors(this.instance.interactions);
            this.editorSortableList = new EditorSortableList();
        }
示例#4
0
        // INITIALIZERS: --------------------------------------------------------------------------

        private void OnEnable()
        {
            if (target == null || serializedObject == null)
            {
                return;
            }
            this.forceInitialize = true;

            this.instance         = (Conditions)target;
            this.spClauses        = serializedObject.FindProperty(PROP_CLAUSES);
            this.spDefaultActions = serializedObject.FindProperty(PROP_DEFREAC);

            if (this.instance.defaultActions != null)
            {
                this.actionsEditor = Editor.CreateEditor(this.instance.defaultActions) as ActionsEditor;
            }

            serializedObject.ApplyModifiedPropertiesWithoutUndo();
            serializedObject.Update();

            this.UpdateSubEditors(this.instance.clauses);
            this.editorSortableList = new EditorSortableList();
        }
示例#5
0
 private void OnDisable()
 {
     this.CleanSubEditors();
     this.editorSortableList = null;
 }