Esempio n. 1
0
    void Move(Vector2 dir)
    {
        spaceship.SetDirection(dir);

        spaceship.transform.position =
            boundaryProvider.GetClosest(spaceship.transform.position);
    }
Esempio n. 2
0
    private IEnumerator MakeManeuver()
    {
        Vector3 vel = spaceship.GetVelocity();

        weapon.Shoot();
        yield return(new WaitForSeconds(0.1f));

        Vector3 target =
            boundaryProvider.GetClosest((spaceship.transform.position + spaceship.transform.forward.normalized * 6f) +
                                        spaceship.transform.right.normalized * Random.Range(-5, 5));

        yield return(spaceship.MoveToTarget(target));

        spaceship.SetVelocity(vel);
    }