private void OnGUI() { for (int i = 0; i < playerManager.GetPlayers().Count; i++) { GUI.Label(GUIMaster.GetElementRect(playerRects[i]), "Player " + playerManager.GetPlayers()[i].playerId + ": " + playerManager.GetPlayers()[i].score, scaledTextStyle); } }
public void OnGUI() { GUI.depth = 99; screenOffset = new Vector2(GUIMaster.GetElementRect(element).width / 3f, GUIMaster.GetElementRect(element).height * 2f); GUI.color = new Color(Color.white.r, Color.white.b, Color.white.b, .5f); GUI.DrawTexture(new Rect(Camera.main.WorldToScreenPoint(transform.position).x - screenOffset.x, Screen.height - Camera.main.WorldToScreenPoint(transform.position).y - screenOffset.y, GUIMaster.GetElementRect(element).width, GUIMaster.GetElementRect(element).height), questionManager.GetTexture(activeQuestion.difficulty)); GUI.color = Color.white; }
public void OnGUI() { GUI.depth = depth; if (interactable) { GUI.DrawTexture(GUIMaster.GetElementRect(guiElement), texture); } }
private void OnGUI() { scaledButtonStyle = GUIMaster.ResolutionGUIStyle(buttonStyle); GUI.DrawTexture(GUIMaster.GetElementRect(logoElement), logo); if (GUI.Button(GUIMaster.GetElementRect(level1Button), "Robot Level", scaledButtonStyle)) { Application.LoadLevel("DemoLevel"); } if (GUI.Button(GUIMaster.GetElementRect(level2Button), "Nature Level", scaledButtonStyle)) { Application.LoadLevel("DemoLevel_Nature"); } }
private void OnGUI() { //This defines on which layer the GUI will be drawn. GUI.depth = depth; Rect rect = GUIMaster.GetElementRect(element); GUI.DrawTexture(rect, normalButton); if (rect.Contains(Event.current.mousePosition) && interactable) { GUI.DrawTexture(rect, highlightButton); if (Event.current.type == EventType.mouseUp) { Hierarchy.GetComponentWithTag <SoundSettings>("SoundManager").Play(sound); GUI.DrawTexture(rect, normalButton); Application.LoadLevel(sceneToLoad); } } }
private void OnGUI() { //This defines on which layer the GUI will be drawn. GUI.depth = depth; Rect rect = GUIMaster.GetElementRect(element); GUI.DrawTexture(rect, normalButton); if (rect.Contains(Event.current.mousePosition) && interactable) { GUI.DrawTexture(rect, highlightButton); if (Event.current.type == EventType.mouseUp) { Hierarchy.GetComponentWithTag <SoundSettings>("SoundManager").Play(sound); // Debug.Log("Moo"); GUI.DrawTexture(rect, normalButton); toggleComponent.ToggleInteractable(); toggleComponent.enabled = (!toggleComponent.enabled) ? true : false; } } }
private void OnGUI() { GUI.Label(GUIMaster.GetElementRect(diceTextRect), "You rolled:", scaledTextStyle); GUI.DrawTexture(GUIMaster.GetElementRect(firstDiceRect), currentDiceTexture); GUI.Label(GUIMaster.GetElementRect(jumpsLeftRect), "Jumps left:", scaledTextStyle); if (playerManager.JumpsLeft() > 0 && jumpsLeftDiceTexture != null) { GUI.DrawTexture(GUIMaster.GetElementRect(secondDiceRect), jumpsLeftDiceTexture); } else { GUI.Label(GUIMaster.GetElementRect(secondDiceRect), "None", scaledTextStyle); } if (diceManager.CanRoll()) { GUI.Label(GUIMaster.GetElementRect(messageRect), "Klik hieronder om de dobbelsteen te rollen!", scaledBoxStyle); if (GUI.Button(GUIMaster.GetElementRect(messageButtonRect), "Rol!", scaledBoxStyle)) { playerManager.SetJumps(); } } }
// Update is called once per frame void OnGUI() { scaledTextStyle = GUIMaster.ResolutionGUIStyle(textStyle); scaledButtonStyle = GUIMaster.ResolutionGUIStyle(buttonStyle); if (trigger) { GUI.Label(GUIMaster.GetElementRect(messageRect), "Klik hieronder om een vraag te beandwoorden!", scaledButtonStyle); if (GUI.Button(GUIMaster.GetElementRect(messageButtonRect), "Klik Hier!", scaledButtonStyle)) { started = true; ToggleActive(); StopTrigger(); } } else if (active) { if (backgroundTexture != null) { GUI.DrawTexture(GUIMaster.GetElementRect(backgroundRect), backgroundTexture); } if (started && !answered) { GUI.Label(GUIMaster.GetElementRect(questionRect), questionManager.activeQuestion.questionText, scaledTextStyle); for (int i = 0; i < questionManager.activeQuestion.answers.Count; i++) { if (GUI.Button(GUIMaster.GetElementRect(answerRects[i]), questionManager.activeQuestion.answers[i].answerText, scaledTextStyle)) { if (questionManager.CheckAnswer(i)) { answered = true; correct = true; } else { answered = true; } } } } if (answered && correct) { GUI.Label(GUIMaster.GetElementRect(messageRect), "Goed gedaan, dat was het juiste andwoord!", scaledTextStyle); if (GUI.Button(GUIMaster.GetElementRect(messageButtonRect), "Ga Verder", scaledButtonStyle)) { answered = false; correct = false; active = false; started = false; questionManager.EndQuestion(true); } } else if (answered) { GUI.Label(GUIMaster.GetElementRect(messageRect), "Helaas heb je her verkeerde andwoord gekozen!", scaledTextStyle); if (GUI.Button(GUIMaster.GetElementRect(messageButtonRect), "Ga Verder", scaledButtonStyle)) { answered = false; active = false; started = false; questionManager.EndQuestion(false); } } } }