//Store values in the volatile SessionState static void Init() { GetRootFolder(); //Check Substance installation #if UNITY_2018_1_OR_NEWER SessionState.SetBool("SUBSTANCE_INSTALLED", FAE_Core.SubstanceInstalled()); #endif }
//Store values in the volatile SessionState static void Init() { //Check Substance installation #if UNITY_2018_1_OR_NEWER SessionState.SetBool("SUBSTANCE_INSTALLED", FAE_Core.SubstanceInstalled()); #endif //Get script path string[] res = System.IO.Directory.GetFiles("Assets", "FAE_Core.cs", SearchOption.AllDirectories); string scriptFilePath = res[0]; //Truncate to get relative path SessionState.SetString("PATH", scriptFilePath.Replace("\\Scripts\\Editor\\FAE_Core.cs", string.Empty)); //Debug.Log(SessionState.GetString("PATH", "")); //Load banner image SessionState.SetString("HEADERIMG_PATH", SessionState.GetString("PATH", "") + "Scripts/Editor/Images/FAE_Banner.png"); }
void DrawInstallation() { SetWindowHeight(335); EditorGUILayout.LabelField("Render pipeline conversion", EditorStyles.boldLabel); #if !UNITY_2019_3_OR_NEWER EditorGUILayout.HelpBox("Universal Render Pipeline support requires Unity 2019.3.7f1 or newer", MessageType.Info); #else if (UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null) { EditorGUILayout.HelpBox("No Scriptable Render Pipeline is currently active", MessageType.Warning); } EditorGUILayout.BeginHorizontal(); { if (GUILayout.Button("<b><size=16>Built-in</size></b>\n<i>Amplify Shader Editor shaders</i>", Button)) { FAE_Core.InstallShaders(FAE_Core.ShaderInstallation.BuiltIn); } using (new EditorGUI.DisabledGroupScope(UnityEngine.Rendering.GraphicsSettings.renderPipelineAsset == null)) { if (GUILayout.Button("<b><size=16>Universal RP</size></b>\n<i>Shader Graph shaders</i>", Button)) { FAE_Core.InstallShaders(FAE_Core.ShaderInstallation.UniversalRP); } } } EditorGUILayout.EndHorizontal(); EditorGUILayout.Space(); using (new EditorGUILayout.HorizontalScope()) { EditorGUILayout.HelpBox("Note: Grass shader for the URP is available on the Asset Store", MessageType.Info); if (GUILayout.Button("Open Asset Store", GUILayout.Height(40f), GUILayout.Width(120f))) { Application.OpenURL("com.unity3d.kharma:content/143830"); } } #endif }
//Store values in the volatile SessionState static void Init() { FAE_Core.GetRootFolder(); }
void DrawInstallation() { //Compiling if (EditorApplication.isCompiling) { EditorGUILayout.Space(); EditorGUILayout.LabelField(new GUIContent(" Compiling scripts...", EditorGUIUtility.FindTexture("cs Script Icon")), Header); EditorGUILayout.Space(); return; } if (SessionState.GetBool("SUBSTANCE_INSTALLED", true)) { SetWindowHeight(400f); } else { SetWindowHeight(400f); } //Substance EditorGUILayout.BeginHorizontal(EditorStyles.helpBox); EditorGUILayout.LabelField("Substance support:"); Color defaultColor = GUI.contentColor; if (SessionState.GetBool("SUBSTANCE_INSTALLED", true)) { GUI.contentColor = Color.green; EditorGUILayout.LabelField("Plugin Installed"); GUI.contentColor = defaultColor; } else { GUI.contentColor = Color.red; EditorGUILayout.LabelField("PLUGIN NOT INSTALLED", EditorStyles.boldLabel); GUI.contentColor = defaultColor; } EditorGUILayout.EndHorizontal(); //Substance not installed, display instructions if (!SessionState.GetBool("SUBSTANCE_INSTALLED", true)) { EditorGUILayout.HelpBox("In order to install Substance materials, the \"Substance in Unity\" plugin must be installed", MessageType.Error); EditorGUILayout.Space(); if (GUILayout.Button("<b><size=16>Install free plugin</size></b>\n<i>Opens Asset Store page</i>", Button)) { Application.OpenURL("com.unity3d.kharma:content/110555"); this.Close(); } EditorGUILayout.Space(); EditorGUILayout.LabelField("Once installed, re-open this window to install the materials"); return; } else { EditorGUILayout.Space(); EditorGUILayout.HelpBox("The \"Substance in Unity\" plugin is installed.\n\nYou can choose to convert all materials to use Substance textures and enable more customization options.", MessageType.Info); EditorGUILayout.Space(); EditorGUILayout.LabelField("Choose material installation:", EditorStyles.boldLabel); } EditorGUILayout.BeginHorizontal(); if (GUILayout.Button("<b><size=14>Regular</size></b>\n<i>Non-customizable Unity textures</i>", Button)) { FAE_Core.InstallMaterials(FAE_Core.MaterialInstallation.Regular); } if (GUILayout.Button("<b><size=14>Substance</size></b>\n<i>Customizable procedural textures</i>", Button)) { FAE_Core.InstallMaterials(FAE_Core.MaterialInstallation.Substance); } EditorGUILayout.EndHorizontal(); }