コード例 #1
0
    public static void ShowEditor(int plIndex)
    {
        placeIndex = plIndex;

        Load();

        PlaceEditor editor = EditorWindow.GetWindow <PlaceEditor>(false, place.name);

        editor.Init();
    }
コード例 #2
0
    void OnGUI()
    {
        GUILayout.BeginVertical();
        scrollPos = GUILayout.BeginScrollView(scrollPos, false, false);
        GUILayout.BeginVertical();

        foreach (PlaceObject place in places)
        {
            GUILayout.BeginHorizontal();

            place.name = EditorGUILayout.TextField(place.name);

            if (GUILayout.Button("Edit"))
            {
                PlaceEditor.ShowEditor(places.IndexOf(place));
            }

            GUILayout.EndHorizontal();
        }

        GUILayout.EndVertical();
        GUILayout.EndScrollView();

        if (GUILayout.Button("New"))
        {
            PlaceObject pO = new PlaceObject();
            pO.name = "Place " + (places.Count + 1);
            places.Add(pO);
            Save();
        }

        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Save"))
        {
            Save();
        }

        GUILayout.EndVertical();
    }