Exemplo n.º 1
0
        public void DrawLevelEditorConfiguration()
        {
            GUIContent content = new GUIContent(LevelEditorConstants.EditorConfigurationLable);
            Vector2    size    = skin.GetStyle(LevelEditorConstants.Label).CalcSize(content);

            EditorUIUtility.DrawLabel(LevelEditorConstants.EditorConfigurationLable, GUILayout.Width(size.x));
            GUILayout.Space(LevelEditorConstants.i10);
            configuration = (LevelEditorConfiguration)EditorUIUtility.DrawObjectField(configuration, typeof(LevelEditorConfiguration));
        }
 public void DrawMapper()
 {
     for (int indexOfTool = 0; indexOfTool < configuration.toolConfiguration.tools.Count; indexOfTool++)
     {
         EditorGUILayout.BeginHorizontal();
         GUILayout.Button(configuration.toolConfiguration.tools[indexOfTool].gridSprite, GUILayout.Height(LevelEditorConstants.i35), GUILayout.Width(LevelEditorConstants.i35));
         configuration.toolPrefabMapper.prefabs[indexOfTool] = (GameObject)EditorUIUtility.DrawObjectField(configuration.toolPrefabMapper.prefabs[indexOfTool], typeof(GameObject), GUILayout.Height(LevelEditorConstants.i35));
         EditorGUILayout.EndHorizontal();
     }
 }
Exemplo n.º 3
0
 public void DrawLevelButtons()
 {
     for (int index = LevelEditorConstants.i0; index < configuration.levelData.Levels.Count; index++)
     {
         EditorGUILayout.BeginHorizontal(skin.GetStyle(LevelEditorConstants.ToolBox));
         EditorUIUtility.DrawButton(configuration.levelData.Levels[index].name, () => OnLevelButtonClicked(index), GUILayout.Height(LevelEditorConstants.i45), GUILayout.ExpandWidth(LevelEditorConstants.BoolTrue));
         EditorUIUtility.DrawButton(LevelEditorConstants.X, () => OnLevelDeleteButtonClicked(index), GUILayout.Height(LevelEditorConstants.i45), GUILayout.ExpandWidth(LevelEditorConstants.BoolTrue));
         EditorUIUtility.DrawButton(LevelEditorConstants.Load, () => OnLoadButtonClick(index), GUILayout.Height(LevelEditorConstants.i45), GUILayout.ExpandWidth(LevelEditorConstants.BoolTrue));
         EditorGUILayout.EndHorizontal();
     }
 }
        public void OnGUI()
        {
            if (!configuration)
            {
                return;
            }

            EditorGUILayout.BeginVertical();
            toolContainerPosition = EditorGUILayout.BeginScrollView(toolContainerPosition, GUILayout.ExpandWidth(LevelEditorConstants.BoolTrue), GUILayout.ExpandHeight(LevelEditorConstants.BoolTrue));
            DrawMapper();
            EditorGUILayout.EndScrollView();
            EditorUIUtility.DrawButton(LevelEditorConstants.Close, () => Save());
            EditorGUILayout.EndVertical();
        }
Exemplo n.º 5
0
 public void DrawFileNameAndMapper()
 {
     if (configuration)
     {
         EditorGUILayout.BeginVertical(GUILayout.ExpandWidth(true));
         GUILayout.FlexibleSpace();
         EditorGUILayout.BeginHorizontal();
         EditorUIUtility.DrawButton(LevelEditorConstants.Map, () => OnMapButtonClick());
         GUILayout.Space(10);
         DrawLevelName();
         EditorGUILayout.EndHorizontal();
         GUILayout.FlexibleSpace();
         EditorGUILayout.EndVertical();
     }
 }
Exemplo n.º 6
0
        public void DrawLevelName()
        {
            if (configuration)
            {
                EditorGUILayout.BeginHorizontal();
                GUIStyle lableStyle = new GUIStyle();
                lableStyle.normal.textColor = Color.green;
                lableStyle.fontSize         = LevelEditorConstants.i18;
                Vector2 size = skin.GetStyle(LevelEditorConstants.Label).CalcSize(new GUIContent(LevelEditorConstants.LevelName));

                EditorUIUtility.DrawLabel(LevelEditorConstants.LevelName, lableStyle, GUILayout.Width(size.x));
                GUILayout.Space(LevelEditorConstants.i35);
                EditorUIUtility.DrawLabel(configuration.levelData.currentLevel.name, lableStyle);
                EditorGUILayout.EndHorizontal();
            }
        }
Exemplo n.º 7
0
 public void DrawEditorToolBoxRows(ref int index, int count)
 {
     EditorGUILayout.BeginHorizontal(skin.GetStyle(LevelEditorConstants.ToolBox), GUILayout.ExpandWidth(LevelEditorConstants.BoolTrue), GUILayout.Height(LevelEditorConstants.i50));
     GUILayout.FlexibleSpace();
     for (; index <= count; index++)
     {
         GUILayout.FlexibleSpace();
         EditorGUILayout.BeginVertical();
         GUILayout.Space(LevelEditorConstants.i50 / LevelEditorConstants.f2 - LevelEditorConstants.i35 / LevelEditorConstants.f2);
         int tempIndex = index;
         EditorUIUtility.DrawButton(configuration.toolConfiguration.tools[index].gridSprite, () => SelectTool(tempIndex), GUILayout.Height(LevelEditorConstants.i35), GUILayout.Width(LevelEditorConstants.i35));
         EditorGUILayout.EndVertical();
         GUILayout.FlexibleSpace();
     }
     GUILayout.FlexibleSpace();
     EditorGUILayout.EndHorizontal();
 }
Exemplo n.º 8
0
 public void DrawCell(LevelEditorTool editorTool, int toolIndex, EditorWindow window)
 {
     EditorUIUtility.DrawButton(texture, () => OnMouseEventDrawSelectedToolTexture(editorTool.gridSprite, toolIndex), GUILayout.Width(25), GUILayout.Height(25));
     HandleHoverDraw(editorTool, toolIndex, window);
 }
Exemplo n.º 9
0
 public void OnGUI()
 {
     gridSize = EditorUIUtility.DrawVector2FieldWithName("Grid Size : ", gridSize);
     name     = EditorUIUtility.DrawTextFieldWithName("Level Name : ", name);
     EditorUIUtility.DrawButton("Create", () => InitializeGrid());
 }
Exemplo n.º 10
0
 public void DrawFileManagementButtons()
 {
     EditorUIUtility.DrawButton(LevelEditorConstants.New, () => OnNewLevelButtonClick());
     EditorUIUtility.DrawButton(LevelEditorConstants.Save, () => OnSaveButtonClick());
     EditorUIUtility.DrawButton(LevelEditorConstants.SaveAs, () => OnSaveAsButtonClick());
 }
Exemplo n.º 11
0
 public void OnGUI()
 {
     name = EditorUIUtility.DrawTextFieldWithName("Level Name : ", name);
     EditorUIUtility.DrawButton("Save", () => OnSaveButtonClick());
 }