using DG.Tweening; using System.Collections; using System.Collections.Generic; using UnityEngine; /// /// 卡车移动至称重 /// public class CarMoverToWeigh : MonoBehaviour { public static CarMoverToWeigh Instance; public Transform Point; /// /// 是否已卸货 /// public bool IsUnload = false; /// /// 车上生成的模型预制体 /// public GameObject CloneModel; /// /// 模型生成在车辆的位置 /// public Transform CarClonePoint; private void Awake() { Instance = this; } void Start() { //CloneModel = Instantiate(ModerController.Instance.prefabModel, transform); //for (int i = 0; i < CloneModel.transform.childCount; i++) //{ // CloneModel.transform.GetChild(i).gameObject.SetActive(false); //} //CloneModel.transform.position = CarClonePoint.transform.position; } /// /// 汽车移动 /// public void CarMove() { StartCoroutine(WaitCarMove()); } // Update is called once per frame void Update() { } IEnumerator WaitCarMove() { if (IsUnload) { DocumentManagement.Instance.IsShowTrue("磅单-卸货后"); WeighBridgeCheck.instance.weightext.text = "16100KG"; UI_Tips.instance.ShowPanel("称重完成!", true); } else { DocumentManagement.Instance.IsShowTrue("磅单-卸货前"); transform.DOLocalMove(Point.position, 3f); yield return new WaitForSeconds(3.1f); WeighBridgeCheck.instance.weightext.text = "40100KG"; UI_Tips.instance.ShowPanel("称重完成!", true); } } }