Compare commits
2 Commits
af41c74eb8
...
b06b307c11
Author | SHA1 | Date |
---|---|---|
|
b06b307c11 | |
|
3d496c0184 |
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d174948813452c644abed14232cddd9a
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,8 +0,0 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 2867c644cac2f7b488d4acbc11bd2ea4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -367,6 +367,7 @@ public class Weaponitem
|
|||
/// </summary>
|
||||
public List<DataItem1> data { get; set; }
|
||||
}
|
||||
[System.Serializable]
|
||||
public class Weaponitemone
|
||||
{
|
||||
/// <summary>
|
||||
|
@ -382,6 +383,7 @@ public class Weaponitemone
|
|||
/// </summary>
|
||||
public List<Aircraft> data { get; set; }
|
||||
}
|
||||
[System.Serializable]
|
||||
public class Aircraft
|
||||
{
|
||||
/// <summary>
|
||||
|
|
|
@ -531,9 +531,8 @@ public class View_Panel2 : XUIPanel
|
|||
|
||||
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);
|
||||
roomItem.name = roomId;
|
||||
roomItem.transform.Find("Text").GetComponent<Text>().text = name;
|
||||
|
@ -544,7 +543,7 @@ public class View_Panel2 : XUIPanel
|
|||
currentRoomName = roomItem.name;
|
||||
GlobalFlag.roomID = roomItem.name;
|
||||
GlobalFlag.practiceId = roomItem.name;
|
||||
GlobalFlag.currentThinkId = _roomId.Split(',')[1];
|
||||
GlobalFlag.currentThinkId = roomItem.name;
|
||||
UIBootstrap.Instance.GetSceneData(GlobalFlag.practiceId);
|
||||
|
||||
Debug.Log(" roomItem.nameID==" + roomItem.name);
|
||||
|
@ -757,7 +756,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);
|
||||
if (returnRoomId.state)
|
||||
{
|
||||
CreateRoomBase(returnRoomId.data+","+currentThinkingId, currentRoomName);
|
||||
CreateRoomBase(returnRoomId.data, currentRoomName);
|
||||
//创建房间
|
||||
string RoomName = "createroom " + returnRoomId.data;
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
|
||||
namespace AdamThinkDevicesData
|
||||
{
|
||||
[Serializable]
|
||||
public class List_paraItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string id ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PracticeId ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string think_id ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string think_device_id ;
|
||||
/// <summary>
|
||||
/// 转台转速:
|
||||
/// </summary>
|
||||
public string para_name ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string para_type ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string para_value ;
|
||||
/// <summary>
|
||||
/// s/圈
|
||||
/// </summary>
|
||||
public string para_unit ;
|
||||
/// <summary>
|
||||
/// 12s/圈
|
||||
/// </summary>
|
||||
public string r1 ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string r2 ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string r3 ;
|
||||
}
|
||||
[Serializable]
|
||||
public class DataItem
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string id ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string PracticeId ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string think_id ;
|
||||
/// <summary>
|
||||
/// 探测雷达
|
||||
/// </summary>
|
||||
public string device_name ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public int device_count ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string r1 ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string r2 ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string r3 ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<List_paraItem> list_para ;
|
||||
}
|
||||
[Serializable]
|
||||
public class Root
|
||||
{
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string state ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public string message ;
|
||||
/// <summary>
|
||||
///
|
||||
/// </summary>
|
||||
public List<DataItem> data ;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 852c0a2b137c9f04581fc678b45b4e5c
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,4 +1,5 @@
|
|||
using System.Collections;
|
||||
using AdamThinkDevicesData;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
@ -13,7 +14,6 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
|||
public Text modelname_text;
|
||||
public bool isDragWRJ = true;
|
||||
public string deviceID;
|
||||
private Weaponitemone weaponitemones = new Weaponitemone();
|
||||
public void OnBeginDrag(PointerEventData eventData)
|
||||
{
|
||||
if (model == null)
|
||||
|
@ -37,17 +37,10 @@ public class DragController : MonoBehaviour, IBeginDragHandler, IEndDragHandler,
|
|||
{
|
||||
if (model != null)
|
||||
{
|
||||
if (isDragWRJ)
|
||||
{
|
||||
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++)
|
||||
//{
|
||||
// huoPaoCtrls[i].wrjs.Add(model);
|
||||
//}
|
||||
//model.GetComponent<WRJController>().huoPaoControllerList = huoPaoCtrls;
|
||||
}
|
||||
model.GetComponent<UnmannedAerialVehicleManage>().isStartRehearsing = GlobalFlag.isStartRehearsing;
|
||||
|
||||
List<List_paraItem> temp = UIBootstrap.Instance.GetListParaItemById(deviceID);
|
||||
model.GetComponent<UnmannedAerialVehicleManage>().FillInTheData(temp);
|
||||
if (DragManager.Instance != null)
|
||||
{
|
||||
DragManager.Instance.AddObj(model);//把对应模型传入链表
|
||||
|
|
|
@ -23,7 +23,6 @@ public class GameManager : MonoBehaviour
|
|||
public GameObject wxdDrag;
|
||||
public GameObject Teacher;
|
||||
public GameObject student;
|
||||
public Weaponitem weaponitem = new Weaponitem();
|
||||
// Start is called before the first frame update
|
||||
private void Awake()
|
||||
{
|
||||
|
@ -38,7 +37,6 @@ public class GameManager : MonoBehaviour
|
|||
student.gameObject.SetActive(true);
|
||||
}
|
||||
|
||||
GetAllWeapons();
|
||||
|
||||
SyncCreateRoom.getroomusersRequset += OnGetRoomUsers;
|
||||
SyncCreateRoom.send2roomRequset += OnOtherPlayerOnline;
|
||||
|
@ -52,53 +50,51 @@ public class GameManager : MonoBehaviour
|
|||
if (UIBootstrap.Instance.GetRoleByIDPracticeId(GlobalFlag.practiceSeatId) == "0")
|
||||
{
|
||||
spt.GetComponent<Camera>().cullingMask = ~(1 << 11);
|
||||
for (int i = 0; i < GetDeviceByName("蜂群无人机").Count; i++)
|
||||
|
||||
if (UIBootstrap.Instance.GetDeviceByName("蜂群无人机").device_count > 0)
|
||||
{
|
||||
GameObject wrj = Instantiate(wrjDrag, dviceContent);
|
||||
wrj.GetComponent<DragController>().deviceID = GetDeviceByName("蜂群无人机")[i].id;
|
||||
for (int i = 0; i < UIBootstrap.Instance.GetDeviceByName("蜂群无人机").device_count; i++)
|
||||
{
|
||||
GameObject wrj = Instantiate(wrjDrag, dviceContent);
|
||||
wrj.GetComponent<DragController>().deviceID = UIBootstrap.Instance.GetDeviceByName("蜂群无人机").id;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
spt.GetComponent<Camera>().cullingMask = ~(1 << 12);
|
||||
for (int i = 0; i < GetDeviceByName("探测雷达").Count; i++)
|
||||
if (UIBootstrap.Instance.GetDeviceByName("探测雷达").device_count > 0)
|
||||
{
|
||||
GameObject ld = Instantiate(ldDrag, dviceContent);
|
||||
ld.GetComponent<DragController>().deviceID = GetDeviceByName("探测雷达")[i].id;
|
||||
for (int i = 0; i < UIBootstrap.Instance.GetDeviceByName("探测雷达").device_count; i++)
|
||||
{
|
||||
GameObject ld = Instantiate(ldDrag, dviceContent);
|
||||
ld.GetComponent<DragController>().deviceID = UIBootstrap.Instance.GetDeviceByName("探测雷达").id;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < GetDeviceByName("激光火控平台").Count; i++)
|
||||
if (UIBootstrap.Instance.GetDeviceByName("激光火控平台").device_count > 0)
|
||||
{
|
||||
GameObject hp = Instantiate(hpDrag, dviceContent);
|
||||
hp.GetComponent<DragController>().deviceID = GetDeviceByName("激光火控平台")[i].id;
|
||||
for (int i = 0; i < UIBootstrap.Instance.GetDeviceByName("激光火控平台").device_count; i++)
|
||||
{
|
||||
GameObject hp = Instantiate(hpDrag, dviceContent);
|
||||
hp.GetComponent<DragController>().deviceID = UIBootstrap.Instance.GetDeviceByName("激光火控平台").id;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < GetDeviceByName("地面无线电干扰").Count; i++)
|
||||
if (UIBootstrap.Instance.GetDeviceByName("地面无线电干扰").device_count > 0)
|
||||
{
|
||||
GameObject wxd = Instantiate(wxdDrag, dviceContent);
|
||||
wxd.GetComponent<DragController>().deviceID = GetDeviceByName("地面无线电干扰")[i].id;
|
||||
for (int i = 0; i < UIBootstrap.Instance.GetDeviceByName("地面无线电干扰").device_count; i++)
|
||||
{
|
||||
GameObject wxd = Instantiate(wxdDrag, dviceContent);
|
||||
wxd.GetComponent<DragController>().deviceID = UIBootstrap.Instance.GetDeviceByName("地面无线电干扰").id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
userIds.Add(ulong.Parse(GlobalFlag.currentUser.user_id));
|
||||
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()
|
||||
{
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
using Newtonsoft.Json;
|
||||
using AdamThinkDevicesData;
|
||||
using Newtonsoft.Json;
|
||||
using PData;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
|
@ -12,7 +13,7 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
public SceneRoot currentSceneInfo = new SceneRoot();
|
||||
public List<RSData.SubjectDataItem> subjectInfo = new List<RSData.SubjectDataItem>();
|
||||
public List<Traininginformation> traininginformations = new List<Traininginformation>();
|
||||
|
||||
public AdamThinkDevicesData.Root thinkDevicesData = new AdamThinkDevicesData.Root();
|
||||
// Start is called before the first frame update
|
||||
private async void Start()
|
||||
{
|
||||
|
@ -41,12 +42,36 @@ public class UIBootstrap : MonoSingleton<UIBootstrap>
|
|||
subjectInfo = sdi;
|
||||
}
|
||||
|
||||
public async void GetAllDeviceData()
|
||||
{
|
||||
thinkDevicesData = await AsyncWebReq.Post<AdamThinkDevicesData.Root>("http://111.229.30.246:48888/Handler/Thinkingfile.ashx?action=practicethinkdevice&Id=" + GlobalFlag.currentThinkId, null);
|
||||
}
|
||||
public AdamThinkDevicesData.DataItem GetDeviceByName(string deviceName)
|
||||
{
|
||||
AdamThinkDevicesData.DataItem detaIteml = null;
|
||||
for (int i = 0; i < thinkDevicesData.data.Count; i++)
|
||||
{
|
||||
if (thinkDevicesData.data[i].device_name == deviceName)
|
||||
detaIteml = thinkDevicesData.data[i];
|
||||
}
|
||||
return detaIteml;
|
||||
}
|
||||
|
||||
public List<List_paraItem> GetListParaItemById(string deviceId)
|
||||
{
|
||||
for (int i = 0; i < thinkDevicesData.data.Count; i++)
|
||||
{
|
||||
if (thinkDevicesData.data[i].id == deviceId)
|
||||
return thinkDevicesData.data[i].list_para;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public string GetRoleByIDPracticeId(string practiceID)
|
||||
{
|
||||
for (int i = 0; i < subjectInfo.Count; i++)
|
||||
{
|
||||
if (subjectInfo[i].Id == practiceID&& subjectInfo[i].UserName == GlobalFlag.currentUser.real_name)
|
||||
if (subjectInfo[i].Id == practiceID && subjectInfo[i].UserName == GlobalFlag.currentUser.real_name)
|
||||
{
|
||||
return subjectInfo[i].Role;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1335
UniTask.Linq.csproj
1335
UniTask.Linq.csproj
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
1338
UniTask.csproj
1338
UniTask.csproj
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue