212
This commit is contained in:
parent
85246472d9
commit
8eac208ce0
Assets/Zion/Scripts
|
@ -321,7 +321,7 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
}
|
||||
break;
|
||||
case "StartDeduction":
|
||||
CheckRoomState();
|
||||
CheckRoomState("state=1");
|
||||
break;
|
||||
case "蜂群无人机":
|
||||
SpawnDevice(wrjDrag.prefabItem, data);
|
||||
|
@ -342,19 +342,16 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
SpawnDevice(wbDrag.prefabItem, data);
|
||||
break;
|
||||
case "Stop":
|
||||
GlobalFlag.isStartRehearsing = false;
|
||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
{
|
||||
DeviceManager.Instance.devices[i].isStartRehearsing = false;
|
||||
}
|
||||
CheckRoomState("state=0");
|
||||
|
||||
break;
|
||||
case "EndDeduction":
|
||||
GlobalFlag.isStartRehearsing = false;
|
||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
{
|
||||
DeviceManager.Instance.devices[i].isStartRehearsing = false;
|
||||
}
|
||||
CheckRoomState("state=0");
|
||||
//GlobalFlag.isStartRehearsing = false;
|
||||
//for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
//{
|
||||
// DeviceManager.Instance.devices[i].isStartRehearsing = false;
|
||||
//}
|
||||
break;
|
||||
case "offline":
|
||||
|
||||
|
@ -374,11 +371,14 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
}
|
||||
|
||||
|
||||
public async void CheckRoomState()
|
||||
public async void CheckRoomState(string state)
|
||||
{
|
||||
RoomState roomState = await AsyncWebReq.Post<RoomState>(Url_UpdateRoomState + GlobalFlag.roomID + "&state=1", null);
|
||||
RoomState roomState = await AsyncWebReq.Post<RoomState>(Url_UpdateRoomState + GlobalFlag.roomID +"&" + state, null);
|
||||
if (roomState.message == "success")
|
||||
{
|
||||
if(state == "state=1")
|
||||
{
|
||||
|
||||
GlobalFlag.isStartRehearsing = true;
|
||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
{
|
||||
|
@ -389,6 +389,15 @@ public class GameManager : MonoSingleton<GameManager>
|
|||
currentSpt.GetComponent<Camera>().cullingMask = TeacherLayer;
|
||||
//currentSpt.GetComponent<Camera>().cullingMask &= ~(1 << 15);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
GlobalFlag.isStartRehearsing = false;
|
||||
for (int i = 0; i < DeviceManager.Instance.devices.Count; i++)
|
||||
{
|
||||
DeviceManager.Instance.devices[i].isStartRehearsing = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -58,6 +58,7 @@ public class RadioAngleView : MonoBehaviour
|
|||
}
|
||||
private void Update()
|
||||
{
|
||||
if (!GlobalFlag.isStartRehearsing) return;
|
||||
if (typeWRJ != WRJModel.电子侦察无人机) return;
|
||||
targets = GameObject.FindGameObjectsWithTag("AttackTarget").ToList().FindAll(GetQualifiedEquipment);
|
||||
if (targets.Count == 0) return;
|
||||
|
|
Loading…
Reference in New Issue