1187 lines
55 KiB
C#
1187 lines
55 KiB
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Concurrent;
|
|
using System.Collections.Generic;
|
|
using System.Runtime.InteropServices;
|
|
using System.Text;
|
|
using System.Threading;
|
|
using System.Threading.Tasks;
|
|
using Cysharp.Threading.Tasks;
|
|
using DefaultNamespace;
|
|
using DG.Tweening;
|
|
using Newtonsoft.Json;
|
|
using UnityEngine;
|
|
using UnityEngine.UIElements;
|
|
|
|
public class MqttManager : MonoSingleton<MqttManager>
|
|
{
|
|
/// <summary>
|
|
/// 所有设备的请求头
|
|
/// </summary>
|
|
public List<Allequipment> devices = new List<Allequipment>();
|
|
/// <summary>
|
|
/// 换电池装置
|
|
/// </summary>
|
|
public List<Qcbd> qcbdequipments = new List<Qcbd>();
|
|
/// <summary>
|
|
/// 查询提升机
|
|
/// </summary>
|
|
public List<Elvequipment> elvequipments = new List<Elvequipment>();
|
|
/// <summary>
|
|
/// 拆码垛机
|
|
/// </summary>
|
|
public List<Dpmequipment> dpmequipments = new List<Dpmequipment>();
|
|
/// <summary>
|
|
/// 输送机设备
|
|
/// </summary>
|
|
public List<Convoyorequipment> convoyorequipments = new List<Convoyorequipment>();
|
|
/// <summary>
|
|
/// 输入机设备
|
|
/// </summary>
|
|
public List<Convoyorequipment> exportations = new List<Convoyorequipment>();
|
|
/// <summary>
|
|
/// 小车设备
|
|
/// </summary>
|
|
public List<Carequipment> carequipments = new List<Carequipment>();
|
|
/// <summary>
|
|
/// 查询式落地机
|
|
/// </summary>
|
|
public List<Feequipment> feequipments = new List<Feequipment>();
|
|
/// <summary>
|
|
/// 查训加去盖信息
|
|
/// </summary>
|
|
public List<Cmequipment> cmequipments = new List<Cmequipment>();
|
|
/// <summary>
|
|
/// 消息队列
|
|
/// </summary>
|
|
public ConcurrentQueue<string> messageQueue = new ConcurrentQueue<string>();
|
|
/// <summary>
|
|
/// 第一层箱子
|
|
/// </summary>
|
|
public List<GameObject> firstbox = new List<GameObject>();
|
|
/// <summary>
|
|
/// 第二层箱子
|
|
/// </summary>
|
|
public List<GameObject> secondbox = new List<GameObject>();
|
|
/// <summary>
|
|
/// 小车位移的速度
|
|
/// </summary>
|
|
public float speed = 3.5f;
|
|
/// <summary>
|
|
/// 需要渲染的箱子0
|
|
/// </summary>
|
|
public GameObject BoxID;
|
|
[Obsolete]
|
|
private void Awake()
|
|
{
|
|
//启动MQTT连接
|
|
Application.ExternalCall("OpenHtmlMQTT");
|
|
|
|
|
|
ProcessQueue().Forget();
|
|
}
|
|
private void Start()
|
|
{
|
|
|
|
}
|
|
/// <summary>
|
|
/// 接受MQTT消息
|
|
/// </summary>
|
|
/// <param name="message"></param>
|
|
public void Message(string message)
|
|
{
|
|
// Debug.Log($"接收到的MQTT消息---->{message}");
|
|
messageQueue.Enqueue(message); // 将消息存入队列
|
|
|
|
}
|
|
private async UniTaskVoid ProcessQueue()
|
|
{
|
|
while (true)
|
|
{
|
|
if (messageQueue.TryDequeue(out string message))
|
|
{
|
|
// 处理消息
|
|
Debug.Log($"剩余:{messageQueue.Count}条数据,取数据-----> {message}");
|
|
//await UniTask.Delay(10);
|
|
Allequipment str = JsonConvert.DeserializeObject<Allequipment>(message);
|
|
//Debug.Log("获取到了数据");
|
|
//Debug.Log(str.device + " " + str.message);
|
|
devices.Add(str);
|
|
string data = str.device.Substring(0, 2);
|
|
switch (data)
|
|
{
|
|
case "qc":
|
|
Qcbd qcbd = JsonConvert.DeserializeObject<Qcbd>(str.message);
|
|
qcbdequipments.Add(qcbd);
|
|
|
|
break;
|
|
case "el":
|
|
Elvequipment elvequipment = JsonConvert.DeserializeObject<Elvequipment>(str.message);
|
|
elvequipments.Add(elvequipment);
|
|
|
|
break;
|
|
case "dp":
|
|
Dpmequipment dpmequipment = JsonConvert.DeserializeObject<Dpmequipment>(str.message);
|
|
dpmequipments.Add(dpmequipment);
|
|
|
|
break;
|
|
case "co":
|
|
Convoyorequipment convoyorequipment = JsonConvert.DeserializeObject<Convoyorequipment>(str.message);
|
|
string con = convoyorequipment.Id.Substring(0, 2);
|
|
//Debug.Log(con);
|
|
if (con == "54")
|
|
{
|
|
convoyorequipments.Add(convoyorequipment);
|
|
}
|
|
else
|
|
{
|
|
exportations.Add(convoyorequipment);
|
|
}
|
|
break;
|
|
case "ca":
|
|
Debug.Log(str.message);
|
|
//Carequipment carequipment = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
switch (str.device)
|
|
{
|
|
case "car1":
|
|
Carequipment carequipment = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame = GameObject.Find("car1");
|
|
if (cargame)
|
|
{
|
|
Debug.Log("第一个小车运动");
|
|
Carpoint(cargame, carequipment);
|
|
}
|
|
break;
|
|
case "car2":
|
|
Carequipment carequipment2 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame2 = GameObject.Find("car2");
|
|
if (cargame2)
|
|
{
|
|
Debug.Log("第二个小车运动");
|
|
Carpoint2(cargame2, carequipment2);
|
|
}
|
|
break;
|
|
case "car3":
|
|
Carequipment carequipment3 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame3 = GameObject.Find("car3");
|
|
if (cargame3)
|
|
{
|
|
Debug.Log("第三个小车运动");
|
|
Carpoint3(cargame3, carequipment3);
|
|
}
|
|
break;
|
|
case "car4":
|
|
Carequipment carequipment4 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame4 = GameObject.Find("car4");
|
|
if (cargame4)
|
|
{
|
|
Debug.Log("第四个小车运动");
|
|
Carpoint4(cargame4, carequipment4);
|
|
}
|
|
break;
|
|
case "car5":
|
|
Carequipment carequipment5 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame5 = GameObject.Find("car5");
|
|
if (cargame5)
|
|
{
|
|
Debug.Log("第五个小车运动");
|
|
Carpoint5(cargame5, carequipment5);
|
|
}
|
|
break;
|
|
case "car6":
|
|
Carequipment carequipment6 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame6 = GameObject.Find("car6");
|
|
if (cargame6)
|
|
{
|
|
Debug.Log("第六个小车运动");
|
|
Carpoint6(cargame6, carequipment6);
|
|
}
|
|
break;
|
|
case "car7":
|
|
Carequipment carequipment7 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame7 = GameObject.Find("car7");
|
|
if (cargame7)
|
|
{
|
|
Debug.Log("第七个小车运动");
|
|
Carpoint7(cargame7, carequipment7);
|
|
}
|
|
break;
|
|
case "car8":
|
|
Carequipment carequipment8 = JsonConvert.DeserializeObject<Carequipment>(str.message);
|
|
//string carname = str.device;
|
|
Debug.Log(str.device);
|
|
GameObject cargame8 = GameObject.Find("car8");
|
|
if (cargame8)
|
|
{
|
|
Debug.Log("第八个小车运动");
|
|
Carpoint8(cargame8, carequipment8);
|
|
}
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
//string carname = str.device;
|
|
//Debug.Log(str.device);
|
|
//GameObject cargame = GameObject.Find(carname);
|
|
//if (cargame)
|
|
//{
|
|
// Carpoint(cargame, carequipment);
|
|
//}
|
|
break;
|
|
case "fe":
|
|
Feequipment feequipment = JsonConvert.DeserializeObject<Feequipment>(str.message);
|
|
feequipments.Add(feequipment);
|
|
break;
|
|
case "cm":
|
|
Cmequipment cmequipment = JsonConvert.DeserializeObject<Cmequipment>(str.message);
|
|
cmequipments.Add(cmequipment);
|
|
break;
|
|
default:
|
|
break;
|
|
}
|
|
await UniTask.Delay(10);
|
|
}
|
|
else
|
|
{
|
|
Debug.Log("等待数据");
|
|
await UniTask.Delay(1000);
|
|
}
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第一个小车
|
|
/// </summary>
|
|
int index = 1;
|
|
public void Carpoint(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第二个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index2 = 1;
|
|
public void Carpoint2(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index2 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index2++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index3);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第三个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index3 = 1;
|
|
public void Carpoint3(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index3 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index3++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index3);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第四个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index4 = 1;
|
|
public void Carpoint4(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index4 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index4++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index4);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第五个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index5 = 1;
|
|
public void Carpoint5(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index5 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index5++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index5);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第六个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index6 = 1;
|
|
public void Carpoint6(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index6 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index6++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index6);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第七个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index7 = 1;
|
|
public void Carpoint7(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index7 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index7++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index7);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 第八个小车
|
|
/// </summary>
|
|
/// <param name="car"></param>
|
|
/// <param name="carequipment"></param>
|
|
int index8 = 1;
|
|
public void Carpoint8(GameObject car, Carequipment carequipment)
|
|
{
|
|
Debug.Log(carequipment.id);
|
|
if (car)
|
|
{
|
|
Carinformation carbox = car.GetComponent<Carinformation>();
|
|
carbox.BoxCode = carequipment.CarState_BoxCode;
|
|
string point = carequipment.CarState_Car_Row + "-" + carequipment.CarState_Car_Column + "-" + carequipment.CarState_Car_Layer;
|
|
Debug.Log("打印小车点位" + point);
|
|
if (GameObject.Find(point))
|
|
{
|
|
GameObject displacement = GameObject.Find(point);
|
|
if (displacement != null && index8 < 2)
|
|
{
|
|
car.transform.position = displacement.transform.position;
|
|
index8++;
|
|
}
|
|
else if (displacement != null)
|
|
{
|
|
Debug.Log(index8);
|
|
Designateddisplacement(car, displacement.transform.position, speed);
|
|
Debug.Log("小车位移到指定点位");
|
|
}
|
|
}
|
|
if (carequipment.CarState_CarPlt == "2")
|
|
{
|
|
if (car.gameObject.transform.childCount == 0 && carequipment.CarState_BoxCode != "0")
|
|
{
|
|
if (BoxID)
|
|
{
|
|
GameObject box = Instantiate(BoxID, car.gameObject.transform);
|
|
Boxinformation boxinformation = box.AddComponent<Boxinformation>();
|
|
boxinformation.ID = carequipment.CarState_BoxCode;
|
|
Debug.Log("小车身上没有箱子,克隆出来一个箱子" + carequipment.CarState_BoxCode);
|
|
if (box.gameObject != null)
|
|
{
|
|
// 获取触发器物体的碰撞体
|
|
Collider triggerCollider = car.GetComponent<Collider>();
|
|
|
|
// 确保触发器物体有碰撞体
|
|
if (triggerCollider != null)
|
|
{
|
|
// 计算触发器物体顶部的世界坐标
|
|
Vector3 triggerPosition = triggerCollider.bounds.center;
|
|
Vector3 triggerTop = triggerPosition + Vector3.up * (triggerCollider.bounds.extents.y);
|
|
|
|
// 设置物体的位置
|
|
box.gameObject.transform.localEulerAngles = new Vector3(90, 0, 0);
|
|
box.gameObject.transform.position = triggerTop;
|
|
box.gameObject.transform.SetParent(car.gameObject.transform, false);
|
|
|
|
Debug.Log("箱子位置初始化");
|
|
}
|
|
else
|
|
{
|
|
Debug.LogError("触发器没有碰撞体");
|
|
}
|
|
}
|
|
if (carequipment.CarState_Car_Layer.Equals(1))
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.firstbox.Add(childbox);
|
|
MqttManager.Instance.firstbox.Add(box);
|
|
}
|
|
else
|
|
{
|
|
GameObject childbox = box.transform.GetChild(0).gameObject;
|
|
MqttManager.Instance.secondbox.Add(childbox);
|
|
MqttManager.Instance.secondbox.Add(box);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else if (carequipment.CarState_CarPlt == "1")
|
|
{
|
|
Debug.Log("小车身上没有箱子");
|
|
if (car.gameObject.transform.childCount > 0)
|
|
{
|
|
GameObject box = car.gameObject.transform.GetChild(0).gameObject;
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y + 0.2f, 0.4f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
if (box.GetComponent<Collider>())
|
|
{
|
|
Collider collider = box.GetComponent<Collider>();
|
|
if (collider)
|
|
{
|
|
collider.enabled = false;
|
|
Debug.Log("失活了箱子触发器");
|
|
box.gameObject.transform.SetParent(null);
|
|
Debug.Log("把箱子父物体取消");
|
|
}
|
|
Debug.Log("卸箱动画向上提");
|
|
box.gameObject.transform.DOMoveY(box.gameObject.transform.position.y - 0.62f, 1f).SetEase(Ease.InOutQuad).OnComplete(() =>
|
|
{
|
|
Debug.Log("卸箱动画向下提");
|
|
});
|
|
}
|
|
});
|
|
}
|
|
}
|
|
//else
|
|
//{
|
|
// BoxCollider cars = car.GetComponent<BoxCollider>();
|
|
//}
|
|
//car.transform.DOMove(displacement.transform.position, Vector3.Distance(car.transform.position, displacement.transform.position) / speed).SetEase(Ease.InOutQuad);
|
|
|
|
}
|
|
}
|
|
/// <summary>
|
|
/// 需要位移的地方
|
|
/// </summary>
|
|
/// <param name="car">小车</param>
|
|
/// <param name="dis">位移到指定位置</param>
|
|
/// <param name="speed">位移的速度</param>
|
|
public void Designateddisplacement(GameObject car, Vector3 dis, float speed)
|
|
{
|
|
Debug.Log("小车运动了");
|
|
float times = Vector3.Distance(car.transform.position, dis) / speed;
|
|
car.transform.DOMove(dis, times).SetEase(Ease.InOutQuad);
|
|
}
|
|
} |