예제 #1
0
    private void Update()
    {
        if (this.engines != null)
        {
            float horizontalSpeedPercent = Input.GetAxis("Horizontal");
            float verticalSpeedPercent   = Input.GetAxis("Vertical");

            this.engines.SetSpeed(new Vector2(horizontalSpeedPercent, verticalSpeedPercent));
        }

        if (this.bulletGuns != null)
        {
            for (int index = 0; index < this.bulletGuns.Length; index++)
            {
                BulletGun bulletGun = this.bulletGuns[index];

                if (Input.GetAxis("Fire") > 0f)
                {
                    bulletGun.TryToFire();
                }
            }
        }

        if (this.playerAvatar != null)
        {
            if (Input.GetAxis("SwitchWeapon") > 0f)
            {
                this.playerAvatar.SwitchToNextWeapon();
            }
        }
    }
예제 #2
0
    private void Update()
    {
        if (this.engines != null)
        {
            this.engines.SetSpeed(new Vector2(-1f, 0f));
        }

        if (this.bulletGuns != null)
        {
            for (int index = 0; index < this.bulletGuns.Length; index++)
            {
                BulletGun bulletGun = this.bulletGuns[index];

                // Fire all the time !
                bulletGun.TryToFire();
            }
        }
    }