private void SelfCheckingProcess(object[] parameters)
    {
        switch (checkedEvent)
        {
        case CheckedEvent.Eve_Start:
        {
            checkedEvent = CheckedEvent.Eve_GameResolution;
            TimerCall(SelfCheckingProcess, 1, false);
        }
        break;

        case CheckedEvent.Eve_GameResolution:
        {
            if (UniGameOptionsDefine.gameResolution != UniGameOptionsFile.GameResolution.Resolution_Default)
            {
                UnityEngine.Resolution resolution = UniGameOptionsDefine.gameResolutionUnity;
                Screen.SetResolution(resolution.width, resolution.height, true);
            }
            checkedEvent = CheckedEvent.Eve_IntoGameOk;
            TimerCall(SelfCheckingProcess, 1, false);
        }
        break;

        case CheckedEvent.Eve_IntoGameOk:
        {
            //在这里预载入声音资源
            MusicPlayer.LoadAllUnloadAudioClip();

            //进入公司LOGO过程
            ConsoleCenter.CurrentSceneWorkMode = SceneWorkMode.SCENEWORKMODE_Release;
            processControl.ActivateProcess(typeof(StandbyProcess));
        }
        break;
        }
    }
Ejemplo n.º 2
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();
    }
 static public int constructor(IntPtr l)
 {
     try {
                     #if DEBUG
         var    method     = System.Reflection.MethodBase.GetCurrentMethod();
         string methodName = GetMethodName(method);
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.BeginSample(methodName);
                     #else
         Profiler.BeginSample(methodName);
                     #endif
                     #endif
         UnityEngine.Resolution o;
         o = new UnityEngine.Resolution();
         pushValue(l, true);
         pushValue(l, o);
         return(2);
     }
     catch (Exception e) {
         return(error(l, e));
     }
             #if DEBUG
     finally {
                     #if UNITY_5_5_OR_NEWER
         UnityEngine.Profiling.Profiler.EndSample();
                     #else
         Profiler.EndSample();
                     #endif
     }
             #endif
 }
Ejemplo n.º 4
0
        /// <summary>
        /// Description : Set Service data
        /// </summary>
        public override void SetServiceData()
        {
            // Init resolution and Screen mode
            UnityEngine.Resolution resolution = Screen.currentResolution;
            FullScreenMode         screenMode = Screen.fullScreenMode;

            // Set service data
            _serviceData = "- Current Resolution : [" + resolution.height + " : " + resolution.width + "] | FullScreen : [" + screenMode + "]";
        }
Ejemplo n.º 5
0
        void OnEnable()
        {
            this.wantsMouseMove = true;
            resolution = (Resolution) EditorPrefs.GetInt("pb_Profiler.resolution", 2);
            EditorApplication.update -= Update;
            EditorApplication.update += Update;

            sampleView = new SampleTree();
        }
Ejemplo n.º 6
0
    static public int set_refreshRate(IntPtr l)
    {
        UnityEngine.Resolution o = (UnityEngine.Resolution)checkSelf(l);
        int v;

        checkType(l, 2, out v);
        o.refreshRate = v;
        setBack(l, o);
        return(0);
    }
Ejemplo n.º 7
0
    static public int set_height(IntPtr l)
    {
        UnityEngine.Resolution o = (UnityEngine.Resolution)checkSelf(l);
        int v;

        checkType(l, 2, out v);
        o.height = v;
        setBack(l, o);
        return(0);
    }
Ejemplo n.º 8
0
        /// <summary>
        /// Gets the resolution at which the game is currently rendering.
        /// </summary>
        /// <param name="resolution">Output paramter for the current resolution game is rendering in.</param>
        /// <returns>Returns whether it succeeded or not.</returns>
        public static Result GetResolution(out Resolution resolution)
        {
#if BROWSER
            resolution = new Resolution();
            return(trail_pfk_unity_get_game_resolution(SDK.Raw, out resolution));
#else
            UnityEngine.Resolution res = Screen.currentResolution;
            resolution = new Resolution(res.width, res.height);
            return(Result.Ok);
#endif
        }
	static public int constructor(IntPtr l) {
		try {
			UnityEngine.Resolution o;
			o=new UnityEngine.Resolution();
			pushValue(l,true);
			pushValue(l,o);
			return 2;
		}
		catch(Exception e) {
			return error(l,e);
		}
	}
Ejemplo n.º 10
0
// methods

    static bool Resolution_ToString(JSVCall vc, int argc)
    {
        int len = argc;

        if (len == 0)
        {
            UnityEngine.Resolution argThis = (UnityEngine.Resolution)vc.csObj;                JSApi.setStringS((int)JSApi.SetType.Rval, argThis.ToString());
            JSMgr.changeJSObj(vc.jsObjID, argThis);
        }

        return(true);
    }
