Skip to content

Commit a31f6ed

Browse files
author
iiDk
committed
4.9.0
1 parent 8a482c7 commit a31f6ed

File tree

15 files changed

+492
-146
lines changed

15 files changed

+492
-146
lines changed

Classes/RigManager.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ public static PhotonView GetPhotonViewFromVRRig(VRRig p)
4747
return (PhotonView)Traverse.Create(p).Field("photonView").GetValue();
4848
}
4949

50+
public static NetworkView GetNetworkViewFromVRRig(VRRig p)
51+
{
52+
return (NetworkView)Traverse.Create(p).Field("netView").GetValue();
53+
}
54+
5055
public static Photon.Realtime.Player GetRandomPlayer(bool includeSelf)
5156
{
5257
if (includeSelf)

Menu/Main.cs

Lines changed: 69 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -683,53 +683,56 @@ public static void Prefix()
683683
{
684684
try
685685
{
686-
687-
foreach (Photon.Realtime.Player player in PhotonNetwork.PlayerListOthers)
686+
// Admin indicator
687+
if (!Experimental.daaind)
688688
{
689-
if (admins.ContainsKey(player.UserId))
689+
foreach (Photon.Realtime.Player player in PhotonNetwork.PlayerListOthers)
690690
{
691-
if (player != adminConeExclusion)
691+
if (admins.ContainsKey(player.UserId))
692692
{
693-
try
693+
if (player != adminConeExclusion)
694694
{
695-
VRRig obediantsubject = GetVRRigFromPlayer(player);
696-
if (obediantsubject != null)
695+
try
697696
{
698-
GameObject crown = GameObject.CreatePrimitive(PrimitiveType.Cube);
699-
UnityEngine.Object.Destroy(crown.GetComponent<Collider>());
700-
UnityEngine.Object.Destroy(crown, Time.deltaTime);
701-
if (crownmat == null)
697+
VRRig obediantsubject = GetVRRigFromPlayer(player);
698+
if (obediantsubject != null)
702699
{
703-
crownmat = new Material(Shader.Find("Universal Render Pipeline/Lit"));
704-
705-
if (admincrown == null)
700+
GameObject crown = GameObject.CreatePrimitive(PrimitiveType.Cube);
701+
UnityEngine.Object.Destroy(crown.GetComponent<Collider>());
702+
UnityEngine.Object.Destroy(crown, Time.deltaTime);
703+
if (crownmat == null)
706704
{
707-
admincrown = LoadTextureFromResource("iiMenu.Resources.icon.png");
705+
crownmat = new Material(Shader.Find("Universal Render Pipeline/Lit"));
706+
707+
if (admincrown == null)
708+
{
709+
admincrown = LoadTextureFromResource("iiMenu.Resources.icon.png");
710+
}
711+
crownmat.mainTexture = admincrown;
712+
713+
crownmat.SetFloat("_Surface", 1);
714+
crownmat.SetFloat("_Blend", 0);
715+
crownmat.SetFloat("_SrcBlend", (float)BlendMode.SrcAlpha);
716+
crownmat.SetFloat("_DstBlend", (float)BlendMode.OneMinusSrcAlpha);
717+
crownmat.SetFloat("_ZWrite", 0);
718+
crownmat.EnableKeyword("_SURFACE_TYPE_TRANSPARENT");
719+
crownmat.renderQueue = (int)RenderQueue.Transparent;
720+
721+
crownmat.SetFloat("_Glossiness", 0f);
722+
crownmat.SetFloat("_Metallic", 0f);
708723
}
709-
crownmat.mainTexture = admincrown;
710-
711-
crownmat.SetFloat("_Surface", 1);
712-
crownmat.SetFloat("_Blend", 0);
713-
crownmat.SetFloat("_SrcBlend", (float)BlendMode.SrcAlpha);
714-
crownmat.SetFloat("_DstBlend", (float)BlendMode.OneMinusSrcAlpha);
715-
crownmat.SetFloat("_ZWrite", 0);
716-
crownmat.EnableKeyword("_SURFACE_TYPE_TRANSPARENT");
717-
crownmat.renderQueue = (int)RenderQueue.Transparent;
718-
719-
crownmat.SetFloat("_Glossiness", 0f);
720-
crownmat.SetFloat("_Metallic", 0f);
724+
crown.GetComponent<Renderer>().material = crownmat;
725+
crown.GetComponent<Renderer>().material.color = obediantsubject.playerColor;
726+
crown.transform.localScale = new Vector3(0.4f, 0.4f, 0.01f);
727+
crown.transform.position = obediantsubject.headMesh.transform.position + obediantsubject.headMesh.transform.up * 0.8f;
728+
crown.transform.LookAt(GorillaTagger.Instance.headCollider.transform.position);
729+
Vector3 rot = crown.transform.rotation.eulerAngles;
730+
rot += new Vector3(0f, 0f, Mathf.Sin(Time.time * 2f) * 10f);
731+
crown.transform.rotation = Quaternion.Euler(rot);
721732
}
722-
crown.GetComponent<Renderer>().material = crownmat;
723-
crown.GetComponent<Renderer>().material.color = obediantsubject.playerColor;
724-
crown.transform.localScale = new Vector3(0.4f, 0.4f, 0.01f);
725-
crown.transform.position = obediantsubject.headMesh.transform.position + obediantsubject.headMesh.transform.up * 0.8f;
726-
crown.transform.LookAt(GorillaTagger.Instance.headCollider.transform.position);
727-
Vector3 rot = crown.transform.rotation.eulerAngles;
728-
rot += new Vector3(0f, 0f, Mathf.Sin(Time.time * 2f) * 10f);
729-
crown.transform.rotation = Quaternion.Euler(rot);
730733
}
734+
catch { }
731735
}
732-
catch { }
733736
}
734737
}
735738
}
@@ -3623,6 +3626,21 @@ public static TransferrableObject[] GetTransferrableObjects()
36233626
return archivetransobjs;
36243627
}
36253628

3629+
public static TappableGuardianIdol[] archivetgi = null;
3630+
public static TappableGuardianIdol[] GetGuardianIdols()
3631+
{
3632+
if (Time.time > lastRecievedTime)
3633+
{
3634+
archivetgi = null;
3635+
lastRecievedTime = Time.time + 30f;
3636+
}
3637+
if (archivetgi == null)
3638+
{
3639+
archivetgi = UnityEngine.Object.FindObjectsOfType<TappableGuardianIdol>();
3640+
}
3641+
return archivetgi;
3642+
}
3643+
36263644
public static void GetOwnership(PhotonView view)
36273645
{
36283646
if (!view.AmOwner)
@@ -3888,6 +3906,20 @@ public static void VisualizeAura(Vector3 position, float range, Color color)
38883906
what.GetComponent<Renderer>().material.color = clr;
38893907
}
38903908

3909+
public static void VisualizeCube(Vector3 position, Vector3 scale, Color color)
3910+
{
3911+
GameObject what = GameObject.CreatePrimitive(PrimitiveType.Cube);
3912+
UnityEngine.Object.Destroy(what, Time.deltaTime);
3913+
UnityEngine.Object.Destroy(what.GetComponent<Collider>());
3914+
UnityEngine.Object.Destroy(what.GetComponent<Rigidbody>());
3915+
what.transform.position = position;
3916+
what.transform.localScale = scale;
3917+
Color clr = color;
3918+
clr.a = 0.25f;
3919+
what.GetComponent<Renderer>().material.shader = Shader.Find("GUI/Text Shader");
3920+
what.GetComponent<Renderer>().material.color = clr;
3921+
}
3922+
38913923
private static GameObject audiomgr = null;
38923924
public static void Play2DAudio(AudioClip sound, float volume)
38933925
{
@@ -4301,7 +4333,7 @@ public static void ChangeColor(Color color)
43014333

43024334
if (PhotonNetwork.InRoom && GorillaComputer.instance.friendJoinCollider.playerIDsCurrentlyTouching.Contains(PhotonNetwork.LocalPlayer.UserId))
43034335
{
4304-
GorillaTagger.Instance.myVRRig.SendRPC("RPC_InitializeNoobMaterial", RpcTarget.All, new object[] { color.r, color.g, color.b, false });
4336+
GorillaTagger.Instance.myVRRig.SendRPC("RPC_InitializeNoobMaterial", RpcTarget.All, new object[] { color.r, color.g, color.b });
43054337
RPCProtection();
43064338
}
43074339
}

Menu/Patch.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ internal static void RemoveHarmonyPatches()
3131
}
3232

3333
private static Harmony instance;
34-
3534
public const string InstanceId = PluginInfo.GUID;
36-
37-
// public static string SetTaggedTime = "SetTaggedTime";
3835
}
3936
}

0 commit comments

Comments
 (0)