Merge branch 'master' of http://172.16.1.12/yulong/NewN_UAVPlane
This commit is contained in:
commit
d28ff6ea5d
|
@ -531,8 +531,9 @@ public class View_Panel2 : XUIPanel
|
||||||
|
|
||||||
public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
|
public RSData.RoomSubjectData currentRoomData = new RSData.RoomSubjectData();
|
||||||
|
|
||||||
public void CreateRoomBase(string roomId, string name)
|
public void CreateRoomBase(string _roomId, string name)
|
||||||
{
|
{
|
||||||
|
string roomId = _roomId.Split(',')[0];
|
||||||
GameObject roomItem = GameObject.Instantiate(root_pan, place);
|
GameObject roomItem = GameObject.Instantiate(root_pan, place);
|
||||||
roomItem.name = roomId;
|
roomItem.name = roomId;
|
||||||
roomItem.transform.Find("Text").GetComponent<Text>().text = name;
|
roomItem.transform.Find("Text").GetComponent<Text>().text = name;
|
||||||
|
@ -543,6 +544,7 @@ public class View_Panel2 : XUIPanel
|
||||||
currentRoomName = roomItem.name;
|
currentRoomName = roomItem.name;
|
||||||
GlobalFlag.roomID = roomItem.name;
|
GlobalFlag.roomID = roomItem.name;
|
||||||
GlobalFlag.practiceId = roomItem.name;
|
GlobalFlag.practiceId = roomItem.name;
|
||||||
|
GlobalFlag.currentThinkId = _roomId.Split(',')[1];
|
||||||
UIBootstrap.Instance.GetSceneData(GlobalFlag.practiceId);
|
UIBootstrap.Instance.GetSceneData(GlobalFlag.practiceId);
|
||||||
|
|
||||||
Debug.Log(" roomItem.nameID==" + roomItem.name);
|
Debug.Log(" roomItem.nameID==" + roomItem.name);
|
||||||
|
@ -755,7 +757,7 @@ public class View_Panel2 : XUIPanel
|
||||||
ReturnRoomID returnRoomId = await AsyncWebReq.Post<ReturnRoomID>("http://111.229.30.246:48888/Handler/Practice.ashx?action=add&Name=" + currentRoomName + "&MissionModel=" + currentMissionModel + "&ThinkingId=" + currentThinkingId + "&AccountsInfo=" + accountInfo, null);
|
ReturnRoomID returnRoomId = await AsyncWebReq.Post<ReturnRoomID>("http://111.229.30.246:48888/Handler/Practice.ashx?action=add&Name=" + currentRoomName + "&MissionModel=" + currentMissionModel + "&ThinkingId=" + currentThinkingId + "&AccountsInfo=" + accountInfo, null);
|
||||||
if (returnRoomId.state)
|
if (returnRoomId.state)
|
||||||
{
|
{
|
||||||
CreateRoomBase(returnRoomId.data, currentRoomName);
|
CreateRoomBase(returnRoomId.data+","+currentThinkingId, currentRoomName);
|
||||||
//创建房间
|
//创建房间
|
||||||
string RoomName = "createroom " + returnRoomId.data;
|
string RoomName = "createroom " + returnRoomId.data;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ RenderSettings:
|
||||||
m_ReflectionIntensity: 1
|
m_ReflectionIntensity: 1
|
||||||
m_CustomReflection: {fileID: 0}
|
m_CustomReflection: {fileID: 0}
|
||||||
m_Sun: {fileID: 1113159741}
|
m_Sun: {fileID: 1113159741}
|
||||||
m_IndirectSpecularColor: {r: 0.17215174, g: 0.30464625, b: 0.5979567, a: 1}
|
m_IndirectSpecularColor: {r: 0.16215044, g: 0.3062308, b: 0.67089945, a: 1}
|
||||||
m_UseRadianceAmbientProbe: 0
|
m_UseRadianceAmbientProbe: 0
|
||||||
--- !u!157 &3
|
--- !u!157 &3
|
||||||
LightmapSettings:
|
LightmapSettings:
|
||||||
|
@ -48295,6 +48295,7 @@ MonoBehaviour:
|
||||||
wrjDrag: {fileID: 3625114603376075994, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3}
|
wrjDrag: {fileID: 3625114603376075994, guid: 504e1e72e287c0740a66218ad23fbd0e, type: 3}
|
||||||
ldDrag: {fileID: 5970882834628802619, guid: beb8d369a0f07564994bb270fef9a929, type: 3}
|
ldDrag: {fileID: 5970882834628802619, guid: beb8d369a0f07564994bb270fef9a929, type: 3}
|
||||||
hpDrag: {fileID: 3438159622267457516, guid: d24981e1d16301c47a2c5d83b9d4e456, type: 3}
|
hpDrag: {fileID: 3438159622267457516, guid: d24981e1d16301c47a2c5d83b9d4e456, type: 3}
|
||||||
|
wxdDrag: {fileID: 3438159622267457516, guid: 57c5ff12282ea37439abe26b94bc93b3, type: 3}
|
||||||
Teacher: {fileID: 754191141}
|
Teacher: {fileID: 754191141}
|
||||||
student: {fileID: 1862065805184089353}
|
student: {fileID: 1862065805184089353}
|
||||||
--- !u!4 &1436809530
|
--- !u!4 &1436809530
|
||||||
|
@ -62187,7 +62188,7 @@ MonoBehaviour:
|
||||||
m_PreInfinity: 2
|
m_PreInfinity: 2
|
||||||
m_PostInfinity: 2
|
m_PostInfinity: 2
|
||||||
m_RotationOrder: 4
|
m_RotationOrder: 4
|
||||||
randSeed: 36344203
|
randSeed: 41044140
|
||||||
isDoingTransition: 0
|
isDoingTransition: 0
|
||||||
minimumHeight: 0
|
minimumHeight: 0
|
||||||
--- !u!114 &1820978574
|
--- !u!114 &1820978574
|
||||||
|
|
|
@ -12,7 +12,8 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
||||||
public HuoPaoController[] huoPaoCtrls;
|
public HuoPaoController[] huoPaoCtrls;
|
||||||
public Text modelname_text;
|
public Text modelname_text;
|
||||||
public bool isDragWRJ = true;
|
public bool isDragWRJ = true;
|
||||||
|
public string deviceID;
|
||||||
|
private Weaponitemone weaponitemones = new Weaponitemone();
|
||||||
public void OnBeginDrag(PointerEventData eventData)
|
public void OnBeginDrag(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
if (model == null)
|
if (model == null)
|
||||||
|
@ -32,14 +33,15 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnEndDrag(PointerEventData eventData)
|
public async void OnEndDrag(PointerEventData eventData)
|
||||||
{
|
{
|
||||||
if (model != null)
|
if (model != null)
|
||||||
{
|
{
|
||||||
if (isDragWRJ)
|
if (isDragWRJ)
|
||||||
{
|
{
|
||||||
model.GetComponent<UnmannedAerialVehicleManage>().isStartRehearsing = GlobalFlag.isStartRehearsing;
|
model.GetComponent<UnmannedAerialVehicleManage>().isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||||
|
weaponitemones = await AsyncWebReq.Post<Weaponitemone>("http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=querydevicepara&think_device_id=" + deviceID, null);
|
||||||
|
model.GetComponent<UnmannedAerialVehicleManage>().FillInTheData(weaponitemones);
|
||||||
//for (int i = 0; i < huoPaoCtrls.Length; i++)
|
//for (int i = 0; i < huoPaoCtrls.Length; i++)
|
||||||
//{
|
//{
|
||||||
// huoPaoCtrls[i].wrjs.Add(model);
|
// huoPaoCtrls[i].wrjs.Add(model);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
using AdamSync;
|
using AdamSync;
|
||||||
|
using Boo.Lang;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
@ -12,9 +13,9 @@ public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public SyncPlayerTransform playerTransformPrefab;
|
public SyncPlayerTransform playerTransformPrefab;
|
||||||
public Transform spawnPos;
|
public Transform spawnPos;
|
||||||
public List<ulong> userIds = new List<ulong>();
|
public System.Collections.Generic.List<ulong> userIds = new System.Collections.Generic.List<ulong>();
|
||||||
public TenkokuModule tenkokuModule;
|
public TenkokuModule tenkokuModule;
|
||||||
public List<ModelInfo> modelsInfo = new List<ModelInfo>();
|
public System.Collections.Generic.List<ModelInfo> modelsInfo = new System.Collections.Generic.List<ModelInfo>();
|
||||||
public Transform dviceContent;
|
public Transform dviceContent;
|
||||||
public GameObject wrjDrag;
|
public GameObject wrjDrag;
|
||||||
public GameObject ldDrag;
|
public GameObject ldDrag;
|
||||||
|
@ -22,6 +23,7 @@ public class GameManager : MonoBehaviour
|
||||||
public GameObject wxdDrag;
|
public GameObject wxdDrag;
|
||||||
public GameObject Teacher;
|
public GameObject Teacher;
|
||||||
public GameObject student;
|
public GameObject student;
|
||||||
|
public Weaponitem weaponitem = new Weaponitem();
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
@ -36,7 +38,7 @@ public class GameManager : MonoBehaviour
|
||||||
student.gameObject.SetActive(true);
|
student.gameObject.SetActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GetAllWeapons();
|
||||||
|
|
||||||
SyncCreateRoom.getroomusersRequset += OnGetRoomUsers;
|
SyncCreateRoom.getroomusersRequset += OnGetRoomUsers;
|
||||||
SyncCreateRoom.send2roomRequset += OnOtherPlayerOnline;
|
SyncCreateRoom.send2roomRequset += OnOtherPlayerOnline;
|
||||||
|
@ -50,19 +52,54 @@ public class GameManager : MonoBehaviour
|
||||||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
|
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
|
||||||
{
|
{
|
||||||
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
|
||||||
|
for (int i = 0; i < GetDeviceByName("蜂群无人机").Count; i++)
|
||||||
|
{
|
||||||
GameObject wrj = Instantiate(wrjDrag, dviceContent);
|
GameObject wrj = Instantiate(wrjDrag, dviceContent);
|
||||||
|
wrj.GetComponent<DragController>().deviceID = GetDeviceByName("蜂群无人机")[i].id;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
|
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
|
||||||
|
for (int i = 0; i < GetDeviceByName("探测雷达").Count; i++)
|
||||||
|
{
|
||||||
GameObject ld = Instantiate(ldDrag, dviceContent);
|
GameObject ld = Instantiate(ldDrag, dviceContent);
|
||||||
|
ld.GetComponent<DragController>().deviceID = GetDeviceByName("探测雷达")[i].id;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < GetDeviceByName("激光火控平台").Count; i++)
|
||||||
|
{
|
||||||
GameObject hp = Instantiate(hpDrag, dviceContent);
|
GameObject hp = Instantiate(hpDrag, dviceContent);
|
||||||
GameObject wzd = Instantiate(wxdDrag, dviceContent);
|
hp.GetComponent<DragController>().deviceID = GetDeviceByName("激光火控平台")[i].id;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < GetDeviceByName("地面无线电干扰").Count; i++)
|
||||||
|
{
|
||||||
|
GameObject wxd = Instantiate(wxdDrag, dviceContent);
|
||||||
|
wxd.GetComponent<DragController>().deviceID = GetDeviceByName("地面无线电干扰")[i].id;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
||||||
tenkokuModule.mainCamera = spt.transform;
|
tenkokuModule.mainCamera = spt.transform;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private async void GetAllWeapons()
|
||||||
|
{
|
||||||
|
weaponitem = await AsyncWebReq.Post<Weaponitem>("http://172.16.1.254:48888/Handler/Thinkingfile.ashx?action=querydevice&think_id=" + GlobalFlag.currentThinkId, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public System.Collections.Generic.List<DataItem1> GetDeviceByName(string deviceName)
|
||||||
|
{
|
||||||
|
System.Collections.Generic.List<DataItem1> detaIteml = new System.Collections.Generic.List<DataItem1>();
|
||||||
|
for (int i = 0; i < weaponitem.data.Count; i++)
|
||||||
|
{
|
||||||
|
if (weaponitem.data[i].device_name == deviceName)
|
||||||
|
detaIteml.Add(weaponitem.data[i]);
|
||||||
|
}
|
||||||
|
return detaIteml;
|
||||||
|
}
|
||||||
|
|
||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
SetWeatherValue();
|
SetWeatherValue();
|
||||||
|
@ -171,7 +208,7 @@ public class GameManager : MonoBehaviour
|
||||||
Debug.Log(info);
|
Debug.Log(info);
|
||||||
if (info.Length > 0 && !string.IsNullOrWhiteSpace(info))
|
if (info.Length > 0 && !string.IsNullOrWhiteSpace(info))
|
||||||
{
|
{
|
||||||
modelsInfo = Jsonanalyze.FromJson<List<ModelInfo>>(info);
|
modelsInfo = Jsonanalyze.FromJson<System.Collections.Generic.List<ModelInfo>>(info);
|
||||||
for (int i = 0; i < modelsInfo.Count; i++)
|
for (int i = 0; i < modelsInfo.Count; i++)
|
||||||
{
|
{
|
||||||
GameObject obj = Resources.Load<GameObject>(modelsInfo[i].str);
|
GameObject obj = Resources.Load<GameObject>(modelsInfo[i].str);
|
||||||
|
|
|
@ -12,4 +12,8 @@ public class GlobalFlag
|
||||||
///是否正在预演
|
///是否正在预演
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static bool isStartRehearsing;
|
public static bool isStartRehearsing;
|
||||||
|
/// <summary>
|
||||||
|
/// 当前想定ID
|
||||||
|
/// </summary>
|
||||||
|
public static string currentThinkId;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue