예제 #1
0
    void OnGUI()
    {
        GUILayout.Label("Map Info", EditorStyles.boldLabel);
        levelName = EditorGUILayout.TextField("Name", levelName);
        difficult = EditorGUILayout.IntField("Difficult", difficult);

        EditorGUILayout.Separator();
        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("Clear"))
        {
            LevelEditor.ClearAll();
        }
        EditorGUILayout.EndHorizontal();

        EditorGUILayout.BeginHorizontal();
        if (GUILayout.Button("<"))
        {
            LevelEditor.LoadLevel(EditorPrefs.GetInt("Current_Level") - 1);
            levelName = EditorPrefs.GetString("Level_Name");
            difficult = EditorPrefs.GetInt("Level_Difficult");
            Repaint();
        }
        if (GUILayout.Button(">"))
        {
            LevelEditor.LoadLevel(EditorPrefs.GetInt("Current_Level") - 1);
            levelName = EditorPrefs.GetString("Level_Name");
            difficult = EditorPrefs.GetInt("Level_Difficult");
            Repaint();
        }
        if (GUILayout.Button("Save"))
        {
            LevelEditor.Save();
        }
        if (GUILayout.Button("Load"))
        {
            Load();
            Repaint();
        }


        EditorGUILayout.EndHorizontal();
    }