Esempio n. 1
0
    void OnTriggerEnter2D(Collider2D col)
    {
        if (col.gameObject.CompareTag("Shot"))
        {
            int quantity = 0;
            Destroy(col.gameObject);
            enemySpawnController.ChainDestruction(x, y, type, ref quantity);

            uiController.UpdateScore(fib(quantity + 1) * quantity * 10);
            enemySpawnController.KillEnemies(quantity);
            mainCamera.Shake(0.03f * quantity, 0.2f * quantity);

            return;
        }
        if (col.gameObject.CompareTag("L_Limit"))
        {
            enemyMovementController.EnemiesGoDown();
            enemyMovementController.EnemiesGoRight();
            return;
        }

        if (col.gameObject.CompareTag("R_Limit"))
        {
            enemyMovementController.EnemiesGoDown();
            enemyMovementController.EnemiesGoLeft();
            return;
        }
    }