修改VR适配bug
This commit is contained in:
parent
642c291a75
commit
d1776762c7
@ -93,11 +93,11 @@ namespace ZXK.LouDiXvMuNiu
|
|||||||
_curTimeLineCtrl = GetComponent<TimelineDirectorCtrl>();
|
_curTimeLineCtrl = GetComponent<TimelineDirectorCtrl>();
|
||||||
|
|
||||||
#if VR
|
#if VR
|
||||||
var zStylus = UIRoot.instance.vrRoot.transform.Find("ZStylus").GetComponent<ZStylus>();
|
var zStylus = UIRoot.Instance.vrRoot.transform.Find("ZStylus").GetComponent<ZStylus>();
|
||||||
zStylus.OnObjectEntered.AddListener(VROnEnter);
|
zStylus.OnObjectEntered.AddListener(VROnEnter);
|
||||||
zStylus.OnObjectExited.AddListener(VROnExit);
|
zStylus.OnObjectExited.AddListener(VROnExit);
|
||||||
zStylus.OnClick.AddListener(VROnClick);
|
zStylus.OnClick.AddListener(VROnClick);
|
||||||
var zMouse = UIRoot.instance.vrRoot.transform.Find("ZMouse").GetComponent<ZMouse>();
|
var zMouse = UIRoot.Instance.vrRoot.transform.Find("ZMouse").GetComponent<ZMouse>();
|
||||||
zMouse.OnObjectEntered.AddListener(VROnEnter);
|
zMouse.OnObjectEntered.AddListener(VROnEnter);
|
||||||
zMouse.OnObjectExited.AddListener(VROnExit);
|
zMouse.OnObjectExited.AddListener(VROnExit);
|
||||||
zMouse.OnClick.AddListener(VROnClick);
|
zMouse.OnClick.AddListener(VROnClick);
|
||||||
@ -1245,7 +1245,7 @@ namespace ZXK.LouDiXvMuNiu
|
|||||||
public void ChangeCameraPos(Vector3 pos, Vector3 rot)
|
public void ChangeCameraPos(Vector3 pos, Vector3 rot)
|
||||||
{
|
{
|
||||||
#if VR
|
#if VR
|
||||||
UIRoot.instance.SetCamera(pos, rot);
|
UIRoot.Instance.SetCamera(pos, rot);
|
||||||
#else
|
#else
|
||||||
///设置人偶物体旋转,位置
|
///设置人偶物体旋转,位置
|
||||||
kinematic.SetPositionAndRotation(pos, Quaternion.Euler(0, rot.y, 0));///设置相机旋转,位置
|
kinematic.SetPositionAndRotation(pos, Quaternion.Euler(0, rot.y, 0));///设置相机旋转,位置
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace CG.UTility
|
|||||||
_loadedCall?.Invoke();
|
_loadedCall?.Invoke();
|
||||||
_isLoadScene = false;
|
_isLoadScene = false;
|
||||||
StopCoroutine("LoadScene");
|
StopCoroutine("LoadScene");
|
||||||
UIRoot.instance.GetEventSystem().SetActive(true);
|
UIRoot.Instance.GetEventSystem().SetActive(true);
|
||||||
Framework.UI_Manage.Instance.ClosePanel("LoadingSceenPanel");
|
Framework.UI_Manage.Instance.ClosePanel("LoadingSceenPanel");
|
||||||
}
|
}
|
||||||
_async.allowSceneActivation = true;
|
_async.allowSceneActivation = true;
|
||||||
@ -62,7 +62,7 @@ namespace CG.UTility
|
|||||||
_isLoadScene = true;
|
_isLoadScene = true;
|
||||||
StartCoroutine("LoadScene", sceneName);
|
StartCoroutine("LoadScene", sceneName);
|
||||||
Framework.UI_Manage.Instance.ShowPanel("LoadingSceenPanel", System.Type.GetType("CG.Framework.LoadingSceenPanel"), Framework.UIGroup.Tip);
|
Framework.UI_Manage.Instance.ShowPanel("LoadingSceenPanel", System.Type.GetType("CG.Framework.LoadingSceenPanel"), Framework.UIGroup.Tip);
|
||||||
UIRoot.instance.GetEventSystem().SetActive(false);
|
UIRoot.Instance.GetEventSystem().SetActive(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private IEnumerator LoadScene(string sceneName)
|
private IEnumerator LoadScene(string sceneName)
|
||||||
|
|||||||
@ -1,25 +1,25 @@
|
|||||||
|
using CG.Framework;
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using ZXK.LouDiXvMuNiu;
|
||||||
|
|
||||||
public class UIRoot : MonoBehaviour
|
public class UIRoot : MonoSingleton<UIRoot>
|
||||||
{
|
{
|
||||||
public GameObject pcCanvas;
|
public GameObject pcCanvas;
|
||||||
public GameObject vrRoot;
|
public GameObject vrRoot;
|
||||||
public static UIRoot instance;
|
|
||||||
Transform vrCamera;
|
Transform vrCamera;
|
||||||
private void Awake()
|
|
||||||
|
protected override void AwakeSelf()
|
||||||
{
|
{
|
||||||
instance = this;
|
base.AwakeSelf();
|
||||||
DontDestroyOnLoad(this);
|
|
||||||
#if VR
|
#if VR
|
||||||
DontDestroyOnLoad(vrRoot);
|
|
||||||
vrRoot.gameObject.SetActive(true);
|
vrRoot.gameObject.SetActive(true);
|
||||||
vrCamera = vrRoot.transform.Find("ZFrame");
|
vrCamera = vrRoot.transform.Find("ZFrame");
|
||||||
#else
|
#else
|
||||||
pcCanvas.gameObject.SetActive(true);
|
pcCanvas.gameObject.SetActive(true);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameObject GetEventSystem()
|
public GameObject GetEventSystem()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user