예제 #1
0
 public override void FixedUpdate(float fixedDeltaTime)
 {
     if (CurrentState == State.IsMoving)
     {
         CharacterTransform.Translate(moveDirection * MoveSpeed);
         CharacterTransform.position = new Vector3(Mathf.Clamp(CharacterTransform.position.x, minX, maxX),
                                                   CharacterTransform.position.y, Mathf.Clamp(CharacterTransform.position.z, minZ, maxZ));
     }
 }
예제 #2
0
    protected new void Update()
    {
        base.Update();

        CharacterTransform.Translate(direction * moveSpeed * Time.deltaTime, Space.World);

        jumpCtrl();
        handCtrl();
        shoulderCtrl();
    }
예제 #3
0
 protected void jumpCtrl()
 {
     if (isJumping)
     {
         //Debug.Log(speedUp);
         speedUp -= grav * Time.deltaTime;
         //Debug.Log("im jumping");
         if (CharacterTransform.transform.position.y < initPosY)
         {
             isJumping = false;
             speedUp   = Vector3.zero;
             CharacterTransform.Translate(new Vector3(CharacterTransform.position.x, initPosY, CharacterTransform.position.z)
                                          - CharacterTransform.position, Space.World);
         }
     }
 }