Ejemplo n.º 11
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Resolution o;
         o = new UnityEngine.Resolution();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Resolution o;
         o=new UnityEngine.Resolution();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
Ejemplo n.º 13
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Resolution o;
         o = new UnityEngine.Resolution();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
Ejemplo n.º 14
0
 static int ToString(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         UnityEngine.Resolution obj = (UnityEngine.Resolution)ToLua.CheckObject(L, 1, typeof(UnityEngine.Resolution));
         string o = obj.ToString();
         LuaDLL.lua_pushstring(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Ejemplo n.º 15
0
 static void Resolution_refreshRate(JSVCall vc)
 {
     if (vc.bGet)
     {
         UnityEngine.Resolution _this = (UnityEngine.Resolution)vc.csObj;
         var result = _this.refreshRate;
         JSApi.setInt32((int)JSApi.SetType.Rval, (System.Int32)(result));
     }
     else
     {
         System.Int32           arg0  = (System.Int32)JSApi.getInt32((int)JSApi.GetType.Arg);
         UnityEngine.Resolution _this = (UnityEngine.Resolution)vc.csObj;
         _this.refreshRate = arg0;
         JSMgr.changeJSObj(vc.jsObjID, _this);
     }
 }
Ejemplo n.º 16
0
    static int get_refreshRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Resolution obj = (UnityEngine.Resolution)o;
            int ret = obj.refreshRate;
            LuaDLL.lua_pushinteger(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index refreshRate on a nil value" : e.Message));
        }
    }
Ejemplo n.º 17
0
    static int set_refreshRate(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.Resolution obj = (UnityEngine.Resolution)o;
            int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
            obj.refreshRate = arg0;
            ToLua.SetBack(L, 1, obj);
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index refreshRate on a nil value" : e.Message));
        }
    }
Ejemplo n.º 18
0
        /// <summary>
        /// Reports that the resolution has changed.
        /// </summary>
        /// <param name="resolution">Resolution value to provide in the report.</param>
        /// <returns>Returns whether it succeeded or not to report.</returns>
        public static Result ReportResolutionChanged(UnityEngine.Resolution resolution)
        {
            var rs = new Resolution(resolution);

            return(trail_ink_report_game_resolution_changed(SDK.Raw, ref rs));
        }
Ejemplo n.º 19
0
 /// <summary>
 /// <para>Returns the supported frame rates at which a video can be recorded given a resolution.</para>
 /// </summary>
 /// <param name="resolution">A recording resolution.</param>
 /// <returns>
 /// <para>The frame rates at which the video can be recorded.</para>
 /// </returns>
 public static IEnumerable<float> GetSupportedFrameRatesForResolution(Resolution resolution)
 {
     return GetSupportedFrameRatesForResolution_Internal(resolution.width, resolution.height);
 }
Ejemplo n.º 20
0
        /// <summary>
        /// Method for moving to the next resoution in the allRes array. WARNING: This is not finished/buggy.  
        /// </summary>
        //Method for moving to the next resoution in the allRes array. WARNING: This is not finished/buggy.
        public void nextRes()
        {
            beforeRes = currentRes;
            //Iterate through all of the resoultions.
            for (int i = 0; i < allRes.Length; i++)
            {
                //If the resoultion matches the current resoution height and width then go through the statement.
                if (allRes[i].height == currentRes.height && allRes[i].width == currentRes.width)
                {
                    //Debug.Log("found " + i);
                    //If the user is playing fullscreen. Then set the resoution to one element higher in the array, set the full screen boolean to true, reset the current resolution, and then update the resolution label.
                    if (isFullscreen == true) { Screen.SetResolution(allRes[i + 1].width, allRes[i + 1].height, true); isFullscreen = true; currentRes = Screen.resolutions[i + 1]; resolutionLabel.text = currentRes.width.ToString() + " x " + currentRes.height.ToString(); }
                    //If the user is playing in a window. Then set the resoution to one element higher in the array, set the full screen boolean to false, reset the current resolution, and then update the resolution label.
                    if (isFullscreen == false) { Screen.SetResolution(allRes[i + 1].width, allRes[i + 1].height, false); isFullscreen = false; currentRes = Screen.resolutions[i + 1]; resolutionLabel.text = currentRes.width.ToString() + " x " + currentRes.height.ToString(); }

                    //Debug.Log("Res after: " + currentRes);
                }
            }
        }
Ejemplo n.º 21
0
 /// <summary>
 /// Method for moving to the next resoution in the allRes array. WARNING: This is not finished/buggy.  
 /// </summary>
 //Method for moving to the next resoution in the allRes array. WARNING: This is not finished/buggy.
 public void NextRes()
 {
     _beforeRes = CurrentRes;
     //Iterate through all of the resoultions.
     ChangeRes(1);
 }
