Advertisement
Guest User

Untitled

a guest
Feb 12th, 2015
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.22 KB | None | 0 0
  1. using UnityEngine;
  2. using System.Collections;
  3.  
  4. public class TimeLeft : AbstractTime
  5. {
  6.     protected override void Awake()
  7.     {
  8.         base.Awake();
  9.     }
  10.     protected override void Start()
  11.     {
  12.         base.Start();
  13.         GameScript.Instance.HasGameStarted = true;
  14.     }
  15.  
  16.     protected override void Update()
  17.     {
  18.         base.Update();
  19.     }
  20.  
  21.     protected override void UpdateTiming()
  22.     {
  23.         this.time -= (this.time > 0.1f ? Time.deltaTime : 0);
  24.  
  25.         if (time > GreenTime)
  26.         {
  27.             this.ChangeColor(Color.green);
  28.         }
  29.         else if (time > YellowTime)
  30.         {
  31.             this.ChangeColor(Color.yellow);
  32.         }
  33.         else if (time > OrangeTime)
  34.         {
  35.             this.ChangeColor(Color.blue);
  36.         }
  37.         else if (time > RedTime)
  38.         {
  39.             this.ChangeColor(Color.red);
  40.         }
  41.         else if (!LoadRunTimeMenuScript.Instance.GamePaused)
  42.         {
  43.             GameOverScript.LoadGameOverScene();
  44.         }
  45.     }
  46.  
  47.     protected override void SetupTimingColours()
  48.     {
  49.         base.GreenTime = time / 1.6f;
  50.         base.YellowTime = time / 2.3f;
  51.         base.OrangeTime = time / 3.33f;
  52.         base.RedTime = 0.1f;
  53.     }
  54. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement