using Blue; using UnityEngine; public class GetScenePosRot : AbstractController { public Transform meshTest=>(SceneIOCContainer.Instance.Pull("mesh_test")as GameObject).transform; public Transform meshTestParent=>(SceneIOCContainer.Instance.Pull("ARSpaceForAll")as GameObject).transform; private void Awake() { this.RegisterEvent(GetScenePosRotSuccess).UnRegisterWhenGameObjectDestroyed(gameObject); } private void GetScenePosRotSuccess(GetScenePosRotEvent e) { Vector3 pos = new Vector3(e.PosRot[0].x, e.PosRot[0].y, e.PosRot[0].z); Vector3 rot = new Vector3(e.PosRot[1].x, e.PosRot[1].y, e.PosRot[1].z); SetPosRot(pos,rot); } private void SetPosRot(Vector3 pos,Vector3 rot) { meshTest.transform.parent = meshTestParent; meshTest.transform.localPosition = pos; meshTest.transform.localEulerAngles = rot; } }