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 SetSDKSystemHeightEvent; public static void BindSetSDKSystemHeightEvent(Action Fun) { if (Fun != null) { SetSDKSystemHeightEvent += Fun; } } public static void UnBindSetSDKSystemHeightEvent(Action Fun) { if (Fun != null) { SetSDKSystemHeightEvent -= Fun; } } }