Exemplo n.º 1
0
 void OnGUI()
 {
     EditorGUILayout.BeginHorizontal();
     _brushName = EditorGUILayout.TextField("Brush Name:", _brushName);
     if (GUILayout.Button("Save"))
     {
         PrefabBrushEditor editor = EditorWindow.GetWindow <PrefabBrushEditor> ();
         File.WriteAllText(_saveFilePath + _brushName + ".brush", editor.ToString());
         this.Close();
     }
     EditorGUILayout.EndHorizontal();
 }
Exemplo n.º 2
0
    void OnGUI()
    {
        EditorGUILayout.BeginHorizontal();
        _brushName = EditorGUILayout.TextField("Brush Name:", _brushName);
        if (GUILayout.Button("Save"))
        {
            PrefabBrushEditor editor = EditorWindow.GetWindow <PrefabBrushEditor>();
            var fileName             = _saveFilePath + _brushName + ".brush";

            Directory.CreateDirectory(_saveFilePath);

            if (!File.Exists(fileName))
            {
                File.Create(fileName).Dispose();
            }

            File.WriteAllText(fileName, editor.ToString());
            this.Close();
        }
        EditorGUILayout.EndHorizontal();
    }