Exemple #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;
    }
Exemple #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;
    }
Exemple #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;
    }
Exemple #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;
        }
    }
Exemple #5
0
 public void RightHandDown()
 {
     targetRightHand = LimbState.Down;
 }
Exemple #6
0
 public void RightHandUp()
 {
     targetRightHand = LimbState.Up;
 }
Exemple #7
0
 public void RightFootDown()
 {
     targetRightFoot = LimbState.Down;
 }
Exemple #8
0
 public void RightFootUp()
 {
     targetRightFoot = LimbState.Up;
 }
Exemple #9
0
 public void LeftHandDown()
 {
     targetLeftHand = LimbState.Down;
 }
Exemple #10
0
 public void LeftHandUp()
 {
     targetLeftHand = LimbState.Up;
 }
Exemple #11
0
 public void LeftFootDown()
 {
     targetLeftFoot = LimbState.Down;
 }
Exemple #12
0
 public void LeftFootUp()
 {
     targetLeftFoot = LimbState.Up;
 }
 ///<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);
 }