针对vr一体机进行修改逻辑
This commit is contained in:
parent
26e73c995e
commit
76462dadbd
@ -123,7 +123,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 598348144801550191}
|
m_GameObject: {fileID: 598348144801550191}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 2.1975, z: -2.25}
|
m_LocalPosition: {x: 0, y: 2.1975, z: 0}
|
||||||
m_LocalScale: {x: 15, y: 15, z: 15}
|
m_LocalScale: {x: 15, y: 15, z: 15}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
@ -172,7 +172,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 765259898297824089}
|
m_GameObject: {fileID: 765259898297824089}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -2.25}
|
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 15, y: 15, z: 15}
|
m_LocalScale: {x: 15, y: 15, z: 15}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
@ -428,7 +428,6 @@ Transform:
|
|||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 4206005111461178323}
|
|
||||||
- {fileID: 1943472158707926008}
|
- {fileID: 1943472158707926008}
|
||||||
- {fileID: 4955625632054724442}
|
- {fileID: 4955625632054724442}
|
||||||
- {fileID: 2220253086530989832}
|
- {fileID: 2220253086530989832}
|
||||||
@ -570,7 +569,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 3400309332038407868}
|
m_GameObject: {fileID: 3400309332038407868}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645}
|
m_LocalPosition: {x: 0.030000001, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
@ -1064,7 +1063,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 4951725383111470759}
|
m_GameObject: {fileID: 4951725383111470759}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645}
|
m_LocalPosition: {x: -0.030000001, y: 0, z: 0}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children: []
|
m_Children: []
|
||||||
@ -1165,53 +1164,6 @@ MonoBehaviour:
|
|||||||
mipBias: 0
|
mipBias: 0
|
||||||
varianceClampScale: 0.9
|
varianceClampScale: 0.9
|
||||||
contrastAdaptiveSharpening: 0
|
contrastAdaptiveSharpening: 0
|
||||||
--- !u!1 &5295768088636320424
|
|
||||||
GameObject:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
serializedVersion: 6
|
|
||||||
m_Component:
|
|
||||||
- component: {fileID: 4206005111461178323}
|
|
||||||
- component: {fileID: 7751590708231362653}
|
|
||||||
m_Layer: 0
|
|
||||||
m_Name: ZProvider
|
|
||||||
m_TagString: Untagged
|
|
||||||
m_Icon: {fileID: 0}
|
|
||||||
m_NavMeshLayer: 0
|
|
||||||
m_StaticEditorFlags: 0
|
|
||||||
m_IsActive: 1
|
|
||||||
--- !u!4 &4206005111461178323
|
|
||||||
Transform:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 5295768088636320424}
|
|
||||||
serializedVersion: 2
|
|
||||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
|
||||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
|
||||||
m_ConstrainProportionsScale: 0
|
|
||||||
m_Children: []
|
|
||||||
m_Father: {fileID: 6541928711621635503}
|
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
|
||||||
--- !u!114 &7751590708231362653
|
|
||||||
MonoBehaviour:
|
|
||||||
m_ObjectHideFlags: 0
|
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
|
||||||
m_PrefabInstance: {fileID: 0}
|
|
||||||
m_PrefabAsset: {fileID: 0}
|
|
||||||
m_GameObject: {fileID: 5295768088636320424}
|
|
||||||
m_Enabled: 1
|
|
||||||
m_EditorHideFlags: 0
|
|
||||||
m_Script: {fileID: 11500000, guid: ae9977e6c48cd7040b272527034d9de1, type: 3}
|
|
||||||
m_Name:
|
|
||||||
m_EditorClassIdentifier:
|
|
||||||
_displayReferenceProfile: 2
|
|
||||||
_displayReferenceSize: {x: 0.521, y: 0.293}
|
|
||||||
_displayReferenceResolution: {x: 1920, y: 1080}
|
|
||||||
--- !u!1 &5647687646066518589
|
--- !u!1 &5647687646066518589
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
@ -1440,6 +1392,8 @@ GameObject:
|
|||||||
- component: {fileID: 6835854032803285639}
|
- component: {fileID: 6835854032803285639}
|
||||||
- component: {fileID: 263436429275714491}
|
- component: {fileID: 263436429275714491}
|
||||||
- component: {fileID: 6027451431851870885}
|
- component: {fileID: 6027451431851870885}
|
||||||
|
- component: {fileID: 5140476435316401990}
|
||||||
|
- component: {fileID: 1546245213169538227}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: ZCamera
|
m_Name: ZCamera
|
||||||
m_TagString: MainCamera
|
m_TagString: MainCamera
|
||||||
@ -1456,7 +1410,7 @@ Transform:
|
|||||||
m_GameObject: {fileID: 8487585372649695129}
|
m_GameObject: {fileID: 8487585372649695129}
|
||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||||
m_LocalPosition: {x: 0, y: 0, z: -0.59773743}
|
m_LocalPosition: {x: 0, y: 0, z: -0.41000003}
|
||||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
@ -1584,6 +1538,30 @@ MonoBehaviour:
|
|||||||
mipBias: 0
|
mipBias: 0
|
||||||
varianceClampScale: 0.9
|
varianceClampScale: 0.9
|
||||||
contrastAdaptiveSharpening: 0
|
contrastAdaptiveSharpening: 0
|
||||||
|
--- !u!114 &5140476435316401990
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8487585372649695129}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
--- !u!114 &1546245213169538227
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 8487585372649695129}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 0}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
--- !u!1 &8683029409827073046
|
--- !u!1 &8683029409827073046
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|||||||
@ -11,124 +11,132 @@
|
|||||||
|
|
||||||
namespace QFramework
|
namespace QFramework
|
||||||
{
|
{
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 每个 UIPanel 对应的Data
|
/// 每个 UIPanel 对应的Data
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public interface IUIData
|
public interface IUIData
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UIPanelData : IUIData
|
public class UIPanelData : IUIData
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract partial class UIPanel : QMonoBehaviour, IPanel
|
|
||||||
{
|
|
||||||
public Transform Transform => transform;
|
|
||||||
|
|
||||||
IPanelLoader IPanel.Loader { get; set; }
|
public abstract partial class UIPanel : QMonoBehaviour, IPanel
|
||||||
|
{
|
||||||
|
public Transform Transform => transform;
|
||||||
|
|
||||||
public PanelInfo Info { get; set; }
|
IPanelLoader IPanel.Loader { get; set; }
|
||||||
|
|
||||||
public PanelState State { get; set; }
|
public PanelInfo Info { get; set; }
|
||||||
|
|
||||||
protected IUIData mUIData;
|
public PanelState State { get; set; }
|
||||||
|
|
||||||
public override IManager Manager => UIManager.Instance;
|
protected IUIData mUIData;
|
||||||
|
|
||||||
protected override void OnBeforeDestroy()
|
public override IManager Manager => UIManager.Instance;
|
||||||
{
|
|
||||||
ClearUIComponents();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected virtual void ClearUIComponents()
|
protected override void OnBeforeDestroy()
|
||||||
{
|
{
|
||||||
}
|
ClearUIComponents();
|
||||||
|
}
|
||||||
|
|
||||||
public void Init(IUIData uiData = null)
|
protected virtual void ClearUIComponents()
|
||||||
{
|
{
|
||||||
mUIData = uiData;
|
}
|
||||||
OnInit(uiData);
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Open(IUIData uiData = null)
|
public void Init(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
State = PanelState.Opening;
|
mUIData = uiData;
|
||||||
OnOpen(uiData);
|
OnInit(uiData);
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Hide()
|
public void Open(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
State = PanelState.Hide;
|
State = PanelState.Opening;
|
||||||
base.Hide();
|
OnOpen(uiData);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public override void Hide()
|
||||||
|
{
|
||||||
|
State = PanelState.Hide;
|
||||||
|
base.Hide();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected virtual void OnInit(IUIData uiData = null)
|
protected virtual void OnInit(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected virtual void OnOpen(IUIData uiData = null)
|
protected virtual void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// avoid override in child class
|
/// avoid override in child class
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected sealed override void OnDestroy()
|
protected sealed override void OnDestroy()
|
||||||
{
|
{
|
||||||
base.OnDestroy();
|
base.OnDestroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 关闭,不允许子类调用
|
/// 关闭,不允许子类调用
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void IPanel.Close(bool destroyed)
|
void IPanel.Close(bool destroyed)
|
||||||
{
|
{
|
||||||
Info.UIData = mUIData;
|
Info.UIData = mUIData;
|
||||||
mOnClosed?.Invoke();
|
mOnClosed?.Invoke();
|
||||||
mOnClosed = null;
|
mOnClosed = null;
|
||||||
Hide();
|
Hide();
|
||||||
State = PanelState.Closed;
|
State = PanelState.Closed;
|
||||||
OnClose();
|
OnClose();
|
||||||
|
|
||||||
if (destroyed)
|
if (destroyed)
|
||||||
{
|
{
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
var panelInterface = this as IPanel;
|
var panelInterface = this as IPanel;
|
||||||
panelInterface.Loader.Unload();
|
panelInterface.Loader.Unload();
|
||||||
UIKit.Config.PanelLoaderPool.RecycleLoader(panelInterface.Loader);
|
UIKit.Config.PanelLoaderPool.RecycleLoader(panelInterface.Loader);
|
||||||
panelInterface.Loader = null;
|
panelInterface.Loader = null;
|
||||||
|
|
||||||
mUIData = null;
|
mUIData = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void CloseSelf()
|
protected void CloseSelf()
|
||||||
{
|
{
|
||||||
UIKit.ClosePanel(this);
|
UIKit.ClosePanel(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void Back()
|
protected void Back()
|
||||||
{
|
{
|
||||||
UIKit.Back(name);
|
UIKit.Back(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 必须使用这个
|
/// 必须使用这个
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected abstract void OnClose();
|
protected abstract void OnClose();
|
||||||
|
|
||||||
private System.Action mOnClosed;
|
private System.Action mOnClosed;
|
||||||
|
|
||||||
public void OnClosed(System.Action onPanelClosed)
|
public void OnClosed(System.Action onPanelClosed)
|
||||||
{
|
{
|
||||||
mOnClosed = onPanelClosed;
|
mOnClosed = onPanelClosed;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
#if VR
|
||||||
|
private void Update()
|
||||||
|
{
|
||||||
|
transform.localEulerAngles = Vector3.zero;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -5,7 +5,6 @@ using QFramework;
|
|||||||
using System;
|
using System;
|
||||||
using QFramework.Example;
|
using QFramework.Example;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using TreeEditor;
|
|
||||||
public class TextWindowAction : IAction
|
public class TextWindowAction : IAction
|
||||||
{
|
{
|
||||||
public ulong ActionID { get; set; }
|
public ulong ActionID { get; set; }
|
||||||
|
|||||||
@ -27,27 +27,27 @@ public class FreeCameraController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
instance = this;
|
instance = this;
|
||||||
DontDestroyOnLoad(this);
|
DontDestroyOnLoad(this);
|
||||||
|
|
||||||
// Cm = GameObject.Find("Mcam");
|
// Cm = GameObject.Find("Mcam");
|
||||||
ctrlor = GetComponent<CharacterController>();
|
ctrlor = GetComponent<CharacterController>();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Global.appSetting.MouseMoveSpeed.RegisterWithInitValue(v => rotateSpeed = v);
|
Global.appSetting.MouseMoveSpeed.RegisterWithInitValue(v => rotateSpeed = v);
|
||||||
}
|
}
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 添加相机QE上下移动功能
|
/// 添加相机QE上下移动功能
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
Vector3 GetInputTranslationDirection()
|
Vector3 GetInputTranslationDirection()
|
||||||
{
|
{
|
||||||
Vector3 direction = new Vector3();
|
Vector3 direction = new Vector3();
|
||||||
|
|
||||||
if ( Input.GetKey(KeyCode.Q))
|
if (Input.GetKey(KeyCode.Q))
|
||||||
{
|
{
|
||||||
direction += Vector3.up;
|
direction += Vector3.up;
|
||||||
}
|
}
|
||||||
if ( Input.GetKey(KeyCode.E))
|
if (Input.GetKey(KeyCode.E))
|
||||||
{
|
{
|
||||||
direction += Vector3.down;
|
direction += Vector3.down;
|
||||||
}
|
}
|
||||||
@ -58,14 +58,15 @@ public class FreeCameraController : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (isMov)
|
if (isMov)
|
||||||
{
|
{
|
||||||
//// 相机移动
|
#if VR
|
||||||
//float horizontal = Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime;
|
// 相机移动
|
||||||
//float vertical = Input.GetAxis("Vertical") * moveSpeed * Time.deltaTime;
|
float horizontal = Input.GetAxis("Horizontal") * moveSpeed * Time.deltaTime;
|
||||||
|
float vertical = Input.GetAxis("Vertical") * moveSpeed * Time.deltaTime;
|
||||||
|
|
||||||
//Vector3 move = transform.right * horizontal + transform.forward * vertical;
|
Vector3 move = transform.right * horizontal + transform.forward * vertical;
|
||||||
|
|
||||||
//transform.position += move;
|
|
||||||
|
|
||||||
|
transform.position += move;
|
||||||
|
#else
|
||||||
|
|
||||||
//W键前进
|
//W键前进
|
||||||
if (Input.GetKey(KeyCode.W))
|
if (Input.GetKey(KeyCode.W))
|
||||||
@ -107,7 +108,7 @@ public class FreeCameraController : MonoBehaviour
|
|||||||
}
|
}
|
||||||
////添加相机QE上下移动功能
|
////添加相机QE上下移动功能
|
||||||
//transform.position+= GetInputTranslationDirection()*0.01f;
|
//transform.position+= GetInputTranslationDirection()*0.01f;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
if (isRot)
|
if (isRot)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -47,15 +47,30 @@ namespace QFramework.Example
|
|||||||
|
|
||||||
public void SetNear()
|
public void SetNear()
|
||||||
{
|
{
|
||||||
Camera.main.transform.DOMove(mData.nearPos, mData.nearTime);
|
Transform trans = null;
|
||||||
Camera.main.transform.DORotate(mData.nearRot, mData.nearTime);
|
#if VR
|
||||||
|
trans = UIRoot.Instance.transform.Find("ZFrame");
|
||||||
|
#else
|
||||||
|
trans = Camera.main.transform;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
trans.DOMove(mData.nearPos, mData.nearTime);
|
||||||
|
trans.DORotate(mData.nearRot, mData.nearTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetNormal()
|
public void SetNormal()
|
||||||
{
|
{
|
||||||
|
|
||||||
Camera.main.transform.DOMove(mData.normalPos, mData.normalTime);
|
Transform trans = null;
|
||||||
Camera.main.transform.DORotate(mData.normalRot, mData.normalTime);
|
#if VR
|
||||||
|
trans = UIRoot.Instance.transform.Find("ZFrame");
|
||||||
|
#else
|
||||||
|
trans = Camera.main.transform;
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
trans.DOMove(mData.normalPos, mData.normalTime);
|
||||||
|
trans.DORotate(mData.normalRot, mData.normalTime);
|
||||||
}
|
}
|
||||||
protected override void OnOpen(IUIData uiData = null)
|
protected override void OnOpen(IUIData uiData = null)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user