Ejemplo n.º 22
0
        /*
        //Color fade duration value
        //public float crossFadeDuration;
        //custom color
        //public Color _customColor;

         //Animation clips
         private AnimationClip audioIn;
         private AnimationClip audioOut;
         public AnimationClip vidIn;
         public AnimationClip vidOut;
         public AnimationClip mainIn;
         public AnimationClip mainOut;
          */
        //Blur Variables
        //Blur Effect Script (using the standard image effects package)
        //public Blur blurEffect;
        //Blur Effect Shader (should be the one that came with the package)
        //public Shader blurEffectShader;
        //Boolean for if the blur effect was originally enabled
        //public Boolean blurBool;
        /// <summary>
        /// The start method; you will need to place all of your inital value getting/setting here. 
        /// </summary>
        public void Start()
        {
            readUseSimpleTerrain = useSimpleTerrain;
            if (useSimpleTerrain)
            {
                readSimpleTerrain = simpleTerrain;
            }
            else
            {
                readTerrain = terrain;
            }

            mainCamShared = mainCam;
            //Set the lastmusicmult and last audiomult
            lastMusicMult = audioMusicSlider.value;
            lastAudioMult = audioEffectsSlider.value;
            //Set the first selected item
            uiEventSystem.firstSelectedGameObject = defualtSelectedMain;
            //Get the presets from the quality settings
            presets = QualitySettings.names;
            presetLabel.text = presets[QualitySettings.GetQualityLevel()].ToString();
            _currentLevel = QualitySettings.GetQualityLevel();
            //Get the current resoultion, if the game is in fullscreen, and set the label to the original resolution
            allRes = Screen.resolutions;
            currentRes = Screen.currentResolution;
            //Debug.Log("ini res" + currentRes);
            resolutionLabel.text = Screen.currentResolution.width.ToString() + " x " + Screen.currentResolution.height.ToString();
            isFullscreen = Screen.fullScreen;
            //get initial screen effect bools
            lastAOBool = aoToggle.isOn;
            lastDOFBool = dofToggle.isOn;
            //get all specified audio source volumes
            _beforeEffectVol = new float[_audioEffectAmt];
            beforeMaster = AudioListener.volume;
            //get all ini values
            aaQualINI = QualitySettings.antiAliasing;
            renderDistINI = mainCam.farClipPlane;
            shadowDistINI = QualitySettings.shadowDistance;
            fovINI = mainCam.fieldOfView;
            msaaINI = QualitySettings.antiAliasing;
            vsyncINI = QualitySettings.vSyncCount;
            //enable titles
            TitleTexts.SetActive(true);
            //Find terrain
            terrain = Terrain.activeTerrain;
            //Disable other panels
            mainPanel.SetActive(false);
            contPanel.SetActive(false);
            vidPanel.SetActive(false);
            audioPanel.SetActive(false);
            //Enable mask
            mask.SetActive(false);
            //set last texture limit
            lastTexLimit = QualitySettings.masterTextureLimit;
            //set last shadow cascade
            lastShadowCascade = QualitySettings.shadowCascades;
            saveSettings.LoadGameSettings(File.ReadAllText(Application.persistentDataPath + "/" + saveSettings.fileName));
            try
            {
                densityINI = Terrain.activeTerrain.detailObjectDensity;
            }
            catch
            {
                if (terrain = null)
                {
                    Debug.Log("Terrain Not Assigned");
                }
            }

            //set the blur boolean to false;
            //blurBool = false;
            //Add the blur effect
            /*mainCamObj.AddComponent(typeof(Blur));
            blurEffect = (Blur)mainCamObj.GetComponent(typeof(Blur));
            blurEffect.blurShader = blurEffectShader;
            blurEffect.enabled = false;  */
        }
Ejemplo n.º 23
0
 public ComboBoxItem(Resolution r)
 {
     _res = r;
     _caption = r.width + " x " + r.height;
 }
