using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class API_Module_SafetyArea { /// /// 进入安全区域时的回调注册 /// /// public static void RegistSafetyAreaEnterCallback(Action callback) { SafetyAreaManager.Instance.OnEnterSafetyArea += callback; } /// /// 进入安全区域时的回调注销 /// /// public static void UnRegistSafetyAreaEnterCallback(Action callback) { SafetyAreaManager.Instance.OnEnterSafetyArea -= callback; } /// /// 退出安全区域时的回调注册 /// /// public static void RegistSafetyAreaExitCallback(Action callback) { SafetyAreaManager.Instance.OnExitSafetyArea += callback; } /// /// 退出安全区域时的回调注销 /// /// public static void UnRegistSafetyAreaExitCallback(Action callback) { SafetyAreaManager.Instance.OnExitSafetyArea += callback; } /// /// 开始设置安全区域时的回调注册 /// /// public static void RegistSafetyAreaStartCallback(Action callback) { SafetyAreaManager.Instance.OnBeginSetSafeArea += callback; } /// /// 开始设置安全区域时的回调注销 /// /// public static void UnRegistSafetyAreaStartCallback(Action callback) { SafetyAreaManager.Instance.OnBeginSetSafeArea -= callback; } /// /// 完成设置安全区域时的回调注册 /// /// public static void RegistSafetyAreaFinishCallback(Action callback) { SafetyAreaManager.Instance.OnFinishSetSafeArea += callback; } /// /// 完成设置安全区域时的回调注销 /// /// public static void UnRegistSafetyAreaFinishCallback(Action callback) { SafetyAreaManager.Instance.OnFinishSetSafeArea += callback; } /// /// 开始设置安全区域 /// public static void StartSetSafetyArea() { SafetyAreaManager.Instance.StartSetSafetyArea(); } /// /// 重新设置区域高度(如果没有安全区域则会重新设置) /// public static void StartSetSafetyAreaHeight() { SafetyAreaManager.Instance.StartSetSafetyAreaHeight(); } /// /// 获取安全区域颜色 /// /// public static int GetSafetyAreaColor() { return SafetyAreaManager.Instance.OriginSafetyAreaColorIndex; } /// /// 设置安全区域颜色 /// /// public static void SetSafetyAreaColor(int index) { SafetyAreaManager.Instance.OriginSafetyAreaColorIndex = index; } /// /// 获取低头是否显示安全区域 /// /// public static bool GetShowAreaWhenBowHead() { return SafetyAreaManager.Instance.ShowAreaWhenBowHead; } /// /// 低头时是否显示游戏区域轮廓 /// /// public static void SetShowAreaWhenBowHead(bool isOpen) { SafetyAreaManager.Instance.ShowAreaWhenBowHead = isOpen; } /// /// 获取灵敏度 /// /// public static float GetSensitivity() { return SafetyAreaManager.Instance.OriginAlphaParam; } /// /// 设置安全区域灵敏度 范围0~1 /// /// public static void SetSensitivity(float value) { SafetyAreaManager.Instance.OriginAlphaParam = value; } /// /// 删除已有的原地区域 /// public static void DestroySafetyArea() { SafetyAreaManager.Instance.DestroySafetyArea(); } /// /// 禁用安全区域显示 /// /// public static void DisableSafetyAreaDisplay(bool isDisable) { SafetyAreaManager.Instance.IsDisableSafetyArea = isDisable; } /// /// 查看是否可以双击查看SeeThroguh /// /// public static bool CheckDoubleTapSeeThrough() { return SafetyAreaManager.Instance.DoubleClickShowSeeThrough; } /// /// 设置双击查看SeeThrough /// /// public static void SetDouleTapSeeThrough(bool isOn) { SafetyAreaManager.Instance.DoubleClickShowSeeThrough = isOn; } /// /// 获取安全区域类型 /// /// public static SafetyAreaTypeEnum GetSafetyAreaType() { return SafetyAreaManager.Instance.GetSafetyAreaType(); } /// /// 设置过程中强制关闭 /// public static void CancelSafetyArea() { SafetyAreaManager.Instance.UserCancelStep(); } }