// Use this for initialization static void Init() { GzRNMHelperGUI window = (GzRNMHelperGUI)GetWindow <GzRNMHelperGUI>(); window.title = "RNM Helper"; basis[0] = GzBasisManager.GetGlobalBasis("basisx"); basis[1] = GzBasisManager.GetGlobalBasis("basisy"); basis[2] = GzBasisManager.GetGlobalBasis("basisz"); }
void OnGUI() { //gCurrTool = GUILayout.Toolbar(gCurrTool, gTools); //if(gCurrTool == 0) { if (gBasisAdv = EditorGUILayout.Foldout(gBasisAdv, "Advanced Basis Controls")) { basis[0] = EditorGUILayout.Vector3Field("RNM Basis X", basis[0]); basis[1] = EditorGUILayout.Vector3Field("RNM Basis Y", basis[1]); basis[2] = EditorGUILayout.Vector3Field("RNM Basis Z", basis[2]); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Cancel")) { basis[0] = GzBasisManager.GetGlobalBasis("basisx"); basis[1] = GzBasisManager.GetGlobalBasis("basisy"); basis[2] = GzBasisManager.GetGlobalBasis("basisz"); } if (GUILayout.Button("Apply Basis")) { GzBasisManager.SetBasis(basis); } EditorGUILayout.EndHorizontal(); GUILayout.Label("Note: You _MUST_ create basismaps after using this feature! Afterwards, you must rebake your lighting in your 3D application!", EditorStyles.wordWrappedLabel); EditorGUILayout.BeginHorizontal(); GUILayout.FlexibleSpace(); if (GUILayout.Button("Create Basismaps")) { GzBasisMakerUtil.MakeBasis("", basis[0], basis[1], basis[2]); } GUILayout.FlexibleSpace(); EditorGUILayout.EndHorizontal(); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("Create CRNM")) { ScriptableWizard.DisplayWizard <GzCRNMMergeGUI>("Create CRNM"); } GUILayout.FlexibleSpace(); if (GUILayout.Button("Create SSBumpmap")) { ScriptableWizard.DisplayWizard <GzSSBumpConverterGUI>("Create SSBump"); } EditorGUILayout.EndHorizontal(); } /* //NOTE: All of this never quite worked properly, but may be usable in the future. * //Uncomment this when the basis work for a new normal botcher is ready to go. * else if (gCurrTool == 1) * { * GUILayout.Label("The baking tool is an experimental feature.\nAs such, USE WITH CAUTION. You have been warned.", EditorStyles.wordWrappedLabel); * EditorGUILayout.BeginHorizontal(); * GUILayout.FlexibleSpace(); * gExpOkay = bool.Parse(gIni.GetSetting("BakeSettings", "BakeToolEnabled")); * gExpOkay = EditorGUILayout.Toggle("Okay", gExpOkay); * gIni.AddSetting("BakeSettings", "BakeToolEnabled", gExpOkay.ToString()); * gIni.SaveSettings(); * GUILayout.FlexibleSpace(); * EditorGUILayout.EndHorizontal(); * if(gExpOkay) * { * gBackup = EditorGUILayout.Toggle("Backup Scene", gBackup); * string[] lightModes = {"Directional Light Mapping (RNMs)", "Light Vector Mapping"}; * gLightModeAdv = EditorGUILayout.Foldout(gLightModeAdv, "Light Modes"); * if(gLightModeAdv) * gLightMode = GUILayout.SelectionGrid(gLightMode, lightModes, 1, EditorStyles.radioButton); * EditorGUILayout.BeginHorizontal(); * if(GUILayout.Button("Populate Scenes")) * { * if(EditorApplication.SaveCurrentSceneIfUserWantsTo()) * { * string baseScene = EditorApplication.currentScene; * EditorApplication.NewScene(); * EditorApplication.OpenSceneAdditive(baseScene); * baseScene = baseScene.Replace(".unity", ""); * if(gBackup) * EditorApplication.SaveScene(baseScene + "_backup.unity"); * EditorApplication.SaveScene(baseScene + "basisX" + ".unity"); * EditorApplication.SaveScene(baseScene + "basisY" + ".unity"); * EditorApplication.SaveScene(baseScene + "basisZ" + ".unity"); * GzRNMHelperTools.Bake(baseScene); * } * } * GUILayout.FlexibleSpace(); * GUILayout.Button("Bake"); * EditorGUILayout.EndHorizontal(); * } * } */ }