diff --git a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLInspector.cs b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLInspector.cs index c86874a..2a28055 100644 --- a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLInspector.cs +++ b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLInspector.cs @@ -2,6 +2,7 @@ using System.Reflection; using UnityEditor; using UnityEngine; +using System.IO; // Based on Morioh's toon shader GUI. // This code is based off synqark's arktoon-shaders and Xiexe. @@ -359,7 +360,7 @@ public class VRSLInspector : ShaderGUI EditorGUI.BeginChangeCheck(); { VRSLStyles.DrawLogo(); - VRSLStyles.ShurikenHeaderCentered(VRSLStyles.ver); + VRSLStyles.ShurikenHeaderCentered(VRSLStyles.GetVersion()); VRSLStyles.ShurikenHeaderCentered(GetShaderType()); VRSLStyles.PartingLine(); VRSLStyles.DepthPassWarning(); diff --git a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLStyles.cs b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLStyles.cs index f3221ef..a773fa8 100644 --- a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLStyles.cs +++ b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSLStyles.cs @@ -1,6 +1,7 @@ #if !COMPILER_UDONSHARP && UNITY_EDITOR using UnityEngine; using UnityEditor; +using System.IO; // help link https://docs.unity3d.com/ScriptReference/EditorStyles.html // ---DISCLAIMER--- THIS CODE IS BASED OFF OF "SYNQARK"'s ARKTOON-SHADERS AND "XIEXE"'s UNITY-SHADERS. FOR MORE INFORMATION PLEASE REFER TO THE ORIGINAL BASE WRITER "https://github.com/synqark", "https://github.com/synqark/Arktoon-Shaders" or "https://github.com/Xiexe", "https://github.com/Xiexe/Xiexes-Unity-Shaders" @@ -10,12 +11,24 @@ public class VRSLStyles : MonoBehaviour { public static Texture logo = Resources.Load("VRStageLighting-Logo") as Texture; - public static string ver = "VR Stage Lighting ver:" + " 2.4.1"; + //public static string ver = "VR Stage Lighting ver:" + " 2.4.1"; public static void DepthPassWarning() { EditorGUILayout.HelpBox("Shader looking weird? \nPlease ensure that the depth texture is enabled by having the included 'Directional Light' prefab somewhere in your scene, located in \nAssets/VRStageLighting/VR-Stage-Lighting/Other", MessageType.Info); } + public static string GetVersion() + { + string path = Application.dataPath; + path = path.Replace("Assets",""); + path += "Packages" + "\\" + "com.acchosen.vr-stage-lighting" + "\\"; + path += "Runtime" + "\\" + "VERSION.txt"; + + StreamReader reader = new StreamReader(path); + string versionNum = reader.ReadToEnd(); + string ver = "VRSL GI ver:" + " " + versionNum + ""; + return ver; + } public static void DrawLogo() { diff --git a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_ManagerWindow.cs b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_ManagerWindow.cs index f9d4af6..7b9c979 100644 --- a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_ManagerWindow.cs +++ b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_ManagerWindow.cs @@ -19,6 +19,7 @@ using System; using System.Diagnostics.CodeAnalysis; using System.Linq; using UnityEngine.UIElements; +using System.IO; #endif #if !COMPILER_UDONSHARP && UNITY_EDITOR @@ -601,7 +602,7 @@ public class VRSL_ManagerWindow : EditorWindow { static float tiltRangeOff = -180f; public static Texture logo, github, twitter, discord; public bool legacyFixtures; - public static string ver = "VR Stage Lighting ver:" + " 2.4.1"; + //public static string ver = "VR Stage Lighting ver:" + " 2.4.1"; public static bool hasLocalPanel, hasDepthLight; private static VRSL_LocalUIControlPanel panel; @@ -701,6 +702,19 @@ public class VRSL_ManagerWindow : EditorWindow { } + public static string GetVersion() + { + string path = Application.dataPath; + path = path.Replace("Assets",""); + path += "Packages" + "\\" + "com.acchosen.vr-stage-lighting" + "\\"; + path += "Runtime" + "\\" + "VERSION.txt"; + + StreamReader reader = new StreamReader(path); + string versionNum = reader.ReadToEnd(); + string ver = "VRSL GI ver:" + " " + versionNum + ""; + return ver; + } + static bool CheckIfDMXGIAvailable() { string path = "Packages/com.acchosen.vrsl-dmx-gi/Runtime/Shaders/VRSL_GI_LightTexture.shader"; @@ -2385,7 +2399,7 @@ public class VRSL_ManagerWindow : EditorWindow { void OnGUI() { DrawLogo(); - ShurikenHeaderCentered(ver); + ShurikenHeaderCentered(GetVersion()); GUILayout.Label("Control Panel",Title1()); if(Application.isPlaying) diff --git a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_UdonEditor.cs b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_UdonEditor.cs index 0c79ee4..d5d78d3 100644 --- a/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_UdonEditor.cs +++ b/Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_UdonEditor.cs @@ -14,6 +14,7 @@ using VRC.Udon.Common; using VRC.Udon.Common.Interfaces; using System.Collections.Immutable; using System; +using System.IO; #endif @@ -23,11 +24,23 @@ namespace VRSL.EditorScripts public class VRSL_UdonEditor : Editor { public static Texture logo; - public static string ver = "VR Stage Lighting ver:" + " 2.4"; + // public static string ver = "VR Stage Lighting ver:" + " 2.4"; public void OnEnable() { logo = Resources.Load("VRStageLighting-Logo") as Texture; } + public static string GetVersion() + { + string path = Application.dataPath; + path = path.Replace("Assets",""); + path += "Packages" + "\\" + "com.acchosen.vr-stage-lighting" + "\\"; + path += "Runtime" + "\\" + "VERSION.txt"; + + StreamReader reader = new StreamReader(path); + string versionNum = reader.ReadToEnd(); + string ver = "VRSL GI ver:" + " " + versionNum + ""; + return ver; + } public static void DrawLogo() { Vector2 contentOffset = new Vector2(0f, -2f); @@ -146,7 +159,7 @@ namespace VRSL.EditorScripts serializedObject.Update(); if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return; DrawLogo(); - ShurikenHeaderCentered(ver); + ShurikenHeaderCentered(GetVersion()); EditorGUILayout.Space(); EditorGUILayout.Space(); //EditorGUILayout.Space(); @@ -316,7 +329,7 @@ namespace VRSL.EditorScripts { if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return; DrawLogo(); - ShurikenHeaderCentered(ver); + ShurikenHeaderCentered(GetVersion()); EditorGUILayout.Space(); EditorGUILayout.Space(); @@ -394,7 +407,7 @@ namespace VRSL.EditorScripts { if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return; DrawLogo(); - ShurikenHeaderCentered(ver); + ShurikenHeaderCentered(GetVersion()); EditorGUILayout.Space(); EditorGUILayout.Space();