using UnityEngine; using Blue; using GHZLangChao; public class ShowDeviceControle : SingletonMonobehaviour,IController { public void Awake() { this.RegisterEvent(e=> { if(DeviceDetailsControl==null) { GameObject go = Instantiate(InstantiateSystem.Instance.BlueObject.ShowDeviceControle, GameStart.Instance.transform.parent); DeviceDetailsControl = go.GetComponent(); } DeviceDetailsControl.gameObject.SetActive(true); // 更新数据 DeviceDetailsControl.UpdateData(e.DeviceParameter,e.item); // 更新位置 DeviceDetailsControl.transform.position = new Vector3( e.currentPos.transform.position.x, 0.95f, e.currentPos.transform.position.z); // 更新位置 DeviceDetailsControl.transform.eulerAngles = new Vector3( 0, e.currentPos.transform.eulerAngles.y, 0); }).UnRegisterWhenGameObjectDestroyed(gameObject); } public DeviceDetailsControl DeviceDetailsControl = null; }