1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162 |
- using SC.XR.Unity.Module_InputSystem;
- using System.Collections;
- using System.Collections.Generic;
- using TMPro;
- using UnityEngine;
- public class ShowInfoTipManager : MonoSingleton<ShowInfoTipManager>
- {
- public GameObject go;
- public TextMeshProUGUI text;
- public void showTip(string msg,bool isHead=true)
- {
- if(!isHead)
- {
- if (WindowsManager.Instance.tipInfoGameObject != null && GSXR_Transform.position != null)
- {
- WindowsManager.Instance.tipInfoGameObject.transform.parent = GSXR_Transform;
- WindowsManager.Instance.tipInfoGameObject.transform.position = GSXR_Transform.position;
- WindowsManager.Instance.tipInfoGameObject.transform.LookAt(OpenXRCamera.Instance.head);
- }
- }
- else
- {
- if (WindowsManager.Instance.tipInfoGameObject != null && GSXR_Transform.position != null)
- {
- WindowsManager.Instance.tipInfoGameObject.transform.parent = OpenXRCamera.Instance.head;
- WindowsManager.Instance.tipInfoGameObject.transform.localPosition = new Vector3(0, 0, 1.5f);
- WindowsManager.Instance.tipInfoGameObject.transform.localEulerAngles = new Vector3(0,180,0);
-
- }
- }
- go.gameObject.SetActive(true);
- text.text = msg;
- }
-
-
-
-
- public static Transform GSXR_Transform
- {
- get
- {
- if (!Module_InputSystem.instance.GetInputDeviceStatus(InputDeviceType.KS))
- {
- return API_GSXR_Module_InputSystem_Head.GSXR_Get_HeadCursor.transform;
- }
- else
- {
- return API_GSXR_Module_InputSystem_KS.GSXR_Get_KSCursor(API_GSXR_Module_InputSystem_KS.GCType.Right).transform;
- }
- return null;
- }
- }
- public void closeTip()
- {
- go.gameObject.SetActive(false);
- }
- }
|