Example #1
0
 static public int constructor(IntPtr l)
 {
     UnityEngine.Screen o;
     o = new UnityEngine.Screen();
     pushObject(l, o);
     return(1);
 }
 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.Screen o;
         o = new UnityEngine.Screen();
         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
 }
Example #3
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();
            }
        }
Example #5
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Screen o;
         o = new UnityEngine.Screen();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         return(error(l, e));
     }
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Screen o;
         o=new UnityEngine.Screen();
         pushValue(l,o);
         return 1;
     }
     catch(Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return 0;
     }
 }
Example #7
0
 static public int constructor(IntPtr l)
 {
     try {
         UnityEngine.Screen o;
         o = new UnityEngine.Screen();
         pushValue(l, o);
         return(1);
     }
     catch (Exception e) {
         LuaDLL.luaL_error(l, e.ToString());
         return(0);
     }
 }
 static public int constructor(IntPtr l)
 {
     LuaDLL.lua_remove(l, 1);
     UnityEngine.Screen o;
     if (matchType(l, 1))
     {
         o = new UnityEngine.Screen();
         pushObject(l, o);
         return(1);
     }
     LuaDLL.luaL_error(l, "New object failed.");
     return(0);
 }
 public static int constructor(IntPtr l)
 {
     try {
         UnityEngine.Screen o;
         o=new UnityEngine.Screen();
         pushValue(l,true);
         pushValue(l,o);
         return 2;
     }
     catch(Exception e) {
         return error(l,e);
     }
 }
Example #10
0
    static int _CreateUnityEngine_Screen(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                UnityEngine.Screen obj = new UnityEngine.Screen();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: UnityEngine.Screen.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
        /// <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;
        }
Example #12
0
 public static void SetResolution(int width, int height, bool fullscreen, int preferredRefreshRate = 0)
 {
     UnityScreen.SetResolution(width, height, fullscreen, preferredRefreshRate);
 }
Example #13
0
    public void Apply()
    {
        ResMode res = this.resolutions[modes.value];

        Screen.SetResolution(res.width, res.height, this.fullscreen.isOn, res.refreshRate);
    }
Example #14
0
        /// <summary>
        /// Update is called once per frame and changes the music if a new situation was reached and the variable <c>topical</c> changed.
        /// </summary>
        public void Update()
        {
            // if necessary stop the current sound and play a new one
            if (topical == Screen.OPTIONS && playing != Screen.OPTIONS)
            {
                this.audio.Stop();
                this.audio.clip = creditSound;
                this.audio.Play();
                playing = Screen.OPTIONS;
            }

            if (topical == Screen.MENU && playing != Screen.MENU)
            {
                this.audio.Stop();
                this.audio.clip = menuSound;
                this.audio.Play();
                playing = Screen.MENU;
            }

            if (topical == Screen.INGAME && playing != Screen.INGAME)
            {
                this.audio.Stop();
                this.audio.clip = gameSound;
                this.audio.Play();
                playing = Screen.INGAME;
            }
        }