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