1234567891011121314151617181920212223242526272829303132 |
- using UnityEngine;
- using Blue;
- using GHZLangChao;
- public class ShowDeviceControle : SingletonMonobehaviour<ShowDeviceControle>,IController
- {
- public void Awake()
- {
- this.RegisterEvent<DeviceDetailsUpdataDataEvent>(e=>
- {
- if(DeviceDetailsControl==null)
- {
- GameObject go = Instantiate(InstantiateSystem.Instance.BlueObject.ShowDeviceControle, GameStart.Instance.transform.parent);
- DeviceDetailsControl = go.GetComponent<DeviceDetailsControl>();
- }
- 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;
- }
|