Skip to content

Commit

Permalink
Version Num Update
Browse files Browse the repository at this point in the history
  • Loading branch information
AcChosen committed Aug 31, 2023
1 parent 3a5e946 commit f500d83
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -359,7 +360,7 @@ public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] pro
EditorGUI.BeginChangeCheck();
{
VRSLStyles.DrawLogo();
VRSLStyles.ShurikenHeaderCentered(VRSLStyles.ver);
VRSLStyles.ShurikenHeaderCentered(VRSLStyles.GetVersion());
VRSLStyles.ShurikenHeaderCentered(GetShaderType());
VRSLStyles.PartingLine();
VRSLStyles.DepthPassWarning();
Expand Down
15 changes: 14 additions & 1 deletion Packages/com.acchosen.vr-stage-lighting/Editor/VRSLStyles.cs
Original file line number Diff line number Diff line change
@@ -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"
Expand All @@ -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:" + " <b><color=#6a15ce> 2.4.1</color></b>";
//public static string ver = "VR Stage Lighting ver:" + " <b><color=#6a15ce> 2.4.1</color></b>";

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:" + " <b><color=#b33cff>" + versionNum + "</color></b>";
return ver;
}

public static void DrawLogo()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
using System.Diagnostics.CodeAnalysis;
using System.Linq;
using UnityEngine.UIElements;
using System.IO;
#endif
#if !COMPILER_UDONSHARP && UNITY_EDITOR

Expand Down Expand Up @@ -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:" + " <b><color=#6a15ce> 2.4.1</color></b>";
//public static string ver = "VR Stage Lighting ver:" + " <b><color=#6a15ce> 2.4.1</color></b>";

public static bool hasLocalPanel, hasDepthLight;
private static VRSL_LocalUIControlPanel panel;
Expand Down Expand Up @@ -701,6 +702,19 @@ static void ShowWindow() {

}

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:" + " <b><color=#b33cff>" + versionNum + "</color></b>";
return ver;
}

static bool CheckIfDMXGIAvailable()
{
string path = "Packages/com.acchosen.vrsl-dmx-gi/Runtime/Shaders/VRSL_GI_LightTexture.shader";
Expand Down Expand Up @@ -2385,7 +2399,7 @@ GUIStyle LongLabel(int m)

void OnGUI() {
DrawLogo();
ShurikenHeaderCentered(ver);
ShurikenHeaderCentered(GetVersion());
GUILayout.Label("Control Panel",Title1());

if(Application.isPlaying)
Expand Down
21 changes: 17 additions & 4 deletions Packages/com.acchosen.vr-stage-lighting/Editor/VRSL_UdonEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
using VRC.Udon.Common.Interfaces;
using System.Collections.Immutable;
using System;
using System.IO;
#endif


Expand All @@ -23,11 +24,23 @@ namespace VRSL.EditorScripts
public class VRSL_UdonEditor : Editor
{
public static Texture logo;
public static string ver = "VR Stage Lighting ver:" + " <b><color=#6a15ce> 2.4</color></b>";
// public static string ver = "VR Stage Lighting ver:" + " <b><color=#6a15ce> 2.4</color></b>";
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:" + " <b><color=#b33cff>" + versionNum + "</color></b>";
return ver;
}
public static void DrawLogo()
{
Vector2 contentOffset = new Vector2(0f, -2f);
Expand Down Expand Up @@ -146,7 +159,7 @@ public override void OnInspectorGUI()
serializedObject.Update();
if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return;
DrawLogo();
ShurikenHeaderCentered(ver);
ShurikenHeaderCentered(GetVersion());
EditorGUILayout.Space();
EditorGUILayout.Space();
//EditorGUILayout.Space();
Expand Down Expand Up @@ -316,7 +329,7 @@ public override void OnInspectorGUI()
{
if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return;
DrawLogo();
ShurikenHeaderCentered(ver);
ShurikenHeaderCentered(GetVersion());
EditorGUILayout.Space();
EditorGUILayout.Space();

Expand Down Expand Up @@ -394,7 +407,7 @@ public override void OnInspectorGUI()
{
if (UdonSharpGUI.DrawDefaultUdonSharpBehaviourHeader(target)) return;
DrawLogo();
ShurikenHeaderCentered(ver);
ShurikenHeaderCentered(GetVersion());
EditorGUILayout.Space();
EditorGUILayout.Space();

Expand Down

0 comments on commit f500d83

Please sign in to comment.