コード例 #1
0
 // Use this for initialization
 void Start()
 {
     globalObj = GameObject.FindGameObjectWithTag("globalObj");
     globalObjCode = globalObj.GetComponent<StartEndStuff> ();
     score = globalObjCode.GetScore ();
     time = globalObjCode.GetTime ();
     if (time < 0) {
         time =0;}// I was getting weird negative outputs
     wonGame = globalObjCode.GetWon ();
     if (wonGame) {
         wonTxt.text = "You Won!";
     } else {
         wonTxt.text = "You Lost!";
     }
     scoreTxt.text = "Score: " + score;
     timeTxt.text = "Time Left: " + time;
 }