Ejemplo n.º 24
0
 /// <summary>
 /// Use an IEnumerator to first play the animation and then change the video settings.
 /// </summary>
 /// <returns></returns>
 internal IEnumerator applyVideo()
 {
     vidPanelAnimator.Play("Video Panel Out");
     yield return StartCoroutine(CoroutineUtilities.WaitForRealTime((float)vidPanelAnimator.GetCurrentAnimatorClipInfo(0).Length));
     mainPanel.SetActive(true);
     contPanel.SetActive(false);
     vidPanel.SetActive(false);
     audioPanel.SetActive(false);
     renderDistINI = mainCam.farClipPlane;
     shadowDistINI = QualitySettings.shadowDistance;
     Debug.Log("Shadow dist ini" + shadowDistINI);
     fovINI = mainCam.fieldOfView;
     aoBool = aoToggle.isOn;
     dofBool = dofToggle.isOn;
     lastAOBool = aoBool;
     lastDOFBool = dofBool;
     beforeRes = currentRes;
     lastTexLimit = QualitySettings.masterTextureLimit;
     lastShadowCascade = QualitySettings.shadowCascades;
     vsyncINI = QualitySettings.vSyncCount;
     isFullscreen = Screen.fullScreen;
     try
     {
         if (useSimpleTerrain == true)
         {
             densityINI = simpleTerrain.detailObjectDensity;
             treeMeshAmtINI = simpleTerrain.treeMaximumFullLODCount;
         }
         else
         {
             densityINI = terrain.detailObjectDensity;
             treeMeshAmtINI = simpleTerrain.treeMaximumFullLODCount;
         }
     }
     catch { Debug.Log("Please assign a terrain"); }
     saveSettings.SaveGameSettings();
 }
Ejemplo n.º 25
0
        void OnGUI()
        {
            int availableProfilerCount = profiles.Count;
            string[] display = new string[availableProfilerCount];
            int[] values = new int[availableProfilerCount];

            for(int i = 0; i < availableProfilerCount; i++)
            {
                display[i] = profiles[i].name;
                values[i] = i;
            }

            if(profiler == null && availableProfilerCount > 0)
            {
                profiler = profiles[0];
                sampleView.SetProfiler(profiler);
            }

            GUILayout.BeginHorizontal(EditorStyles.toolbar);

                EditorGUI.BeginChangeCheck();
                    view = EditorGUILayout.IntPopup("", view, display, values, EditorStyles.toolbarDropDown);
                if(EditorGUI.EndChangeCheck())
                {
                    profiler = view > -1 && view < availableProfilerCount ? profiles[view] : null;
                    sampleView.SetProfiler(profiler);
                }

                GUILayout.FlexibleSpace();

                resolution = (Resolution) EditorGUILayout.EnumPopup("", resolution, EditorStyles.toolbarDropDown);

                // if(GUILayout.Button("Print"))
                // 	UnityEngine.Debug.Log(profiler.ToString());

                if( GUILayout.Button("Clear", EditorStyles.toolbarButton) && profiler != null)
                    profiler.Reset();

            GUILayout.EndHorizontal();

            sampleView.Draw();

            if(sampleView.wantsRepaint)
            {
                sampleView.wantsRepaint = false;
                Repaint();
            }
        }
Ejemplo n.º 26
0
 static int _CreateUnityEngine_Resolution(IntPtr L)
 {
     UnityEngine.Resolution obj = new UnityEngine.Resolution();
     ToLua.PushValue(L, obj);
     return(1);
 }
