/// <summary> /// 切换质量回调 /// </summary> /// <param name="_obj"></param> private void EventPerformanceSwith(object _obj) { devicePerformance = (HKCommonDefine.DevicePerformance)(int) _obj; if (null != sceneRootNode) { sceneRootNode.SwithPerfromance(devicePerformance); } }
/// <summary> /// 构造函数 /// </summary> /// <param name="_sceneName"></param> /// <param name="_serializedInfo"></param> public SceneStaticItemLoader(string _sceneName, SceneSerializedInfo _serializedInfo) { sceneName = _sceneName; serializedInfoConfig = _serializedInfo; devicePerformance = (HKCommonDefine.DevicePerformance)ConfigSystemFacade.Instance.Get(HKCommonDefine.KEY_PERFORMANCE_LEVEL, (int)HKCommonDefine.DevicePerformance.MIDDLE); #if UNITY_EDITOR // editor下默认最高品质 devicePerformance = HKCommonDefine.DevicePerformance.HIGHT; #endif // 创建父节点 sceneRootNode = new SceneRootNode(_sceneName); // 切换质量设置 AppEvent.OnEvent(HKCommonDefine.EVENT_PERFORMANCE_SWITH, EventPerformanceSwith); }
public void SwithPerfromance(HKCommonDefine.DevicePerformance _devicePerformance) { switch (_devicePerformance) { case HKCommonDefine.DevicePerformance.HIGHT: staticItemNode.gameObject.SetActive(true); transparentNode.gameObject.SetActive(true); fxNode.gameObject.SetActive(true); break; case HKCommonDefine.DevicePerformance.MIDDLE: staticItemNode.gameObject.SetActive(true); transparentNode.gameObject.SetActive(true); fxNode.gameObject.SetActive(false); break; case HKCommonDefine.DevicePerformance.LOW: staticItemNode.gameObject.SetActive(true); transparentNode.gameObject.SetActive(false); fxNode.gameObject.SetActive(false); break; } }