示例#1
0
    private void UpdateRightHand()
    {
        if (targetRightHand == LimbState.Up)
        {
            currentRightHand += Time.deltaTime * speed;
            if (currentRightHand > lastRightHand + rungDistance)
            {
                currentRightHand = lastRightHand + rungDistance;
                lastRightHand    = currentRightHand;
                targetRightHand  = LimbState.Stationary;
            }
        }
        else if (targetRightHand == LimbState.Down)
        {
            currentRightHand -= Time.deltaTime * speed;
            if (currentRightHand < lastRightHand - rungDistance)
            {
                currentRightHand = lastRightHand - rungDistance;
                lastRightHand    = currentRightHand;
                targetRightHand  = LimbState.Stationary;
            }
        }

        Vector3 rightHandPosition = RightHand.transform.position;

        rightHandPosition.y          = currentRightHand;
        RightHand.transform.position = rightHandPosition;
    }
示例#2
0
    // Use this for initialization
    void Start()
    {
        LeftFoot  = GameObject.Find("Left Foot Logic");
        LeftHand  = GameObject.Find("Left Hand Logic");
        RightFoot = GameObject.Find("Right Foot Logic");
        RightHand = GameObject.Find("Right Hand Logic");

        rungDistance = 0.3f;
        speed        = 0.5f;

        lastLeftFoot  = currentLeftFoot = 0.0f * rungDistance;
        lastLeftHand  = currentLeftHand = 4.0f * rungDistance;
        lastRightFoot = currentRightFoot = 0.0f * rungDistance;
        lastRightHand = currentRightHand = 4.0f * rungDistance;

        targetLeftFoot  = LimbState.Stationary;
        targetLeftHand  = LimbState.Stationary;
        targetRightFoot = LimbState.Stationary;
        targetRightHand = LimbState.Stationary;

        falling      = false;
        fallVelocity = 0.0f;

        taskCompleted = false;
    }
示例#3
0
    private void UpdateRightFoot()
    {
        if (targetRightFoot == LimbState.Up)
        {
            currentRightFoot += Time.deltaTime * speed;
            if (currentRightFoot > lastRightFoot + rungDistance)
            {
                currentRightFoot = lastRightFoot + rungDistance;
                lastRightFoot    = currentRightFoot;
                targetRightFoot  = LimbState.Stationary;
            }
        }
        else if (targetRightFoot == LimbState.Down)
        {
            currentRightFoot -= Time.deltaTime * speed;
            if (currentRightFoot < lastRightFoot - rungDistance)
            {
                currentRightFoot = lastRightFoot - rungDistance;
                lastRightFoot    = currentRightFoot;
                targetRightFoot  = LimbState.Stationary;
            }
        }

        Vector3 rightFootPosition = RightFoot.transform.position;

        rightFootPosition.y          = currentRightFoot;
        RightFoot.transform.position = rightFootPosition;
    }
示例#4
0
    private void UpdateLeftFoot()
    {
        if (!falling)
        {
            if (targetLeftFoot == LimbState.Up)
            {
                currentLeftFoot += Time.deltaTime * speed;
                if (currentLeftFoot > lastLeftFoot + rungDistance)
                {
                    currentLeftFoot = lastLeftFoot + rungDistance;
                    lastLeftFoot    = currentLeftFoot;
                    targetLeftFoot  = LimbState.Stationary;
                }
            }
            else if (targetLeftFoot == LimbState.Down)
            {
                currentLeftFoot -= Time.deltaTime * speed;
                if (currentLeftFoot < lastLeftFoot - rungDistance)
                {
                    currentLeftFoot = lastLeftFoot - rungDistance;
                    lastLeftFoot    = currentLeftFoot;
                    targetLeftFoot  = LimbState.Stationary;
                }
            }

            Vector3 leftFootPosition = LeftFoot.transform.position;
            leftFootPosition.y          = currentLeftFoot;
            LeftFoot.transform.position = leftFootPosition;
        }
    }
示例#5
0
 public void RightHandDown()
 {
     targetRightHand = LimbState.Down;
 }
示例#6
0
 public void RightHandUp()
 {
     targetRightHand = LimbState.Up;
 }
示例#7
0
 public void RightFootDown()
 {
     targetRightFoot = LimbState.Down;
 }
示例#8
0
 public void RightFootUp()
 {
     targetRightFoot = LimbState.Up;
 }
示例#9
0
 public void LeftHandDown()
 {
     targetLeftHand = LimbState.Down;
 }
示例#10
0
 public void LeftHandUp()
 {
     targetLeftHand = LimbState.Up;
 }
示例#11
0
 public void LeftFootDown()
 {
     targetLeftFoot = LimbState.Down;
 }
示例#12
0
 public void LeftFootUp()
 {
     targetLeftFoot = LimbState.Up;
 }
示例#13
0
 ///<exclude/>
 public bool Equals(LimbState other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other._Tm.Equals(_Tm) && other._OapMatrix.Equals(_OapMatrix) && other._Status.Equals(_Status);
 }