Exemple #1
0
    IEnumerator Launch()
    {
        yield return(new WaitWhile(() => currState == State.Lifting));

        currentBall.Launch(launchVector.up, InstantaneousVelocity());
        ballsLaunched++;
        //yield return new WaitForSeconds(0.5f);
        activeCoroutine = null;
    }
Exemple #2
0
        protected override void LaunchProjectile(Enemy enemy)
        {
            CannonBall projectile = Instantiate(_projectile, transform.position, Quaternion.identity).GetComponent <CannonBall>();

            // Update stats
            projectile.Speed  = CurrentLevelInfo.projectileSpeed;
            projectile.Damage = CurrentLevelInfo.projectileDamage;

            projectile.Launch(enemy);
        }
Exemple #3
0
    private void Shoot()
    {
        m_animator.SetTrigger("Shoot");
        shotFX.Play();

        GameObject bulletObject = pool.Get();

        bulletObject.transform.position = transform.position;
        bulletObject.SetActive(true);

        CannonBall bulletScript = bulletObject.GetComponent <CannonBall>();

        bulletScript.Launch(RaposUtil.RotateVector(Vector2.up, transform.rotation.eulerAngles.z) * bulletSpeed);
    }