Ejemplo n.º 27
0
    override protected void start()
    {
        /* Create a value with the list of resolution modes */
        this.resolutions = Screen.resolutions;
        string[] resList = new string[this.resolutions.Length];
        this.resMode = 0;
        for (int i = 0; i < this.resolutions.Length; i++)
        {
            ResMode mode = this.resolutions[i];
            if (Screen.height == mode.height && Screen.width == mode.width)
            {
                this.resMode = i;
            }
            resList[i] = $"{mode.width}x{mode.height}@{mode.refreshRate}";
        }

        this.isFull = Screen.fullScreen;

        string[] audioModes = new string[11];
        for (int i = 1; i < audioModes.Length; i++)
        {
            audioModes[i] = $"{i*10}%";
        }
        audioModes[0] = "Off";
        float audioRatio = (float)audioModes.Length - 1.0f;

        Option[] _opts =
        {
            Option.SectionHeader("-- Audio --"),
            new Option("Global",
                       "Adjusted game-audio globally (both music and sound effects).",
                       (new Values(idx => Config.setGlobalVolume(idx / audioRatio),
                                   audioModes).setAt((int)(Config.getGlobalVolume() * audioRatio)))),
            new Option("Music",
                       "Music volume.",
                       (new Values(idx => Config.setMusicVolume(idx / audioRatio),
                                   audioModes).setAt((int)(Config.getMusicVolume() * audioRatio)))),
            new Option("Sounds",
                       "Sound effects volume.",
                       (new Values(idx => Config.setSfxVolume(idx / audioRatio),
                                   audioModes).setAt((int)(Config.getSfxVolume() * audioRatio)))),

            Option.SectionHeader("-- General --"),
            new Option("Camera X",
                       "Configure horizontal camera movement.\n" +
                       "Try it out!",
                       (new Values(idx => Config.setHorCamInverted(idx == 1),
                                   "Normal",
                                   "Inverted")).setAt((Config.getHorCamInverted()) ? 1 : 0)),
            new Option("Camera Y",
                       "Configure vertical camera movement.\n" +
                       "Try it out!",
                       (new Values(idx => Config.setVerCamInverted(idx == 1),
                                   "Normal",
                                   "Inverted")).setAt((Config.getVerCamInverted()) ? 1 : 0)),

            Option.SectionHeader("-- Graphics --"),
            new Option("Resolution",
                       "Set the game's resolution.\n" +
                       "Only takes effect on \"Apply\"!",
                       (new Values(idx => this.resMode = idx,
                                   resList)).setAt(this.resMode)),
            new Option("Fullscreen",
                       "Choose windowed or fullscreen mode.\n" +
                       "Only takes effect on \"Apply\"!",
                       (new Values(idx => this.isFull = (idx == 1),
                                   "Windowed",
                                   "Fullscreen")).setAt(this.isFull ? 1 : 0)),
            new Option("Apply",
                       "Apply the selected resolution and\n" +
                       "windowed mode.",
                       null),
            new Option("Particles",
                       "Particle system quality. Controls\n" +
                       "the quantity of particles spawned.",
                       (new Values(idx => {
                Global.ParticleQuality gpq;
                gpq = (Global.ParticleQuality)idx;
                Config.setParticlesQual(gpq);
            },
                                   "Off",                                                               "Low","Mid", "High")).setAt((int)Config.getParticlesQual())),

            Option.SectionHeader("-- Rebind --"),
            new Option("Reset",
                       "Reset input bindings to their initial configurations.",
                       null),
            new Option("Input A",
                       "Configure 1 of 3 simultaneous control schemes. (Default: Keyboard)",
                       null),
            new Option("Input B",
                       "Configure 1 of 3 simultaneous control schemes. (Default: Gamepad)",
                       null),
            new Option("Input C",
                       "Configure 1 of 3 simultaneous control schemes. (Default: Empty)",
                       null),

            Option.SectionHeader("--"),
            new Option("Back",
                       "Go back to the previous menu.",
                       null),
        };
        this.opts = _opts;

        /* Create the list of options (left view) */
        string highlighText = "";

        this.options = new string[this.opts.Length];

        for (int i = 0; i < this.opts.Length; i++)
        {
            Option o = this.opts[i];
            highlighText   += $"{o.getHeader()}\n";
            this.options[i] = o.getTitle();
        }

        this.titles.text = highlighText;

        this.CombinedLoadScene("scenes/000-game-controller/bg-scenes/CameraTester");
        base.start();
        /* Forcefully starts from index 1 */
        this.onDown();

        this.updateValues();
    }
Ejemplo n.º 28
0
        private bool EnsureCameraIsSetup()
        {
#if UNITY_WSA && !UNITY_EDITOR
            // setup as normal
            this.IsAvailableOnPlatform = true;
#else
            if (!this.UseInEditor)
            {
                return(false);
            }
#endif
            if (asyncCameraSetupStarted)
            {
                return(true); // done!
            }

            try
            {
                var reses = PhotoCapture.SupportedResolutions.OrderByDescending(k => k.width);
                if (reses.Count() > 0)
                {
                    PhotoCapCamResolution = reses.First();
                    foreach (var res in reses)
                    {
                        if (res.width <= MinWidth)
                        {
                            break;
                        }
                        PhotoCapCamResolution = res;
                    }

                    // Check to see if the capture object is null - which means this is the first time through,
                    // or the object has been released by the "ReleaseCamera" function.
                    if (PhotoCap == null)
                    {
                        PhotoCapture.CreateAsync(false, delegate(PhotoCapture captureObject)
                        {
                            PhotoCap = captureObject;

                            asyncCameraSetupStarted = false;
                            this.EnsureCameraIsSetup();
                        });
                    }
                    else
                    {
                        CameraParameters cameraParameters = new CameraParameters();
                        cameraParameters.hologramOpacity        = 0.0f;
                        cameraParameters.cameraResolutionWidth  = PhotoCapCamResolution.width;
                        cameraParameters.cameraResolutionHeight = PhotoCapCamResolution.height;
                        cameraParameters.pixelFormat            = CapturePixelFormat.BGRA32;

                        PhotoCap.StartPhotoModeAsync(cameraParameters, delegate(PhotoCapture.PhotoCaptureResult result)
                        {
                            if (result.success)
                            {
                                cameraReady = true;
                                Debug.Log("PhotoCapture created...");
                            }

                            asyncCameraSetupStarted = false;
                        });
                    }

                    asyncCameraSetupStarted = true;
                    return(true);
                }

                return(false);
            }
            catch (System.Exception ex)
            {
                Debug.Log(ex);
                return(false);
            }
        }
