Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

419
Views
Vista de juego en modo de pantalla completa en el editor

Estoy tratando de hacer que mi juego se vea en pantalla completa y he encontrado algunos scripts en línea para lograrlo. Desafortunadamente, no puedo ejecutarlos en la versión 2020 (o 2018+). ¿Hay algún método para habilitar la ventana del juego en pantalla completa durante el modo editor? Del siguiente script, obtengo un error de excepción en System.Object Res = GetMainGameView.Invoke (null, null); ¿La versión actual de Unity no es accesible para GetMainGameView?

 using UnityEditor; using UnityEngine; namespace FullScreenPlayModes { [InitializeOnLoad] public class FullScreenPlayMode : Editor { //The size of the toolbar above the game view, excluding the OS border. private static int toolbarHeight = 22; static FullScreenPlayMode () { EditorApplication.playModeStateChanged -= PlayModeStateChanged; EditorApplication.playModeStateChanged += PlayModeStateChanged; } static void PlayModeStateChanged (PlayModeStateChange _playModeStateChange) { if (PlayerPrefs.GetInt ("PlayMode_FullScreen", 0) == 1) { // Get game editor window EditorApplication.ExecuteMenuItem ("Window/General/Game"); System.Type T = System.Type.GetType ("UnityEditor.GameView,UnityEditor"); System.Reflection.MethodInfo GetMainGameView = T.GetMethod ("GetMainGameView", System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static); System.Object Res = GetMainGameView.Invoke (null, null); EditorWindow gameView = (EditorWindow) Res; switch (_playModeStateChange) { case PlayModeStateChange.EnteredPlayMode: Rect newPos = new Rect (0, 0 - toolbarHeight, Screen.currentResolution.width, Screen.currentResolution.height + toolbarHeight); gameView.position = newPos; gameView.minSize = new Vector2 (Screen.currentResolution.width, Screen.currentResolution.height + toolbarHeight); gameView.maxSize = gameView.minSize; gameView.position = newPos; break; case PlayModeStateChange.EnteredEditMode: gameView.Close (); break; } } } [MenuItem ("Tools/Editor/Play Mode/Full Screen", false, 0)] public static void PlayModeFullScreen () { PlayerPrefs.SetInt ("PlayMode_FullScreen", 1); } [MenuItem ("Tools/Editor/Play Mode/Full Screen", true, 0)] public static bool PlayModeFullScreenValidate () { return PlayerPrefs.GetInt ("PlayMode_FullScreen", 0) == 0; } [MenuItem ("Tools/Editor/Play Mode/Window", false, 0)] public static void PlayModeWindow () { PlayerPrefs.SetInt ("PlayMode_FullScreen", 0); } [MenuItem ("Tools/Editor/Play Mode/Window", true, 0)] public static bool PlayModeWindowValidate () { return PlayerPrefs.GetInt ("PlayMode_FullScreen", 0) == 1; } } }
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

La mayoría de la gente sugeriría usar "maximizar en el botón de reproducción", que no es lo que desea.

Sugeriría que si desea probar el aspecto de su juego en pantalla completa, solo cree y ejecute después de editar la configuración de compilación/configuración del jugador y haga que el juego esté en pantalla completa o incluso use alt + enter para ir a pantalla completa y probar Tu apariencia; tu aspecto.

Esto será mucho más fácil que usar secuencias de comandos en el juego solo para probar la pantalla completa en el editor A MENOS QUE desee ver la salida de la consola mientras está en pantalla completa. También hay un activo gratuito en la tienda, vea la consola en construcción.

https://assetstore.unity.com/packages/tools/gui/in-game-debug-console-68068

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!