Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by KnightRiderGuy · Dec 13, 2015 at 04:02 PM · c#uitextupdatemessage

Message Centre Does Not Display

@BackslashOllie I had updated the code but now the message centre main time of day greeting does not display?

 using UnityEngine;
 using System.Collections;
 using UnityEngine.UI;
 
 public class MessageCentreManager : MonoBehaviour {
 
     int sysHour = System.DateTime.Now.Hour; //gives you the current hour as an integer.
 
     //UI Text Reference
     public Text MessageCentreText;
     
     //Button States
     public int buttonState = 0;
     bool GreetUser = true;
 
     void Awake ()
     {
 
     }
     
     void Update () 
     {     
         if (GreetUser) ShowGreeting();
         if (buttonState == 1) MessageCentreText.text = "SCANNING";
         else if (buttonState == 2) MessageCentreText.text = "AUTO PHONE";
         else if (buttonState == 3)  MessageCentreText.text = "INT TEMP";
         else if (buttonState == 4) MessageCentreText.text = "LASER FIRE";
         else if (buttonState == 5) MessageCentreText.text = "TURBO MODE";
         else if (buttonState == 6) MessageCentreText.text = "OIL SLICK";
         else if (buttonState == 7) MessageCentreText.text = "AUTO SCAN";
         else if (buttonState == 8) MessageCentreText.text = "TRIP TIME";
         else if (buttonState == 9) MessageCentreText.text = "RADAR";
         else if (buttonState == 10) MessageCentreText.text = "CNTDWN TIMER";
         else if (buttonState == 11) MessageCentreText.text = "EXT MOVIE PLAYER";
         else if (buttonState == 12) MessageCentreText.text = "GRAPL HOOK LAUNCH";
         else if (buttonState == 13) MessageCentreText.text = "AUTO DOOR LFT";
         else if (buttonState == 14) MessageCentreText.text = "AUTO DOOR RHT";
         else if (buttonState == 15) MessageCentreText.text = "PENG";
         else if (buttonState == 16) MessageCentreText.text = "7DLA";
         else if (buttonState == 17) MessageCentreText.text = "6RM";
     }
 
     IEnumerator ShowGreeting()
     //void ShowGreeting ()
     {
         //Time OF Day Notification
         //Morning Time
         if (sysHour >= 01 && sysHour <= 12) {
             MessageCentreText.text = "GOOD MORNING";
             Debug.Log ("Good Morning!");
         }
         //Noon Time
         if (sysHour >= 12 && sysHour <= 18) {
             MessageCentreText.text = "GOOD AFTERNOON";
             Debug.Log ("Good Afternoon!");
         } 
         //Night Time
         if (sysHour >= 18 && sysHour <= 24) {
             MessageCentreText.text = "GOOD EVENING";
             Debug.Log ("Good Evening!");
         }
         
         else{
             //Do something if desired
             MessageCentreText.text = "KNIGHT INDUSTRIES 2000";
             Debug.Log("KNIGHT INDUSTRIES 2000");
         }
         yield return new WaitForSeconds(5); //Wait 5 seconds
         GreetUser = false;
     }
     
     
     //Scanner Button For Message
     public void GoScannerMessage()
     {
         buttonState = 1;
     }
 
     //Car Phone Button For Message
     public void GoAutoPhoneMessage()
     {
         buttonState = 2;
     }
 
     //Temperature Button For Message
     public void GoTemperatureMessage()
     {
         buttonState = 3;
     }
 
     //Laser Button For Message
     public void GoLaserMessage()
     {
         buttonState = 4;
     }
 
     //Turbo Boost Button For Message
     public void GoTurboBoostMessage()
     {
         buttonState = 5;
     }
 
     //Oil Slick Button For Message
     public void GoOilSlickMessage()
     {
         buttonState = 6;
     }
 
     //Surveillance Mode Button For Message
     public void GoSurveillanceModeMessage()
     {
         buttonState = 7;
     }
 
     //Trip Timere Button For Message
     public void GoTripTimerMessage()
     {
         buttonState = 8;
     }
 
     //Radar Button For Message
     public void GoRadarMessage()
     {
         buttonState = 9;
     }
 
     //Countdown Timer Button For Message
     public void GoCountdownTimerMessage()
     {
         buttonState = 10;
     }
 
     //Movie Player Button For Message
     public void GoMoviePlayerMessage()
     {
         buttonState = 11;
     }
 
     //Grappling Hook Button For Message
     public void GoGrapplingHookMessage()
     {
         buttonState = 12;
     }
 
     //Auto Door Left Button For Message
     public void GoAutoDoorLeftMessage()
     {
         buttonState = 13;
     }
 
     //Auto Door Right Button For Message
     public void GoAutoDoorRightMessage()
     {
         buttonState = 14;
     }
 
     //PENG Button For Message
     public void GoPENGButtonMessage()
     {
         buttonState = 15;
     }
 
     //7DLA Button For Message
     public void Go7DLAButtonMessage()
     {
         buttonState = 16;
     }
 
     //6RM Button For Message
     public void Go6RMButtonMessage()
     {
         buttonState = 17;
     }
 
 }
 

Comment
Add comment
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

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

45 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 avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Using PlayerPrefs to store string but it won't update on my UI 1 Answer

3d Text update. How its work? 1 Answer

Text Objects do Lerp 0 Answers

Need Help With Arduino Code to Unity 0 Answers

[HELP] To show wave number on a zombie survival game. 0 Answers


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