Ejemplo n.º 29
0
 /// <summary>
 /// Method for moving to the last resoution in the allRes array. WARNING: This is not finished/buggy.  
 /// </summary>
 //Method for moving to the last resoution in the allRes array. WARNING: This is not finished/buggy.
 public void LastRes()
 {
     _beforeRes = CurrentRes;
     ChangeRes(-1);
 }
Ejemplo n.º 30
0
 static public int get_height(IntPtr l)
 {
     UnityEngine.Resolution o = (UnityEngine.Resolution)checkSelf(l);
     pushValue(l, o.height);
     return(1);
 }
 private string ResToString(Resolution res)
 {
     return res.width + " x " + res.height;
 }
Ejemplo n.º 32
0
 private void ChangeRes(int index)
 {
     for (int i = 0; i < _allRes.Length; i++)
     {
         //If the resoultion matches the current resoution height and width then go through the statement.
         if (_allRes[i].height == CurrentRes.height && _allRes[i].width == CurrentRes.width)
         {
             Screen.SetResolution(_allRes[i + index].width, _allRes[i + index].height, _isFullscreen); _isFullscreen = _isFullscreen; CurrentRes = Screen.resolutions[i + index]; ResolutionLabel.text = CurrentRes.width.ToString() + " x " + CurrentRes.height.ToString();
         }
     }
 }
Ejemplo n.º 33
0
 static public int get_refreshRate(IntPtr l)
 {
     UnityEngine.Resolution o = (UnityEngine.Resolution)checkSelf(l);
     pushValue(l, o.refreshRate);
     return(1);
 }
Ejemplo n.º 34
0
 public void SettingsApply()
 {
     UnityEngine.Resolution res = UnityEngine.Screen.resolutions[settingsResolutionDropdown.value];
     QualitySettings.SetQualityLevel(qualityDropdown.value);
     UnityEngine.Screen.SetResolution(res.width, res.height, settingsFullscreenToggle.isOn ? FullScreenMode.FullScreenWindow : FullScreenMode.Windowed, res.refreshRate);
 }
