生成脚本传递
This commit is contained in:
parent
cddd9c869a
commit
8fe23716ee
|
@ -2,12 +2,14 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
|
using AdamSync;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 设备
|
/// 设备
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class EquipmentCommon : MonoBehaviour
|
public class EquipmentCommon : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public EquipmentCommon equipmentCommon;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 场景所在方
|
/// 场景所在方
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -38,6 +40,7 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
|
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
equipmentCommons.Add(this);
|
equipmentCommons.Add(this);
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
OnActivationChanged += OnActivationChangedHandler;
|
||||||
|
@ -49,6 +52,12 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
/// <param name="newValue"></param>
|
/// <param name="newValue"></param>
|
||||||
void OnActivationChangedHandler(bool newValue)
|
void OnActivationChangedHandler(bool newValue)
|
||||||
{
|
{
|
||||||
|
if (equipmentCommon)
|
||||||
|
{
|
||||||
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
||||||
|
Debug.Log(msg);
|
||||||
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
|
}
|
||||||
switch (equipmentType)
|
switch (equipmentType)
|
||||||
{
|
{
|
||||||
case "激光火控平台":
|
case "激光火控平台":
|
||||||
|
@ -78,6 +87,12 @@ public class EquipmentCommon : MonoBehaviour
|
||||||
/// <param name="weaponitemone"></param>
|
/// <param name="weaponitemone"></param>
|
||||||
public void FillInTheData(List<List_paraItem> weaponitemone)
|
public void FillInTheData(List<List_paraItem> weaponitemone)
|
||||||
{
|
{
|
||||||
|
if (equipmentCommon)
|
||||||
|
{
|
||||||
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
||||||
|
Debug.Log(msg);
|
||||||
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
|
}
|
||||||
switch (equipmentType)
|
switch (equipmentType)
|
||||||
{
|
{
|
||||||
case "激光火控平台":
|
case "激光火控平台":
|
||||||
|
|
|
@ -3,12 +3,14 @@ using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using DG.Tweening;
|
using DG.Tweening;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
|
using AdamSync;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 激光火控平台
|
/// 激光火控平台
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class LaserFireControlPlatformManger : MonoBehaviour
|
public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public EquipmentCommon equipmentCommon;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 所有激光火控平台
|
/// 所有激光火控平台
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -48,14 +50,6 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
public float interval = 5.0f;
|
public float interval = 5.0f;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 测试用
|
|
||||||
/// </summary>
|
|
||||||
public string msg;
|
|
||||||
/// <summary>
|
|
||||||
/// 测试接受数据
|
|
||||||
/// </summary>
|
|
||||||
private Weaponitemone weaponitemones;
|
|
||||||
|
|
||||||
#region 激光火控平台数据
|
#region 激光火控平台数据
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -93,6 +87,7 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
laserFireControlPlatformMangers.Add(this);
|
laserFireControlPlatformMangers.Add(this);
|
||||||
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
||||||
//FillInTheData(weaponitemones);//测试写入
|
//FillInTheData(weaponitemones);//测试写入
|
||||||
|
@ -152,6 +147,12 @@ public class LaserFireControlPlatformManger : MonoBehaviour
|
||||||
/// <param name="weaponitemone"></param>
|
/// <param name="weaponitemone"></param>
|
||||||
public void FillInTheData(List<List_paraItem> weaponitemone)
|
public void FillInTheData(List<List_paraItem> weaponitemone)
|
||||||
{
|
{
|
||||||
|
if (equipmentCommon)
|
||||||
|
{
|
||||||
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
||||||
|
Debug.Log(msg);
|
||||||
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
|
}
|
||||||
for (int i = 0; i < weaponitemone.Count; i++)
|
for (int i = 0; i < weaponitemone.Count; i++)
|
||||||
{
|
{
|
||||||
switch (weaponitemone[i].para_name)
|
switch (weaponitemone[i].para_name)
|
||||||
|
|
|
@ -2,12 +2,15 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
|
using AdamSync;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 雷达控制
|
/// 雷达控制
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class RadarManger : MonoBehaviour
|
public class RadarManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public EquipmentCommon equipmentCommon;
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
private bool _isStartRehearsing = false;
|
private bool _isStartRehearsing = false;
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -43,14 +46,6 @@ public class RadarManger : MonoBehaviour
|
||||||
public float interval = 5.0f;
|
public float interval = 5.0f;
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// 测试用
|
|
||||||
/// </summary>
|
|
||||||
public string msg;
|
|
||||||
/// <summary>
|
|
||||||
/// 测试接受数据
|
|
||||||
/// </summary>
|
|
||||||
private Weaponitemone weaponitemones;
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 雷达UI预制体
|
/// 雷达UI预制体
|
||||||
|
@ -123,8 +118,7 @@ public class RadarManger : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
//FillInTheData(weaponitemones);
|
|
||||||
aniRandar = GetComponent<Animator>();
|
aniRandar = GetComponent<Animator>();
|
||||||
if (RadarUi == null)
|
if (RadarUi == null)
|
||||||
{
|
{
|
||||||
|
@ -137,12 +131,9 @@ public class RadarManger : MonoBehaviour
|
||||||
|
|
||||||
// Update is called once per frame
|
// Update is called once per frame
|
||||||
void Update()
|
void Update()
|
||||||
{
|
|
||||||
if (isStartRehearsing)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
#region 启动暂停
|
#region 启动暂停
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 导条变化调用
|
/// 导条变化调用
|
||||||
|
@ -219,6 +210,12 @@ public class RadarManger : MonoBehaviour
|
||||||
/// <param name="weaponitemone"></param>
|
/// <param name="weaponitemone"></param>
|
||||||
public void FillInTheData(List<List_paraItem> weaponitemone)
|
public void FillInTheData(List<List_paraItem> weaponitemone)
|
||||||
{
|
{
|
||||||
|
if (equipmentCommon)
|
||||||
|
{
|
||||||
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
||||||
|
Debug.Log(msg);
|
||||||
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
|
}
|
||||||
for (int i = 0; i < weaponitemone.Count; i++)
|
for (int i = 0; i < weaponitemone.Count; i++)
|
||||||
{
|
{
|
||||||
switch (weaponitemone[i].para_name)
|
switch (weaponitemone[i].para_name)
|
||||||
|
|
|
@ -2,6 +2,7 @@ using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using AdamThinkDevicesData;
|
using AdamThinkDevicesData;
|
||||||
|
using AdamSync;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 地面无线电干扰控制
|
/// 地面无线电干扰控制
|
||||||
|
@ -9,15 +10,7 @@ using AdamThinkDevicesData;
|
||||||
public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
|
||||||
|
public EquipmentCommon equipmentCommon;
|
||||||
/// <summary>
|
|
||||||
/// 测试用
|
|
||||||
/// </summary>
|
|
||||||
public string msg;
|
|
||||||
/// <summary>
|
|
||||||
/// 测试接受数据
|
|
||||||
/// </summary>
|
|
||||||
private Weaponitemone weaponitemones;
|
|
||||||
|
|
||||||
#region 地面无线电干扰数据
|
#region 地面无线电干扰数据
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -82,9 +75,7 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
// Start is called before the first frame update
|
// Start is called before the first frame update
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
//weaponitemones = Newtonsoft.Json.JsonConvert.DeserializeObject<Weaponitemone>(msg);
|
equipmentCommon = GetComponent<EquipmentCommon>();
|
||||||
//FillInTheData(weaponitemones);//测试写入
|
|
||||||
|
|
||||||
// 订阅布尔值变化事件
|
// 订阅布尔值变化事件
|
||||||
OnActivationChanged += OnActivationChangedHandler;
|
OnActivationChanged += OnActivationChangedHandler;
|
||||||
}
|
}
|
||||||
|
@ -153,6 +144,12 @@ public class TerrestrialRadioInterferenceManger : MonoBehaviour
|
||||||
/// <param name="weaponitemone"></param>
|
/// <param name="weaponitemone"></param>
|
||||||
public void FillInTheData(List<List_paraItem> weaponitemone)
|
public void FillInTheData(List<List_paraItem> weaponitemone)
|
||||||
{
|
{
|
||||||
|
if (equipmentCommon)
|
||||||
|
{
|
||||||
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
||||||
|
Debug.Log(msg);
|
||||||
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
|
}
|
||||||
for (int i = 0; i < weaponitemone.Count; i++)
|
for (int i = 0; i < weaponitemone.Count; i++)
|
||||||
{
|
{
|
||||||
switch (weaponitemone[i].para_name)
|
switch (weaponitemone[i].para_name)
|
||||||
|
|
|
@ -217,7 +217,7 @@ public class UnmannedAerialVehicleManage : MonoBehaviour
|
||||||
{
|
{
|
||||||
if (equipmentCommon)
|
if (equipmentCommon)
|
||||||
{
|
{
|
||||||
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
string msg = $"send2room {equipmentCommon.equipmentType}+{transform.position.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}+{transform.eulerAngles.ToString().Replace(" ", "").Replace("(", "").Replace(")", "")}";
|
||||||
Debug.Log(msg);
|
Debug.Log(msg);
|
||||||
_ = SyncCreateRoom.SendMessageAsync(msg);
|
_ = SyncCreateRoom.SendMessageAsync(msg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue