Esempio n. 1
0
        void DrawLevelSettings()
        {
            GUILayout.BeginArea(setUpSettings.GetRect());
            {
                setUpScrollView = EditorGUILayout.BeginScrollView(setUpScrollView, GUILayout.MaxHeight(setUpSettings.GetRect().height));
                EditorGUILayout.Space();
                EditorGUI.BeginChangeCheck();
                level = (LevelPlatformerGenerator)EditorGUILayout.ObjectField(level, typeof(LevelPlatformerGenerator), true);
                if (EditorGUI.EndChangeCheck())
                {
                    if (level == null)
                    {
                        type = GENERATOR_TO_EDIT.None;
                    }
                }
                if (level != null)
                {
                    if (levelEditor == null)
                    {
                        levelEditor = (LevelGeneratorInspector)Editor.CreateEditor(level);
                    }
                    levelEditor.OnWindowGUI();
                    if (level.setUp != null)
                    {
                        UpdateTextures();
                    }
                }

                EditorGUILayout.EndScrollView();
            }
            GUILayout.EndArea();
        }
Esempio n. 2
0
 public void SetType(GENERATOR_TO_EDIT _type, object generator)
 {
     if (_type == GENERATOR_TO_EDIT.Level)
     {
         level = (LevelPlatformerGenerator)generator;
     }
     if (_type == GENERATOR_TO_EDIT.Map)
     {
         map = (MapGenerator)generator;
     }
     type = _type;
 }
Esempio n. 3
0
 void DrawSettingsReferenceless()
 {
     GUILayout.BeginArea(setUpSettings.GetRect());
     {
         EditorGUILayout.Space();
         EditorGUI.indentLevel = 1;
         EditorGUI.BeginChangeCheck();
         level = (LevelPlatformerGenerator)EditorGUILayout.ObjectField(level, typeof(LevelPlatformerGenerator), true);
         if (EditorGUI.EndChangeCheck())
         {
             if (level != null)
             {
                 type = GENERATOR_TO_EDIT.Level;
                 if (level.setUp != null && level.setUp.editorGeneratorLevel != null)
                 {
                     SetTexture(level.setUp.editorGeneratorLevel);
                 }
             }
         }
         EditorGUI.BeginChangeCheck();
         map = (MapGenerator)EditorGUILayout.ObjectField(map, typeof(MapGenerator), true);
         if (EditorGUI.EndChangeCheck())
         {
             if (map != null)
             {
                 type = GENERATOR_TO_EDIT.Map;
                 if (map.setUp != null && map.setUp.editorGeneratorLevel != null)
                 {
                     SetTexture(map.setUp.editorGeneratorLevel);
                 }
             }
         }
         EditorGUI.indentLevel = 0;
     }
     GUILayout.EndArea();
 }