Ejemplo n.º 1
0
        public override void OnInspectorGUI()
        {
            _needsUpdate = false;

            using (var changes = new EditorGUI.ChangeCheckScope())
            {
                using (new UndoScope(_ruleOverrideTile, false))
                {
                    var overrideTile = EditorGUILayout.ObjectField(_overrideTileContent.Content, _ruleOverrideTile.OverrideTile, typeof(RuleTile), false) as RuleTile;
                    if (overrideTile != _ruleOverrideTile.OverrideTile)
                    {
                        _ruleOverrideTile.OverrideTile = overrideTile;
                        UpdateOverrides();
                    }

                    DrawDefaultRule();

                    EditorGUILayout.Space();

                    _rulesControl.Draw(_rulesContent.Content);

                    if (changes.changed)
                    {
                        _needsUpdate = true;
                    }
                }
            }

            if (_needsUpdate)
            {
                EditorUtility.SetDirty(_ruleOverrideTile);
                SceneView.RepaintAll();
            }
        }
        public override void Draw(Rect position, GUIContent label)
        {
            var instructionHeight = AssetDisplayDrawer.GetHeight(label);
            var instructionRect   = RectHelper.TakeHeight(ref position, instructionHeight);

            DrawInstruction(instructionRect, label);
            RectHelper.TakeVerticalSpace(ref position);

            using (new EditorGUI.IndentLevelScope())
            {
                if (_caller.Inputs.Count > 0)
                {
                    var inputsHeight = _inputs.GetHeight();
                    var inputsRect   = RectHelper.TakeHeight(ref position, inputsHeight);

                    _inputs.Draw(inputsRect, _inputsLabel.Content);
                }

                if (_caller.Outputs.Count > 0)
                {
                    var outputsHeight = _outputs.GetHeight();
                    var outputsRect   = RectHelper.TakeHeight(ref position, outputsHeight);

                    _outputs.Draw(outputsRect, _outputsLabel.Content);
                }
            }
        }
Ejemplo n.º 3
0
        public override void OnInspectorGUI()
        {
            _needsUpdate = false;

            using (var changes = new EditorGUI.ChangeCheckScope())
            {
                using (new UndoScope(_ruleTile, false))
                {
                    DrawDefaultRule();

                    EditorGUILayout.Space();

                    _neighborTypesControl.Draw(_neighborTypesContent.Content);
                    _rulesControl.Draw(_rulesContent.Content);

                    if (changes.changed)
                    {
                        _needsUpdate = true;
                    }
                }
            }

            if (_needsUpdate)
            {
                EditorUtility.SetDirty(_ruleTile);
                SceneView.RepaintAll();
            }
        }
Ejemplo n.º 4
0
        public override void Draw(Rect position, GUIContent label)
        {
            var moneyRect = RectHelper.TakeLine(ref position);

            _inventory.Money = EditorGUI.IntField(moneyRect, _moneyLabel.Content, _inventory.Money);
            _listControl.Draw(position, _itemsLabel.Content);
        }
Ejemplo n.º 5
0
        public override void OnInspectorGUI()
        {
            using (new UndoScope(serializedObject))
            {
                EditorGUILayout.PropertyField(_mainSceneProperty);
                EditorGUILayout.PropertyField(_defaultZoneTransitionProperty);
                EditorGUILayout.PropertyField(_defaultSpawnTransitionProperty);
                EditorGUILayout.PropertyField(_backgroundMusicProperty);
                EditorGUILayout.PropertyField(_worldSchemaProperty);
                EditorGUILayout.PropertyField(_playerSchemaProperty);
                EditorGUILayout.PropertyField(_npcSchemaProperty);
                EditorGUILayout.PropertyField(_mapLayersProperty);

                _uiScenesControl.Draw(_uiScenesLabel.Content);
            }

            using (new UndoScope(_world, false))
                _zonesControl.Draw(_zonesLabel.Content);
        }
Ejemplo n.º 6
0
        public override void OnInspectorGUI()
        {
            using (new UndoScope(_building.gameObject, false))
            {
                DrawAdvancedEditing();

                _building.CollisionLayer = (CollisionLayer)EnumButtonsDrawer.Draw(_collisionLayerContent.Content, (int)_building.CollisionLayer, false, _collisionLayerValues, _collisionLayerNames, 40.0f);

                var bounds     = EditorGUILayout.RectField(_boundsContent.Content, _building.Bounds);
                var sortPoint  = EditorGUILayout.FloatField(_sortPointContent.Content, _building.SortPoint);
                var roofHeight = EditorGUILayout.IntSlider(_roofHeightContent.Content, _building.RoofHeight, 1, Mathf.RoundToInt(_building.Bounds.height));

                DrawMainPart(_building.Roof, _roofContent.Content);
                DrawMainPart(_building.Facade, _facadeContent.Content);

                _doorsControl.Draw(_doorsContent.Content);
                _accessoriesControl.Draw(_accessoriesContent.Content);

                bounds.width  = Mathf.Max(bounds.width, _minimumSize.x);
                bounds.height = Mathf.Max(bounds.height, _minimumSize.y);

                UpdateMainTransforms(bounds, sortPoint, roofHeight, false);
            }
        }
Ejemplo n.º 7
0
 public override void Draw(Rect position, GUIContent label)
 {
     _listControl.Draw(position, label);
 }
Ejemplo n.º 8
0
 public override void OnInspectorGUI()
 {
     using (new UndoScope(_composition, false))
         _customCommandsList.Draw(_customCommandsLabel.Content);
 }