Skip to content

Commit

Permalink
Fixed the spectating feature
Browse files Browse the repository at this point in the history
  • Loading branch information
Pokruk committed Oct 26, 2024
1 parent c01064c commit 241b50e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 17 deletions.
27 changes: 11 additions & 16 deletions testplate/Camera/Comps/UI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -159,24 +159,19 @@ private void OnGUI() {
cloudsbottom.SetActive(false);
citybuildings.SetActive(false);
}

if (specui) {
var i = 1;
foreach (var player in rigcache.GetComponentsInChildren<VRRig>()) {
if (player.transform.parent.gameObject.active) {
GUI.Label(new Rect(250, 20 + i * 25, 160, 20), player.playerName);
if (GUI.Button(new Rect(360, 20 + i * 25, 67, 20), "Spectate")) {
followobject = player.gameObject;
spectating = true;
CameraController.Instance.fp = false;
CameraController.Instance.fpv = false;
CameraController.Instance.tpv = false;
if (CameraController.Instance.isFaceCamera) {
CameraController.Instance.isFaceCamera = false;
CameraController.Instance.thirdPersonCameraGo.transform.Rotate(0.0f, 180f, 0.0f);
CameraController.Instance.tabletCameraGo.transform.Rotate(0.0f, 180f, 0.0f);
CameraController.Instance.fakeWebCam.transform.Rotate(-180f, 180f, 0.0f);
}
foreach (var player in GorillaParent.instance.vrrigs.Where(rig => rig != GorillaTagger.Instance.offlineVRRig)) {
var playerName = player.playerText1.text;
GUI.Label(new Rect(250, 20 + i * 25, 160, 20), playerName);
if (GUI.Button(new Rect(360, 20 + i * 25, 67, 20), "Spectate")) {
followobject = player.gameObject;
spectating = true;
CameraController.Instance.fp = false;
CameraController.Instance.fpv = false;
CameraController.Instance.tpv = false;
if (CameraController.Instance.isFaceCamera) {
CameraController.Instance.Flip();
}
}

Expand Down
2 changes: 1 addition & 1 deletion testplate/PluginInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ internal class PluginInfo {
public const string GUID = "org.pokruk.gorillatag.cameramod";
public const string Name = "Camera Mod";
public const string Description = "Pokruk's Camera Mod";
public const string Version = "1.0.0";
public const string Version = "1.3.6";
}
}

0 comments on commit 241b50e

Please sign in to comment.