public void Error(object message, DebugOption debugOption) { if (CheckDebugOption(debugOption)) { Debug.LogError(debugOption.ToString() + ": " + message); } }
public void Add(string name, bool isEnabled) { var option = new DebugOption { Name = name, IsEnabled = isEnabled }; _options.Add(option); }
public void ActivateOptionByName(string name, bool value) { DebugOption option = GetOptionByName(name); if (option != null) { option.Activate(value); } }
bool CheckDebugOption(DebugOption debugOption) { foreach (DebugOption option in debugOptions) { if (option == debugOption) { return(true); } } return(false); }
public override void OnInspectorGUI() { GUILayoutOption option = GUILayout.Width(300f); DrawDefaultInspector(); DebugOption instance = target as DebugOption; if (GUILayout.Button("UnloadUnusedAssets", option)) { Resources.UnloadUnusedAssets(); } }
public static void InitSettings(DebugOption options) { //app相关参数设置 Application.targetFrameRate = options.fullFrameRate ? -1 : 30; Time.maximumDeltaTime = 0.25f; Screen.sleepTimeout = SleepTimeout.NeverSleep; ScreenConfig.init(); //开发期相关参数设置 showFPSMeter = options.showFPSMeter; readPackedCode = options.readPackedCode; readPackedData = options.readPackedData; readPackedView = options.readPackedView; readAssetBundle = options.readAssetBundle; fullFrameRate = options.fullFrameRate; skipProgramUpdate = options.skipProgramUpdate; skipResouceUpdate = options.skipResouceUpdate; streamingAssetsPath = Application.streamingAssetsPath; externalPath = string.IsNullOrEmpty(options.externalPath) ? Application.persistentDataPath : options.externalPath; }