Exemple #1
0
    /** Update the game's graphical mode */
    private void updateGraphics()
    {
        ResMode res = this.resolutions[this.resMode];

        Screen.SetResolution(res.width, res.height, this.isFull, res.refreshRate);
        LevelSelectMenu.evictCache();
    }
        public void OnResetPressed()
        {
            var volumetricFogOptions = ScriptableObject.CreateInstance <VolumetricFogOptions>();

            FindObjectOfType <VolumetricFog>().fogOptions = volumetricFogOptions;
            Screen.SetResolution(1920, 1080, true, Screen.currentResolution.refreshRate);
            foreach (var option in GetComponentsInChildren <Option>(true))
            {
                option.CurrentOptions = volumetricFogOptions;
                option.Awake();
            }
        }
        /// <summary>
        /// Called by Unity. Initializes viewer.
        /// </summary>
        private void Awake()
        {
            // Load config.
            Config = CubismViewerIo.LoadConfig <CubismViewerConfig>();


            // Initialize screen size.
            Screen.SetResolution(Config.ScreenWidth, Config.ScreenHeight, false);


            // Initialize file dialog.
            FileDialog = new OpenFileDialog();

            if (!string.IsNullOrEmpty(Config.LastFileDialogPath))
            {
                FileDialog.InitialDirectory = CubismViewerIo.GetDirectoryName(Config.LastFileDialogPath);
            }

            FileDialog.Filter           = "Models (*.model3.json)|*.model3.json|Motions (*.motion3.json)|*.motion3.json|Others (*.*)|*.*";
            FileDialog.FilterIndex      = 1;
            FileDialog.RestoreDirectory = true;
        }
Exemple #4
0
 public static void SetResolution(int width, int height, bool fullscreen, int preferredRefreshRate = 0)
 {
     UnityScreen.SetResolution(width, height, fullscreen, preferredRefreshRate);
 }
Exemple #5
0
    public void Apply()
    {
        ResMode res = this.resolutions[modes.value];

        Screen.SetResolution(res.width, res.height, this.fullscreen.isOn, res.refreshRate);
    }