Exemple #1
0
 public void Error(object message, DebugOption debugOption)
 {
     if (CheckDebugOption(debugOption))
     {
         Debug.LogError(debugOption.ToString() + ": " + message);
     }
 }
Exemple #2
0
            public void Add(string name, bool isEnabled)
            {
                var option = new DebugOption {
                    Name = name, IsEnabled = isEnabled
                };

                _options.Add(option);
            }
Exemple #3
0
    public void ActivateOptionByName(string name, bool value)
    {
        DebugOption option = GetOptionByName(name);

        if (option != null)
        {
            option.Activate(value);
        }
    }
Exemple #4
0
    bool CheckDebugOption(DebugOption debugOption)
    {
        foreach (DebugOption option in debugOptions)
        {
            if (option == debugOption)
            {
                return(true);
            }
        }

        return(false);
    }
Exemple #5
0
        public override void OnInspectorGUI()
        {
            GUILayoutOption option = GUILayout.Width(300f);

            DrawDefaultInspector();
            DebugOption instance = target as DebugOption;

            if (GUILayout.Button("UnloadUnusedAssets", option))
            {
                Resources.UnloadUnusedAssets();
            }
        }
Exemple #6
0
    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;
    }