Ejemplo n.º 1
0
    // Update is called once per frame
    void Update()
    {
        if (PauseManager.IsPaused())
        {
            return;
        }

        if (DynamicGameManager.IsGameOver())
        {
            return;
        }

        timeLeft -= Time.deltaTime;
        if (timeLeft < currentCD)
        {
            countdown.Invoke();
            currentCD--;
        }
        if (timeLeft < 0)
        {
            timerOff.Invoke();
            if (timeBar != null)
            {
                timeBar.Set(0f);
            }
        }
        else if (timeBar != null)
        {
            timeBar.Set(timeLeft / maxTime);
        }
    }
    // Use this for initialization
    void Start()
    {
        Timer t = DynamicGameManager.getTimer();

        t.SubscribeCountdown(playEfx);
        source = GetComponent <AudioSource>();
    }
Ejemplo n.º 3
0
 void Awake()
 {
     if (instance == null)
     {
         instance = this;
     }
     timer    = GetComponent <Timer>();
     gameOver = new UnityEvent();
 }
Ejemplo n.º 4
0
 // Use this for initialization
 void Start()
 {
     DynamicGameManager.UpisiSe(this.gameObject);
 }
Ejemplo n.º 5
0
 // Update is called once per frame
 void OnDestroy()
 {
     DynamicGameManager.IspisiSe(this.gameObject);
 }
Ejemplo n.º 6
0
 // Use this for initialization
 void Start()
 {
     transform.gameObject.SetActive(false);
     DynamicGameManager.Subscribe(Show);
 }
Ejemplo n.º 7
0
 void Update()
 {
     text.text = DynamicGameManager.Score().ToString();
 }