Ejemplo n.º 35
0
 static public int get_width(IntPtr l)
 {
     UnityEngine.Resolution o = (UnityEngine.Resolution)checkSelf(l);
     pushValue(l, o.width);
     return(1);
 }
    void SelfCheckingProcess(object[] parameters)
    {
        switch (checkedEvent)
        {
        case CheckedEvent.Eve_Start:
        {
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str1"));        //开始系统自检...
            checkedEvent = CheckedEvent.Eve_ProduceActivateInfo;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_ProduceActivateInfo:
        {
            ShowMessage(PartingLine);
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str2"));        //产品激活成功!
            ShowMessage(string.Format(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str3"),
                                      GameRoot.produceActivateId.activateId,
                                      GameRoot.produceActivateId.activateDate));  //产品编码:{0} 激活日期:{1}
            checkedEvent = CheckedEvent.Eve_ProduceVersion;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_ProduceVersion:
        {
            FTLibrary.Produce.ProduceVersionInformation.VersionInfo version = GameRoot.gameResource.produceVersion.mainVersion;
            ShowMessage(string.Format(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str4"),
                                      version.version,
                                      version.compiledate,
                                      version.issuedate));  //产品版本:{0} 生产日期:{1} 发布日期:{2}
            checkedEvent = CheckedEvent.Eve_InputDeviceResponse;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_InputDeviceResponse:
        {
            ShowMessage(PartingLine);
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str5"));        //输入设备自检...

            checkedEvent = CheckedEvent.Eve_InputDeviceResponseOver;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_InputDeviceResponseOver:
        {
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str6"));        //输入设备自检完成

            checkedEvent = CheckedEvent.Eve_InputDeviceOut;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_InputDeviceOut:
        {
            ShowMessage(PartingLine);
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str7"));        //输出设备自检...

            checkedEvent = CheckedEvent.Eve_InputDeviceOutOver;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_InputDeviceOutOver:
        {
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str8"));        //输出设备自检完成!

            checkedEvent = CheckedEvent.Eve_GameResolution;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_GameResolution:
        {
            ShowMessage(PartingLine);
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str9"));        //调整游戏最佳分辨率

            if (UniGameOptionsDefine.gameResolution != UniGameOptionsFile.GameResolution.Resolution_Default)
            {
                UnityEngine.Resolution resolution = UniGameOptionsDefine.gameResolutionUnity;
                Screen.SetResolution(resolution.width, resolution.height, true);
            }

            //Resolution now = Screen.currentResolution;
            //Debug.Log(string.Format("{0},{1},{2}", now.width, now.height, now.refreshRate));
            //Resolution[] resolutions = Screen.GetResolution;
            //for (int i = 0; i < resolutions.Length;i++ )
            //{
            //    Debug.Log(string.Format("{0},{1},{2}", resolutions[i].width, resolutions[i].height, resolutions[i].refreshRate));
            //}

            checkedEvent = CheckedEvent.Eve_GameResolution1;
            TimerCall(SelfCheckingProcess, 3000, false);
        }
        break;

        case CheckedEvent.Eve_GameResolution1:
        {
            Resolution current = Screen.currentResolution;
            ShowMessage(string.Format(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str9_1"),
                                      current.width, current.height, current.refreshRate));
            ShowMessage(string.Format(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str9_2"),
                                      Screen.width, Screen.height));
            checkedEvent = CheckedEvent.Eve_IntoControlPanel;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_IntoControlPanel:
        {
            ShowMessage(PartingLine);
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str10"));
            checkedEvent = CheckedEvent.Eve_IntoGame;
            TimerCall(SelfCheckingProcess, 10000, false);
        }
        break;

        case CheckedEvent.Eve_IntoGame:
        {
            ShowMessage(GameRoot.gameResource.LoadLanguageResource_Text("Check_Str11"));
            checkedEvent = CheckedEvent.Eve_IntoGameOk;
            TimerCall(SelfCheckingProcess, EveDelayTime, false);
        }
        break;

        case CheckedEvent.Eve_IntoGameOk:
        {
            //在这里预载入声音资源
            MusicPlayer.LoadAllUnloadAudioClip();
            //进入公司LOGO过程
            processControl.ActivateProcess(typeof(CompanyLogoProcess));
        }
        break;
        }
    }
Ejemplo n.º 37
0
    public void Apply()
    {
        ResMode res = this.resolutions[modes.value];

        Screen.SetResolution(res.width, res.height, this.fullscreen.isOn, res.refreshRate);
    }
Ejemplo n.º 38
0
 /// <summary>
 /// Use an IEnumerator to first play the animation and then change the video settings.
 /// </summary>
 /// <returns></returns>
 internal IEnumerator ApplyVideo()
 {
     VidPanelAnimator.Play("Video Panel Out");
     yield return StartCoroutine(CoroutineUtilities.WaitForRealTime((float)VidPanelAnimator.GetCurrentAnimatorClipInfo(0).Length));
     MainPanel.SetActive(true);
     VidPanel.SetActive(false);
     AudioPanel.SetActive(false);
     RenderDistIni = MainCam.farClipPlane;
     ShadowDistIni = QualitySettings.shadowDistance;
     Debug.Log("Shadow dist ini" + ShadowDistIni);
     FovIni = MainCam.fieldOfView;
     AoBool = AoToggle.isOn;
     DofBool = DofToggle.isOn;
     _lastAoBool = AoBool;
     _lastDofBool = DofBool;
     _beforeRes = CurrentRes;
     LastTexLimit = QualitySettings.masterTextureLimit;
     LastShadowCascade = QualitySettings.shadowCascades;
     VsyncIni = QualitySettings.vSyncCount;
     _isFullscreen = Screen.fullScreen;
     try
     {
         DensityIni = CurrentTerrain.detailObjectDensity;
         TreeMeshAmtIni = CurrentTerrain.treeMaximumFullLODCount;
     }
     catch { Debug.Log("Please assign a terrain"); }
     _saveSettings.SaveGameSettings();
 }
Ejemplo n.º 39
0
 public ResolutionDescriptor(int id, Resolution resolution)
 {
     Id = id;
     Resolution = resolution;
 }
        void ShowResolutionPanel()
        {
            // Disable previous stage
            browserPanel.Enabled = false;

            // Get resolutions
            initialResolution = Screen.currentResolution;
            availableResolutions = Screen.resolutions;

            // Create backdrop
            if (!backdropCreated)
                CreateBackdrop();

            // Add resolution panel
            resolutionPanel.Outline.Enabled = true;
            resolutionPanel.BackgroundColor = backgroundColor;
            resolutionPanel.HorizontalAlignment = HorizontalAlignment.Left;
            resolutionPanel.VerticalAlignment = VerticalAlignment.Middle;
            resolutionPanel.Size = new Vector2(120, 175);
            NativePanel.Components.Add(resolutionPanel);

            // Add resolution title text
            TextLabel resolutionTitleLabel = new TextLabel();
            resolutionTitleLabel.Text = "Resolution";
            resolutionTitleLabel.Position = new Vector2(0, 2);
            //resolutionTitleLabel.ShadowPosition = Vector2.zero;
            resolutionTitleLabel.HorizontalAlignment = HorizontalAlignment.Center;
            resolutionPanel.Components.Add(resolutionTitleLabel);

            // Add resolution picker
            resolutionList.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f);
            resolutionList.TextColor = unselectedTextColor;
            resolutionList.SelectedTextColor = selectedTextColor;
            resolutionList.ShadowPosition = Vector2.zero;
            resolutionList.HorizontalAlignment = HorizontalAlignment.Center;
            resolutionList.RowsDisplayed = 8;
            resolutionList.RowAlignment = HorizontalAlignment.Center;
            resolutionList.Position = new Vector2(0, 12);
            resolutionList.Size = new Vector2(80, 62);
            resolutionList.SelectedShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos;
            resolutionList.SelectedShadowColor = Color.black;
            resolutionList.OnMouseClick += ResolutionList_OnMouseClick;
            resolutionList.OnScroll += ResolutionList_OnScroll;
            resolutionPanel.Components.Add(resolutionList);

            // Add resolution scrollbar
            resolutionScroller.Position = new Vector2(100, 12);
            resolutionScroller.Size = new Vector2(5, 62);
            resolutionScroller.OnScroll += ResolutionScroller_OnScroll;
            resolutionPanel.Components.Add(resolutionScroller);

            // Add resolutions
            for (int i = 0; i < availableResolutions.Length; i++)
            {
                string item = string.Format("{0}x{1}", availableResolutions[i].width, availableResolutions[i].height);
                resolutionList.AddItem(item);

                if (availableResolutions[i].width == initialResolution.width &&
                    availableResolutions[i].height == initialResolution.height)
                {
                    resolutionList.SelectedIndex = i;
                }
            }
            resolutionList.ScrollToSelected();

            // Setup scroller
            resolutionScroller.DisplayUnits = 8;
            resolutionScroller.TotalUnits = resolutionList.Count;
            resolutionScroller.BackgroundColor = resolutionList.BackgroundColor;

            // Add fullscreen checkbox
            fullscreenCheckbox.Label.Text = "Fullscreen";
            fullscreenCheckbox.Label.ShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos;
            fullscreenCheckbox.Label.ShadowColor = Color.black;
            fullscreenCheckbox.Position = new Vector2(0, 76);
            fullscreenCheckbox.HorizontalAlignment = HorizontalAlignment.Center;
            fullscreenCheckbox.IsChecked = Screen.fullScreen;
            fullscreenCheckbox.CheckBoxColor = selectedTextColor;
            fullscreenCheckbox.Label.TextColor = selectedTextColor;
            fullscreenCheckbox.OnToggleState += FullscreenCheckbox_OnToggleState;
            resolutionPanel.Components.Add(fullscreenCheckbox);

            // Add quality title text
            TextLabel qualityTitleLabel = new TextLabel();
            qualityTitleLabel.Text = "Quality";
            qualityTitleLabel.Position = new Vector2(0, 92);
            //qualityTitleLabel.ShadowPosition = Vector2.zero;
            qualityTitleLabel.HorizontalAlignment = HorizontalAlignment.Center;
            resolutionPanel.Components.Add(qualityTitleLabel);

            // Add quality picker
            qualityList.BackgroundColor = new Color(0.1f, 0.1f, 0.1f, 0.5f);
            qualityList.TextColor = unselectedTextColor;
            qualityList.SelectedTextColor = selectedTextColor;
            qualityList.ShadowPosition = Vector2.zero;
            qualityList.HorizontalAlignment = HorizontalAlignment.Center;
            qualityList.RowsDisplayed = 6;
            qualityList.RowAlignment = HorizontalAlignment.Center;
            qualityList.Position = new Vector2(0, 102);
            qualityList.Size = new Vector2(85, 46);
            qualityList.SelectedShadowPosition = DaggerfallUI.DaggerfallDefaultShadowPos;
            qualityList.SelectedShadowColor = Color.black;
            qualityList.OnMouseClick += QualityList_OnMouseClick;
            resolutionPanel.Components.Add(qualityList);
            foreach(var name in QualitySettings.names)
            {
                qualityList.AddItem(name);
            }
            qualityList.SelectedIndex = DaggerfallUnity.Settings.QualityLevel;

            // Test/confirm button
            testOrConfirmButton.Position = new Vector2(0, 160);
            testOrConfirmButton.Size = new Vector2(40, 12);
            testOrConfirmButton.Outline.Enabled = true;
            testOrConfirmButton.Label.Text = testText;
            testOrConfirmButton.BackgroundColor = new Color(0.0f, 0.5f, 0.0f, 0.4f);
            testOrConfirmButton.HorizontalAlignment = HorizontalAlignment.Center;
            testOrConfirmButton.OnMouseClick += ResolutionTestOrConfirmButton_OnMouseClick;
            resolutionPanel.Components.Add(testOrConfirmButton);
        }