1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
-
- using SC.XR.Unity.Module_SDKVersion;
- using SC.XR.Unity.Module_Device;
- using System;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using SC.XR.Unity.Module_SDKSystem;
- public class API_Module_SDKSystem {
- public static Module_SDKSystem Instance {
- get {
- return Module_SDKSystem.Instance;
- }
- }
- public static bool SetSDKSystemHeight(float height,float Min=0,float Max=2.5f) {
- if (Instance) {
- Vector3 tran = Instance.transform.localPosition;
- tran.y = Mathf.Clamp(height, -10000, 10000);//Mathf.Clamp(height, Min, Max);
- Instance.transform.localPosition = tran;
- if (SetSDKSystemHeightEvent!=null) {
- SetSDKSystemHeightEvent(tran.y);
- }
- return true;
- }
- return false;
- }
- public static float GetSDKSystemHeight()
- {
- if (Instance)
- {
- Vector3 tran = Instance.transform.localPosition;
- return tran.y;
- }
- return 0f;
- }
-
- static Action<float> SetSDKSystemHeightEvent;
- public static void BindSetSDKSystemHeightEvent(Action<float> Fun) {
- if (Fun != null) {
- SetSDKSystemHeightEvent += Fun;
- }
- }
- public static void UnBindSetSDKSystemHeightEvent(Action<float> Fun) {
- if (Fun != null) {
- SetSDKSystemHeightEvent -= Fun;
- }
- }
- }
|