Пример #1
0
        protected virtual void DrawItemSpawningProperties(SerializedObject m_Object)
        {
            // Item spawning options
            SerializedProperty property = m_Object.FindProperty("spawnItemsOnStateEnter");

            EditorGUILayout.PropertyField(property);

            if (property.boolValue)
            {
                property = m_Object.FindProperty("itemSpawnMode");
                EditorGUILayout.PropertyField(property);

                if (itemSpawnMode == ItemSpawnMode.SpawnPoint)
                {
                    property = m_Object.FindProperty("itemSpawnPoint");
                    EditorGUILayout.PropertyField(property);
                }
                else if (itemSpawnMode == ItemSpawnMode.Transform)
                {
                    property = m_Object.FindProperty("itemSpawnTfm");
                    EditorGUILayout.PropertyField(property);
                }

                property = m_Object.FindProperty("exactPosition");
                EditorGUILayout.PropertyField(property);

                InspectorHelper.DrawArray(m_Object, "spawnableItems");

                property = m_Object.FindProperty("totalAmount");
                EditorGUILayout.PropertyField(property);
            }
        }
Пример #2
0
        protected override void DrawStateInspectorEditor(SerializedObject m_Object, AIBehaviors stateMachine)
        {
            SerializedProperty property;

            GUILayout.Label("Dead Properties:", EditorStyles.boldLabel);

            GUILayout.BeginVertical(GUI.skin.box);

            property = m_Object.FindProperty("destroyGameObject");
            EditorGUILayout.PropertyField(property, new GUIContent("Destroy This Object"));
            if (property.boolValue)
            {
                property = m_Object.FindProperty("destroyAfterTime");
                EditorGUILayout.PropertyField(property);
            }

            property = m_Object.FindProperty("destroyColliders");
            EditorGUILayout.PropertyField(property);

            property = m_Object.FindProperty("destroyGameObjects");
            EditorGUILayout.PropertyField(property);
            if (property.boolValue)
            {
                InspectorHelper.DrawArray(m_Object, "gameObjectsToDestroy");
            }

            property = m_Object.FindProperty("destroyComponents");
            EditorGUILayout.PropertyField(property);
            if (property.boolValue)
            {
                InspectorHelper.DrawArray(m_Object, "componentsToDestroy");
            }

            property = m_Object.FindProperty("changeTag");
            EditorGUILayout.PropertyField(property);
            if (property.boolValue)
            {
                property = m_Object.FindProperty("deadTag");
                EditorGUILayout.PropertyField(property);
            }

            GUILayout.EndVertical();

            m_Object.ApplyModifiedProperties();
        }