示例#1
0
 public void StopSpawnAndDestroyEnemies()
 {
     Debug.Log("Stop spawn enemies");
     spawnTimer.Stop(100);
     for (int i = transform.childCount - 1; i >= 0; i--)
     {
         GameObject child = transform.GetChild(i).gameObject;
         if (child.CompareTag("Ship"))
         {
             Destroy(child);
         }
     }
 }
示例#2
0
    void ShowEnding(string text, Action onComplete)
    {
        if (!isShowingEndingUI)
        {
            roundTimer.Stop(17);
            endingText.text       = text;
            playerShip.allowInput = false;
            RezTween.To(endingOverlay, 0.5f, "alpha:1").OnComplete = () =>
            {
                playerShip.transform.position = Vector2.zero;
                enemyManager.StopSpawnAndDestroyEnemies();
                BulletManager.Instance.ClearBullets();
                UICanvas.SetActive(false);

                RezTween.To(endingOverlay, 0.5f, "alpha:0", RezTweenOptions.Delay(2f)).OnStart = onComplete;
            };

            isShowingEndingUI = true;
        }
    }
示例#3
0
 private void OnDestroy()
 {
     timer?.Stop(10);
 }