示例#1
0
    private IEnumerator Jump()
    {
        anim.SetBool("Jump", true);
        StopCoroutine(findPath());
        if (startJump)
        {
            resetTimer();
        }
        startJump = false;
        t         = (Time.time - startTime) / (endTime - startTime);
        time      = Time.time;
        Debug.Log(t);
        Debug.Log("StartPos -" + jumpStartPos);
        Debug.Log("EndPos" + jumpEndPos);
        if (Time.time < endTime)
        {
            transform.position = path.jumpVel(t, jumpStartPos, jumpEndPos, 20) + yDist;
        }
        else
        {
            yield return(null);

            jump = false;
            anim.SetBool("Jump", false);
        }
        yield return(null);
    }