public static void ShowWindow(StarsSpaceGeneratorEditor targ) { SaveToTextureStarsSpaceWindow win = GetWindow <SaveToTextureStarsSpaceWindow>(false, "Save To Texture", true); win.target = targ; win.basefilename = targ.target.name; win.basepath = Application.dataPath; }
public override void OnInspectorGUI() { StarsSpaceGenerator tTarget = (StarsSpaceGenerator)target; DrawDefaultInspector(); GUILayout.BeginHorizontal(); GUI.enabled = tTarget.UpdateType == StarsSpaceGenerator.EUpdateType.Manual; if (GUILayout.Button(new GUIContent("Update", "Rebuild Sky Box Textures"), GUILayout.Width(100))) { UpdateTexturesCubeMap((StarsSpaceGenerator)target); } GUI.enabled = true; if (GUILayout.Button(new GUIContent("Load Themplate", "Load parameters from XML"))) { string path = EditorUtility.OpenFilePanel( "Load template from XML", "/Assets/SunShader/Temlpates", "xml"); if (path.Length != 0) { LoadXml(path, ref tTarget); } } GUILayout.EndHorizontal(); GUILayout.BeginHorizontal(); if (GUILayout.Button(new GUIContent("Save Sky Box", "Save all textures and material." + "When you are finished choose the settings, you can create a static skybox for high performance"), GUILayout.Width(100))) { SaveToTextureStarsSpaceWindow.ShowWindow(this); } if (GUILayout.Button(new GUIContent("Save Themplate", "Save parameters to XML"))) { string path = EditorUtility.SaveFilePanel( "Save template as XML", "/Assets/SunShader/Temlpates", target.name + ".xml", "xml"); if (path.Length != 0) { SaveXml(path, ref tTarget); } } GUILayout.EndHorizontal(); }