コード例 #1
0
    static void Init()
    {
        // Get existing open window or if none, make a new one:
        TerrainEditor window = (TerrainEditor)GetWindow(typeof(TerrainEditor));

        window.Show();
        window.EditorInit();
    }
コード例 #2
0
    private void SaveDefault()
    {
        List <string> jsonList = new List <string>();

        foreach (TerrainLayer layer in _editLayers)
        {
            jsonList.Add(JsonUtility.ToJson(layer));
        }

        try
        {
            File.WriteAllLines(LayerSerializer.DefaultJSONPath, jsonList);
        }
        catch (Exception e)
        {
        }

        TerrainEditor window = (TerrainEditor)GetWindow(typeof(TerrainEditor));

        window.Show();
        window.UpdateTerrainPreview();
    }
コード例 #3
0
 static void Init()
 {
     // Get existing open window or if none, make a new one:
     window = (TerrainEditor)EditorWindow.GetWindowWithRect(typeof(TerrainEditor), new Rect(0, 0, 300, 520), false, "Terrain Generator");
     window.Show();
 }