示例#1
0
        public override void OnInspectorGUI()
        {
            var roster = target as Roster;

            _toRemove = null;
            _toEdit   = null;

            using (new UndoScope(serializedObject))
            {
                EditorGUILayout.PropertyField(_ecosystem);
                EditorGUILayout.Space();

                if (_ecosystem.objectReferenceValue as Ecosystem != roster.Ecosystem)
                {
                    EcosystemChanged();
                }

                if (roster.Ecosystem)
                {
                    _creatureList.DrawList();
                }
            }

            if (_toRemove != null)
            {
                Remove(roster, _toRemove);
            }

            if (_toEdit != null)
            {
                EditorHelper.Edit(_toEdit);
            }
        }
示例#2
0
        public override void OnInspectorGUI()
        {
            var zone = target as Zone;
            var back = GUILayout.Button(EditorHelper.BackContent, GUILayout.Width(60.0f));

            using (new UndoScope(serializedObject))
            {
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(_clampBounds);
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(_scene);
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(_backgroundMusic);
                EditorGUILayout.Space();
            }

            using (new UndoScope(target))
            {
                var mapLayer = EditorGUILayout.Popup(_mapLayer, zone.World.MapLayers.IndexOf(zone.MapLayer), _mapLayers);
                if (mapLayer >= 0)
                {
                    zone.MapLayer = zone.World.MapLayers[mapLayer];
                }

                EditorGUILayout.Space();
                _staticState.Draw();
                EditorGUILayout.Space();
                _defaultState.Draw();
            }

            if (back)
            {
                EditorHelper.Edit(zone.World);
            }
        }
示例#3
0
        public override void OnInspectorGUI()
        {
            var world = target as World;

            _toAdd    = null;
            _toRemove = null;
            _toEdit   = null;
            _toShow   = -1;
            _toHide   = -1;

            using (new UndoScope(serializedObject))
                EditorGUILayout.PropertyField(_backgroundMusic);

            EditorGUILayout.Space();

            using (new UndoScope(serializedObject))
            {
                _uiScenes.DrawList();

                EditorGUILayout.Space();

                _mapLayers.DrawList();

                EditorGUILayout.Space();

                _zones.DrawList();
            }

            if (!string.IsNullOrEmpty(_toAdd))
            {
                Add(world, _toAdd);
            }

            if (_toRemove)
            {
                Remove(world, _toRemove);
            }

            if (_toShow >= 0)
            {
                ShowLayer(_toShow);
            }

            if (_toHide >= 0)
            {
                HideLayer(_toHide);
            }

            if (_toEdit)
            {
                EditorHelper.Edit(_toEdit);
            }
        }
示例#4
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            var nameRect = new Rect(position.x, position.y, position.width * 0.8f, EditorGUIUtility.singleLineHeight);
            var editRect = new Rect(nameRect.xMax + 5, position.y, position.width - nameRect.width - 5, EditorGUIUtility.singleLineHeight);

            var creature = property.objectReferenceValue as Creature;

            EditorGUI.LabelField(nameRect, creature.Species.name);

            if (GUI.Button(editRect, EditorHelper.EditContent))
            {
                EditorHelper.Edit(creature);
            }
        }
示例#5
0
        public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
        {
            label.tooltip = EditorHelper.GetTooltip(fieldInfo);

            var nameRect = new Rect(position.x, position.y, position.width * 0.8f, EditorGUIUtility.singleLineHeight);
            var editRect = new Rect(nameRect.xMax + 5, position.y, position.width - nameRect.width - 5, EditorGUIUtility.singleLineHeight);

            var species = property.objectReferenceValue as Species;

            EditorGUI.LabelField(nameRect, label, new GUIContent(species.name, "The name of this species"));

            if (GUI.Button(editRect, EditorHelper.EditContent))
            {
                EditorHelper.Edit(species);
            }
        }
示例#6
0
        public override void OnInspectorGUI()
        {
            var back = GUILayout.Button(EditorHelper.BackContent, GUILayout.Width(60.0f));

            EditorGUILayout.Space();

            using (new UndoScope(target))
            {
                _traits.Draw();
                EditorGUILayout.Space();
                _skills.Draw();
            }

            if (back)
            {
                EditorHelper.Edit((target as Species).Ecosystem);
            }
        }
示例#7
0
        public override void OnInspectorGUI()
        {
            var back = GUILayout.Button(EditorHelper.BackContent, GUILayout.Width(60.0f));

            using (new UndoScope(serializedObject))
            {
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(_traits);
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(_worldInstructions);
                EditorGUILayout.Space();
                EditorGUILayout.PropertyField(_battleInstructions);
            }

            if (back)
            {
                EditorHelper.Edit((target as Ability).Ecosystem);
            }
        }
示例#8
0
 private void Edit(Ability ability)
 {
     EditorHelper.Edit(ability);
 }
示例#9
0
 private void Edit(Species species)
 {
     EditorHelper.Edit(species);
 }
示例#10
0
 private static void Show(Object obj)
 {
     _skipReset = obj is InstructionSet;
     EditorHelper.Edit(obj);
 }