Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class TimeLeft : AbstractTime
- {
- protected override void Awake()
- {
- base.Awake();
- }
- protected override void Start()
- {
- base.Start();
- GameScript.Instance.HasGameStarted = true;
- }
- protected override void Update()
- {
- base.Update();
- }
- protected override void UpdateTiming()
- {
- this.time -= (this.time > 0.1f ? Time.deltaTime : 0);
- if (time > GreenTime)
- {
- this.ChangeColor(Color.green);
- }
- else if (time > YellowTime)
- {
- this.ChangeColor(Color.yellow);
- }
- else if (time > OrangeTime)
- {
- this.ChangeColor(Color.blue);
- }
- else if (time > RedTime)
- {
- this.ChangeColor(Color.red);
- }
- else if (!LoadRunTimeMenuScript.Instance.GamePaused)
- {
- GameOverScript.LoadGameOverScene();
- }
- }
- protected override void SetupTimingColours()
- {
- base.GreenTime = time / 1.6f;
- base.YellowTime = time / 2.3f;
- base.OrangeTime = time / 3.33f;
- base.RedTime = 0.1f;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement