This commit is contained in:
YangHua 2024-01-28 17:13:46 +08:00
parent a30d997487
commit eeb9868254
3 changed files with 3 additions and 5 deletions

View File

@ -44,8 +44,6 @@ public class GameManager : MonoSingleton<GameManager>
// Start is called before the first frame update // Start is called before the first frame update
private void Awake() private void Awake()
{ {
GlobalFlag.blueOrRed = 1;
Debug.Log(GlobalFlag.blueOrRed);
postureBtn.onClick.AddListener(() => postureBtn.onClick.AddListener(() =>
{ {
ChangeView(0); ChangeView(0);
@ -147,7 +145,6 @@ public class GameManager : MonoSingleton<GameManager>
///04 student 03 teacher ///04 student 03 teacher
if (GlobalFlag.currentUser.role_code == "04") if (GlobalFlag.currentUser.role_code == "04")
{ {
GlobalFlag.blueOrRed = 4;
Teacher.gameObject.SetActive(false); Teacher.gameObject.SetActive(false);
student.gameObject.SetActive(true); student.gameObject.SetActive(true);
GlobalFlag.isStartRehearsing = (UIBootstrap.Instance.GetRoomStateById(GlobalFlag.roomID) == 1); GlobalFlag.isStartRehearsing = (UIBootstrap.Instance.GetRoomStateById(GlobalFlag.roomID) == 1);
@ -159,6 +156,7 @@ public class GameManager : MonoSingleton<GameManager>
} }
if (GlobalFlag.currentUser.role_code == "03") if (GlobalFlag.currentUser.role_code == "03")
{ {
GlobalFlag.blueOrRed = 3;
Teacher.gameObject.SetActive(true); Teacher.gameObject.SetActive(true);
student.gameObject.SetActive(false); student.gameObject.SetActive(false);
spt.GetComponent<Camera>().cullingMask = -1; spt.GetComponent<Camera>().cullingMask = -1;
@ -176,6 +174,7 @@ public class GameManager : MonoSingleton<GameManager>
AddPlayers(spt); AddPlayers(spt);
DeviceManager.Instance.OnInit(); DeviceManager.Instance.OnInit();
DeviceManager.Instance.isStartRehearsing = GlobalFlag.isStartRehearsing; DeviceManager.Instance.isStartRehearsing = GlobalFlag.isStartRehearsing;
Debug.Log(" GlobalFlag.blueOrRed----"+ GlobalFlag.blueOrRed);
} }

View File

@ -26,5 +26,5 @@ public class GlobalFlag
/// <summary> /// <summary>
/// 红方蓝方 /// 红方蓝方
/// </summary> /// </summary>
public static int blueOrRed; public static int blueOrRed = -1;
} }

View File

@ -175,7 +175,6 @@ public class HighPriorityTarget : MonoBehaviour
KeyObjectiveUI.transform.LookAt(Camera.main.transform); KeyObjectiveUI.transform.LookAt(Camera.main.transform);
if (GlobalFlag.blueOrRed == 1) if (GlobalFlag.blueOrRed == 1)
{ {
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0))
{ {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);