Beispiel #1
0
    private void Update()
    {
        if (!jump)
        {
            jump = Input.GetKeyDown(KeyCode.Space);
        }

        //if (Input.GetKeyDown(KeyCode.F))
        //{
        //    shoot.Fire();
        //}

        if (Input.GetKeyDown(KeyCode.F))
        {
            if (ourShootType == ShootType.Flare && shoot.allowFire)
            {
                pressStartTime = Time.time;
            }
        }


        if (Input.GetKeyUp(KeyCode.F))
        {
            if (ourShootType == ShootType.Flare && shoot.allowFire)
            {
                if (Time.time - pressStartTime < minChargeTime)
                {
                    shoot.Fire();
                }
                else
                {
                    shoot.ChargeFire();
                }
            }
        }

        // if (Input.GetKeyDown(KeyCode.L))
        // {
        //     shoot.LaserFire();
        // }

        currentMovement.Move(horizontal, vertical, jump);
    }