Beispiel #1
0
    private void FixedUpdate()
    {
        if (!GameManager.s_instance.IsGameStart())
        {
            return;
        }
        if (GameManager.s_instance.IsGameEnd())
        {
            return;
        }

        movement.CheckMove();

        FaceDirType dir = movement.CheckFaceDir();

        int x, y;

        movement.GetArrayPos(out x, out y);

        Vector3 aimPos = aim.SetAimPos(dir, x, y);

        weapon.CoolDownUpdate(Time.deltaTime);

        if (weapon.IsFire())
        {
            int type = weapon.GetFireType();
            switch (type)
            {
            case 0:
                break;

            case 1:
                weapon.Fire1(dir, x, y, m_otherPlayer);
                break;

            case 2:
                weapon.Fire2(dir, x, y, m_otherPlayer, aimPos);
                break;

            default:
                break;
            }
        }

        if (weapon.CanReload() &&
            !weapon.IsAmmoMax() &&
            weapon.IsReloading())
        {
            reloadCoolDown.Show();
            weapon.ReloadCoolDownUpdate(Time.deltaTime);
        }
        else
        {
            weapon.ResetReloadCoolDown();
            reloadCoolDown.Hide();
        }
    }