VR兼容性处理
This commit is contained in:
parent
cd482fde08
commit
0199ff16fb
@ -84,10 +84,10 @@ RectTransform:
|
||||
m_Children: []
|
||||
m_Father: {fileID: 7903088767531138588}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 35.93, y: -16.205}
|
||||
m_SizeDelta: {x: 41.86, y: 22.41}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4957094274820776498
|
||||
CanvasRenderer:
|
||||
@ -240,7 +240,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 44.3}
|
||||
m_SizeDelta: {x: 71.86, y: 32.41}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5000002, y: 0.4999999}
|
||||
--- !u!222 &1036003715876543771
|
||||
CanvasRenderer:
|
||||
@ -336,7 +336,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3498217952045278011
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -352,9 +352,9 @@ RectTransform:
|
||||
- {fileID: 7903088767531138588}
|
||||
m_Father: {fileID: 5742674533081898516}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 2.22}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -180}
|
||||
m_SizeDelta: {x: 5, y: 5}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &3053206168475133008
|
||||
|
||||
@ -257,6 +257,53 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
FlipDuration: 0.1
|
||||
SnapDuration: 0.05
|
||||
--- !u!1 &1390393074831861131
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6892530253346669644}
|
||||
- component: {fileID: 288270640094573032}
|
||||
m_Layer: 0
|
||||
m_Name: ZProvider
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6892530253346669644
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1390393074831861131}
|
||||
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 &288270640094573032
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 1390393074831861131}
|
||||
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 &2151028106637981052
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -436,6 +483,7 @@ Transform:
|
||||
- {fileID: 2220253086530989832}
|
||||
- {fileID: 8195748885121142673}
|
||||
- {fileID: 2551710545134193972}
|
||||
- {fileID: 6892530253346669644}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &960705820696497904
|
||||
@ -1586,7 +1634,7 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
EventCamera: {fileID: 263436429275714491}
|
||||
Visualization: {fileID: 6603607056250446267}
|
||||
MaxHitDistance: 1.5
|
||||
MaxHitDistance: 5
|
||||
MaxHitRadius: 0
|
||||
IgnoreMask:
|
||||
serializedVersion: 2
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
using GCSeries.Core.Input;
|
||||
using HighlightPlus;
|
||||
using QFramework;
|
||||
using QFramework.Example;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Unity.Burst.CompilerServices;
|
||||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
using XMLTool;
|
||||
@ -25,6 +27,37 @@ public class DeviceController : MonoSingleton<DeviceController>
|
||||
TypeEventSystem.Global.Register<OnModuleStart>(OnStart).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
TypeEventSystem.Global.Register<OnModuleQuit>(OnQuit).UnRegisterWhenGameObjectDestroyed(gameObject);
|
||||
|
||||
#if VR
|
||||
UIRoot.Instance.transform.Find("ZStylus").GetComponent<ZPointer>()?.OnObjectEntered.AddListener(OnObjEnter);
|
||||
UIRoot.Instance.transform.Find("ZMouse").GetComponent<ZPointer>()?.OnObjectEntered.AddListener(OnObjEnter);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
private void OnObjEnter(ZPointer arg0, GameObject arg1)
|
||||
{
|
||||
var deviceItem = arg1.GetComponent<DeviceItem>();
|
||||
var uitip = UIKit.GetPanel<UIDeviceTip>();
|
||||
if (deviceItem != null && deviceItem.tipItem != null)
|
||||
{
|
||||
if (uitip != null)
|
||||
{
|
||||
UIKit.OpenPanelAsync<UIDeviceTip>(UILevel.PopUI).ToAction().Start(this, () =>
|
||||
{
|
||||
});
|
||||
}
|
||||
if (uitip != null)
|
||||
{
|
||||
uitip.Set(deviceItem.tipItem.label);
|
||||
uitip.Active(true);
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
uitip?.Active(false);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnQuit(OnModuleQuit quit)
|
||||
@ -69,6 +102,7 @@ public class DeviceController : MonoSingleton<DeviceController>
|
||||
|
||||
private void Update()
|
||||
{
|
||||
#if !VR
|
||||
var uitip = UIKit.GetPanel<UIDeviceTip>();
|
||||
if (uitip != null)
|
||||
{
|
||||
@ -90,7 +124,7 @@ public class DeviceController : MonoSingleton<DeviceController>
|
||||
}
|
||||
}
|
||||
uitip?.Active(false);
|
||||
|
||||
#endif
|
||||
}
|
||||
public DeviceItem GetDeviceItem(string name)
|
||||
{
|
||||
|
||||
@ -22,7 +22,8 @@ namespace QFramework.Example
|
||||
{
|
||||
}
|
||||
|
||||
void Update()
|
||||
#if !VR
|
||||
public void Update()
|
||||
{
|
||||
if (Point.gameObject.activeSelf)
|
||||
{
|
||||
@ -30,6 +31,7 @@ namespace QFramework.Example
|
||||
}
|
||||
|
||||
}
|
||||
#endif
|
||||
|
||||
public void Set(string txt)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user