Exemplo n.º 1
0
    // 시간에 상관없이 해당 버프 취소
    // 버프 효과 해제, 디버프 효과 해제에 이용 가능
    public void CancelBuff(int registeredNum)
    {
        var cancel = FindByRegisterNumber(registeredNum);

        if (cancel == null)
        {
            return;
        }

        cancel.Value.endCallback(cancel.Value.data.currentStack);
        TimerEnd?.Invoke(cancel.Value.key);
        observeList.Remove(cancel);
    }
Exemplo n.º 2
0
    // Update is called once per frame
    void Update()
    {
        if (gameStart)
        {
            if (seconds == increaseFreq && !freqCD)
            {
                // every X seconds, decrease the spawn delay
                enemySpawner.SetSpawnDelay(0.5f, 0.75f);
                Debug.Log("increasing spawn freq " + seconds);
                freqCD = true;
            }

            if (freqCD)
            {
                if (freqTimer < freqCooldown)
                {
                    freqTimer += Time.deltaTime;
                }
                else if (freqTimer >= freqCooldown)
                {
                    freqTimer = 0f;
                    freqCD    = false;
                }
            }

            if (timer < maxGameTime)
            {
                timer += Time.deltaTime;
                //minutes = Mathf.FloorToInt(timer / 60);
                seconds = Mathf.FloorToInt(timer % 60);
            }
            else if (timer >= maxGameTime)
            {
                // event added from Enemy.cs
                gameWon = true;
                TimerEnd?.Invoke();
                gameStart = false;
                enemySpawner.StopEnemySpawn();
            }
        }

        if (gameWon && !PlayerManager.death)
        {
            endText.SetActive(true);
            enemiesKilled.text  = Enemy.enemiesDead.ToString();
            enemiesKilled2.text = Enemy.enemiesDead.ToString();
            gameWon             = false;
        }
    }
Exemplo n.º 3
0
 protected override void TimerHandler(object sender, EventArgs e)
 {
     if (Timering != null)
     {
         Timering.Invoke(this);
     }
     if (_time == DateTime.Now)
     {
         if (TimerEnd != null)
         {
             TimerEnd.Invoke(this);
         }
         Close();
     }
 }