void OnGUI() { float guiscale = Screen.width / 800f; style.box.fontSize = Mathf.RoundToInt(guiscale * 20); style.button.fontSize = Mathf.RoundToInt(guiscale * 20); style.label.fontSize = Mathf.RoundToInt(guiscale * 20); optionlabel.fontSize = Mathf.RoundToInt(guiscale * 36); style.GetStyle("talk_player").fontSize = Mathf.RoundToInt(guiscale * 20); float rectwith = guiscale * 330; switch (guistate) { case guiState.ANSWERS_MENU: GUILayout.BeginArea(new Rect(Screen.width * 0.1f, Screen.height * 0.1f, Screen.width * 0.8f, Screen.height * 0.8f)); GUILayout.BeginVertical(); OptionConversationNode options = (OptionConversationNode)guioptions.getNode(); GUILayout.Label(GUIManager.Instance.Last, optionlabel); for (int i = 0; i < options.getLineCount(); i++) { ConversationLine ono = options.getLine(i); if (ConditionChecker.check(options.getLineConditions(i))) { if (GUILayout.Button((string)ono.getText(), style.button)) { GameObject.Destroy(blur); guioptions.clicked(i); Tracker.T().Choice(GUIManager.Instance.Last, ono.getText()); Tracker.T().RequestFlush(); Interacted(); } } ; } GUILayout.EndVertical(); GUILayout.EndArea(); break; default: break; } }
void OnGUI() { float guiscale = Screen.width / 800f; style.box.fontSize = Mathf.RoundToInt(guiscale * 20); style.button.fontSize = Mathf.RoundToInt(guiscale * 20); style.label.fontSize = Mathf.RoundToInt(guiscale * 20); optionlabel.fontSize = Mathf.RoundToInt(guiscale * 36); //style.label.fontSize = Mathf.RoundToInt(guiscale * 20); style.GetStyle("talk_player").fontSize = Mathf.RoundToInt(guiscale * 20); float rectwith = guiscale * 330; switch (guistate) { case guiState.TALK_PLAYER: /*GUILayout.BeginArea (new Rect ((Screen.width/2)-rectwith/2, 50, rectwith, 400)); * GUILayout.BeginHorizontal (); * GUILayout.Box (guitext,style.GetStyle("talk_player")); * GUILayout.EndHorizontal (); * GUILayout.EndArea ();*/ break; case guiState.TALK_CHARACTER: /*GUIStyle current = new GUIStyle(style.box); * if (this.guitalkerObject != null) { * position = Camera.current.WorldToScreenPoint (this.guitalkerObject.transform.position); * Color tmp = Color.black; * NPC cha = data.getChapters () [current_chapter].getCharacter (guitalker); * * * ColorUtility.TryParseHtmlString( * cha.getTextFrontColor() * ,out tmp); * * current.normal.textColor = tmp; * current.normal.background = BorderGenerator.generateFor (cha); * }else * position = new Vector2(Screen.width/2,100); * * if(position.x <= rectwith/2) * position.x = rectwith/2; * else if(position.x >= (Screen.width - rectwith/2) ) * position.x = (Screen.width - rectwith/2); * * GUILayout.BeginArea ( * new Rect (position.x-rectwith/2, * Screen.height * - position.y * - (this.guitalkerObject.GetComponent<CharacterMB>().getHeight())*guiscale/2 * - current.CalcHeight(new GUIContent(guitext),rectwith), rectwith, 400) * ); * GUILayout.BeginHorizontal (); * GUILayout.Box (guitext,current); * GUILayout.EndHorizontal (); * GUILayout.EndArea ();*/ break; case guiState.ANSWERS_MENU: GUILayout.BeginArea(new Rect(Screen.width * 0.1f, Screen.height * 0.1f, Screen.width * 0.8f, Screen.height * 0.8f)); GUILayout.BeginVertical(); OptionConversationNode options = (OptionConversationNode)guioptions.getNode(); GUILayout.Label(guitext, optionlabel); for (int i = 0; i < options.getLineCount(); i++) { ConversationLine ono = options.getLine(i); if (ConditionChecker.check(options.getLineConditions(i))) { if (GUILayout.Button((string)ono.getText(), style.button)) { GameObject.Destroy(blur); guioptions.clicked(i); Interacted(); } } ; } GUILayout.EndVertical(); GUILayout.EndArea(); break; case guiState.LOADING_GAME: break; case guiState.NOTHING: /*if(loader_state == loaderState.LOADING){ * GUILayout.BeginArea (new Rect (Screen.width*0.1f, Screen.height*0.1f, Screen.width*0.8f, Screen.height*0.8f)); * GUILayout.BeginVertical (); * GUILayout.Label ("Cargando",style.label); * * if(totals != null){ * GUILayout.Box ("Personajes: " + this.characters.Count + " de " + totals["Characters"],style.box); * GUILayout.Box ("Objetos: " + this.objects.Count + " de " + totals["Objects"],style.box); * GUILayout.Box ("Objetos de Atrezzo: " + this.atrezzos.Count + " de " + totals["Atrezzos"],style.box); * GUILayout.Box ("Estados Globales: " + this.global_states.Count + " de " + totals["Global-States"],style.box); * GUILayout.Box ("Grafos de Conversacion: " + this.graph_conversations.Count + " de " + totals["Graph-conversations"],style.box); * GUILayout.Box ("Macros: " + this.macros.Count + " de " + totals["Macros"],style.box); * * GUILayout.Box ("Escenas: " + this.scenes.Count + " de " + totals["Scene"],style.box); * } * * * GUILayout.EndVertical (); * GUILayout.EndArea (); * }*/ break; case guiState.GAME_SELECTION: /*GUILayout.BeginArea (new Rect (Screen.width*0.1f, Screen.height*0.1f, Screen.width*0.8f, Screen.height*0.8f)); * GUILayout.BeginVertical (); * string[] games = Directory.GetDirectories("Games/"); * * GUILayout.Label("eAdventure Loader v0.1",style.label); * foreach(string game in games){ * if(GUILayout.Button (game.Split('/')[1],style.button)){ * this.selected_game = game + "/"; * //this.startLoad(); * }; * } * GUILayout.EndVertical (); * GUILayout.EndArea (); * break;*/ default: break; } }