Beispiel #1
0
    public IEnumerator JumpCoroutine(int index)
    {
        float        timeCount = 0;
        JumpProperty p         = jumpProperties[index];

        jumpStatus[index] = true;
        if (jumpEvent != null)
        {
            jumpEvent.Invoke();
        }
        while (timeCount < p.jumpTime && Input.GetButton("Jump"))
        {
            Velocity = VectorUtils.ChangeY(Velocity, p.jumpSpeed);
            yield return(new WaitForFixedUpdate());

            timeCount += Time.fixedDeltaTime;
        }
        jumpStatus[index] = false;
        yield break;
    }