This commit is contained in:
YangHua 2024-01-29 17:44:50 +08:00
parent 2f341e93d8
commit e1e44e8b4b
1 changed files with 5 additions and 6 deletions

View File

@ -55,7 +55,8 @@ public class GameManager : MonoSingleton<GameManager>
// Start is called before the first frame update
private void Awake()
{
satelliteImagery.SetActive(false);
if (satelliteImagery != null)
satelliteImagery.SetActive(false);
postureBtn.onClick.AddListener(() =>
{
satelliteImagery.SetActive(false);
@ -79,7 +80,7 @@ public class GameManager : MonoSingleton<GameManager>
spt.transform.position = redSpawnPos.position;
spt.transform.eulerAngles = redSpawnPos.eulerAngles;
spt.gameObject.SetActive(true);
spt.GetComponent<Camera>().cullingMask = ~(1 << 12) + ~(1 << 16) + ~(1 << 17) + ~(1 << 18) + ~(1 << 19) + ~(1 << 20) + ~(1 << 21) + ~(1 << 22);
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
//spt.GetComponent<Camera>().cullingMask = ~(1 << 15);
AdamThinkDevicesData.DataItem diTemp = UIBootstrap.Instance.GetDeviceByName("蜂群无人机");
if (diTemp.device_count > 0)
@ -109,7 +110,7 @@ public class GameManager : MonoSingleton<GameManager>
spt.transform.position = blueSpawnPos.position;
spt.transform.eulerAngles = blueSpawnPos.eulerAngles;
spt.gameObject.SetActive(true);
spt.GetComponent<Camera>().cullingMask = ~(1 << 11) + ~(1 << 16) + ~(1 << 17) + ~(1 << 18) + ~(1 << 19) + ~(1 << 20) + ~(1 << 21) + ~(1 << 22);
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
if (UIBootstrap.Instance.GetDeviceByName("探测雷达").device_count > 0)
{
for (int i = 0; i < UIBootstrap.Instance.GetDeviceByName("探测雷达").device_count; i++)
@ -162,7 +163,6 @@ public class GameManager : MonoSingleton<GameManager>
Teacher.gameObject.SetActive(false);
student.gameObject.SetActive(true);
GlobalFlag.isStartRehearsing = (UIBootstrap.Instance.GetRoomStateById(GlobalFlag.roomID) == 1);
Debug.Log($"<color=red>isStartRehearsing={ GlobalFlag.isStartRehearsing}</color>");
if (GlobalFlag.isStartRehearsing)
{
spt.GetComponent<Camera>().cullingMask = -1;
@ -188,7 +188,6 @@ public class GameManager : MonoSingleton<GameManager>
AddPlayers(spt);
DeviceManager.Instance.OnInit();
DeviceManager.Instance.isStartRehearsing = GlobalFlag.isStartRehearsing;
Debug.Log(" GlobalFlag.blueOrRed----" + GlobalFlag.blueOrRed);
}
@ -203,6 +202,7 @@ public class GameManager : MonoSingleton<GameManager>
private void Update()
{
if (GlobalFlag.isStartRehearsing) return;
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0" && Input.GetMouseButtonDown(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
@ -377,7 +377,6 @@ public class GameManager : MonoSingleton<GameManager>
{
RoomState roomState = await AsyncWebReq.Post<RoomState>(Url_UpdateRoomState + GlobalFlag.roomID + "&state=1", null);
Debug.Log($"<color=red>GamemanagerRoomState={ roomState.message}</color>");
if (roomState.message == "success")
{
GlobalFlag.isStartRehearsing = true;