Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Roxaia · Mar 11, 2013 at 04:44 AM · guishadertexttextmesh

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 () {

}

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image AlucardJay · Mar 11, 2013 at 04:44 AM 1
Share

Please format your code : http://video.unity3d.com/video/7720450/tutorials-using-unity-answers

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

11 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

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


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges