Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using UnityEngine;
- using System.Collections;
- public class BlackScreenGameTime : TimeLeft
- {
- private bool hasBlackScreenBeenActivated;
- protected override void Awake()
- {
- base.Awake();
- }
- protected override void Start()
- {
- base.Start();
- StartCoroutine(this.StartGame());
- }
- protected override void Update()
- {
- base.Update();
- }
- private IEnumerator StartGame()
- {
- GameScript.Instance.HasGameStarted = false;
- while (!GameScript.Instance.HasGameStarted)
- {
- if (!hasBlackScreenBeenActivated && GameIntroScript.HasIntroBeenShown)
- {
- BlackScreenManager.Instance.gameObject.SetActive(true);
- hasBlackScreenBeenActivated = true;
- }
- else if (BlackScreenManager.Instance.IsTotallyBlack)
- {
- BlackScreenManager.Instance.Deactivate();
- GameScript.Instance.HasGameStarted = true;
- GameScript.Instance.CurrentGame.SendMessage("GenerateNew", SendMessageOptions.RequireReceiver);
- //BrainGameScript.Instance.GenerateNew();
- }
- yield return null;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement