Ejemplo n.º 1
0
    protected override IEnumerator Action()
    {
        yield return(new WaitForSecondsRealtime(
                         character.CharacterAnimator.GetCurrentAnimatorStateInfo(0).length + delayAfterAnimationIsFinished
                         ));

        actualBullet = PoolsManager.GetObjectFromPools(bulletPrefab).GetComponent <Bullet>();
        actualBullet.gameObject.SetActive(true);

        if (target != null)
        {
            RotateActualBulleTowardsDirection(GetTargetDirection());
        }
        else
        {
            RotateActualBulleTowardsDirection(GetTargetDirection(lastTargetPosition));
        }

        actualBullet.Launch(launchForce);
        actualBullet = null;

        PlaySfx();

        yield break;
    }
Ejemplo n.º 2
0
 private void CreateCurrentBullet()
 {
     if (Time.timeSinceLevelLoad > lastShoot + cooldown && actualBullet == null)
     {
         actualBullet = PoolsManager.GetObjectFromPools(bulletPrefab).GetComponent <SpookyBullet>();
         actualBullet.transform.position = shootPoint.position;
     }
 }
Ejemplo n.º 3
0
    private void SpawnEnemy(string _enemyID)
    {
        Character tempEnemy = null;

        switch (_enemyID)
        {
        case "Stealer":
            tempEnemy = PoolsManager.GetObjectFromPools(enemiesPrefabs[0]).GetComponent <Character>();
            break;

        case "Attacker":
            tempEnemy = PoolsManager.GetObjectFromPools(enemiesPrefabs[1]).GetComponent <Character>();
            break;

        default:
            break;
        }
        tempEnemy.transform.position = LevelManager.Instance.GetRandomSpawnPoint().position;

        return;
    }