VR兼容性代码
This commit is contained in:
parent
a43d36b9a0
commit
bbcf0f96d9
@ -18,4 +18,10 @@ struct EndScreenShot
|
|||||||
struct OnLock
|
struct OnLock
|
||||||
{
|
{
|
||||||
public bool isLock;
|
public bool isLock;
|
||||||
|
}
|
||||||
|
|
||||||
|
struct OnUpdatePos
|
||||||
|
{
|
||||||
|
public Vector3 pos;
|
||||||
|
public Vector3 rot;
|
||||||
}
|
}
|
||||||
@ -53,6 +53,12 @@ public class Show3DCamera : MonoBehaviour
|
|||||||
TypeEventSystem.Global.Register<OnLock>(OnLockEvent).UnRegisterWhenDisabled(this);
|
TypeEventSystem.Global.Register<OnLock>(OnLockEvent).UnRegisterWhenDisabled(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnEnable()
|
||||||
|
{
|
||||||
|
#if Turing
|
||||||
|
gameObject.SetActive(false);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
private void OnLockEvent(OnLock islock)
|
private void OnLockEvent(OnLock islock)
|
||||||
{
|
{
|
||||||
this.lockMove = islock.isLock;
|
this.lockMove = islock.isLock;
|
||||||
@ -441,6 +447,9 @@ public class Show3DCamera : MonoBehaviour
|
|||||||
// 相机始终朝向目标点
|
// 相机始终朝向目标点
|
||||||
transform.LookAt(targetPos);
|
transform.LookAt(targetPos);
|
||||||
}
|
}
|
||||||
|
#if Turing
|
||||||
|
TypeEventSystem.Global.Send<OnUpdatePos>(new OnUpdatePos() { pos = gameObject.Position(), rot = gameObject.LocalEulerAngles() });
|
||||||
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user