- Home /
I am having issues with my textmesh shader
I need help. I updated my GUI code and now it keeps telling me I have a compiler error but all I see is a message saying there are no normals set on my text mesh. How do I fix this, I dont know where to find the shader I need to fix, or how to change the text mesh to calculate normals. Help would be greatly appreciated. Here is my code in case.
var hungerStyle: GUIStyle; var hungerGood: Texture2D; var hungerOK: Texture2D; var hungerBad: Texture2D; static var hunger: int = 0; var levelLength: int= 120; var gameOver = false; var youWin = false; var youLose = false;
function OnGUI() { GUI.BeginGroup (Rect (Screen.width / 2, Screen.height-20, Screen.width,20)); if(gameOver) { GUI.Box (Rect (0,0,250,70), "Game Over" ); GUI.Label (Rect (15,15,250,70),"You Scored " + PlayerPrefs.GetInt("LastScore")); if(GUI.Button (Rect (75,30,100,30), "Play Again")) { Application.LoadLevel("pop2"); }
} if(youWin) { GUI.Box (Rect (0,0,250,70), "Player One Wins" ); if(GUI.Button (Rect (75,30,100,30), "Play Again")) { Application.LoadLevel("pop2"); } }
if(youLose)
{ GUI.Box (Rect (0,0,250,70), "Player Two Wins");
if(GUI.Button (Rect (75,30,100,30), "Play Again"))
{
Application.LoadLevel("pop2");
}}
else
{
GUI.Box (Rect (0,0,250,70), "Hunger");
GUI.Label (Rect (0,10,250,70),hunger.ToString(),hungerStyle);
if(hunger > 75)
GUI.Box (Rect (80,0,250,70),hungerGood);
if(hunger > 35)
GUI.Box (Rect (80,0,250,70),hungerOK);
else
GUI.Box (Rect (80,0,250,70),hungerBad);
}
GUI.EndGroup ();
}
// function OnTriggerEnter (collision: Collider) //{ if(gameOver) { // } //
// else {
// if(collision.gameObject.tag == "GameController") // { // score++; // Destroy(collision.gameObject); //
//// score: // PlayerPrefs.SetInt("LastScore",score); //
// } } //
//}
function Update() { if(Time.timeSinceLevelLoad > levelLength) { gameOver = true; } }
if(hunger > 100)
{
youWin = true;
}
if(hunger < 0)
{
youLose = true;
}
function Start () {
}
Please format your code : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers
Your answer
Follow this Question
Related Questions
Can't drag text from hierarchy with TextMeshPro 0 Answers
GUI text font change 3 Answers
Limit on GUI Components? 0 Answers
Using "fonts" that are actually images for a multi-outline effect. 2 Answers
Dialouge text. 1 Answer