Exemple #1
0
    // Update is called once per frame
    public void Update()
    {
        model.ThrustInput = Input.GetAxis("Vertical");
        model.TurnInput   = Input.GetAxis("Horizontal");

        BulletFire();
        Hyperspace();

        transform.position = _screenHelper.AdjustPositionForScreen(transform.position, model.ScreenTop, model.ScreenRight, model.ScreenBottom, model.ScreenLeft);

        transform.Rotate(Vector3.forward * -model.TurnInput * Time.deltaTime * model.TurnThrust);
    }
Exemple #2
0
    // Update is called once per frame
    void Update()
    {
        if (IsDisabled())
        {
            return;
        }

        float angle = Mathf.Atan2(model.Direction.y, model.Direction.x) * Mathf.Rad2Deg - 90;

        model.RigidBody.MoveRotation(angle);

        transform.position = _screenHelper.AdjustPositionForScreen(transform.position, model.ScreenTop, model.ScreenRight, model.ScreenBottom, model.ScreenLeft);

        FireBullet();
    }
 // Update is called once per frame
 public void Update()
 {
     transform.position = _screenHelper.AdjustPositionForScreen(transform.position, model.ScreenTop, model.ScreenRight, model.ScreenBottom, model.ScreenLeft);
 }