Пример #1
0
 public void Rotation()
 {
     cHorizontal           += playerControls.GetAxis("CamHorizontal") * ((invertHorizontal)?RotationSpeed:-RotationSpeed);
     cVertical             += playerControls.GetAxis("CamVertical") * ((invertVertical) ? -RotationSpeed : RotationSpeed);
     cVertical              = Mathf.Clamp(cVertical, minXAngle, maxXAngle);
     cameraRotator.position = Target.position;
     TriToolHub.CreateVector3(cVertical, cHorizontal, 1, TriToolHub.AxisPlane.XY, Target.gameObject, out rotationVector);
     //rotationVector.x = Mathf.Clamp(rotationVector.x, minXAngle, maxXAngle);
     //TriToolHub.Rotate(cameraRotator.gameObject, rotationVector, true, Space.World);
     rotationVector.z = 0;
     TriToolHub.SetRotation(cameraRotator.gameObject, rotationVector, Space.Self);
 }
Пример #2
0
    public void Movement()
    {
        TriToolHub.CreateVector3(horizontalAxis, verticalAxis, Speed / 10, TriToolHub.AxisPlane.XZ, (inCombat) ? gameObject : cameraObject, out mVector);
        mVector = Vector3.ClampMagnitude(mVector, Speed / 10);
        if (CurrentState == PState.Jumping)
        {
            YVelocity = Mathf.Lerp(YVelocity, JumpForce, Time.deltaTime * velocityChangeSpeed);
            mVector.y = YVelocity;
        }
        if (CurrentState == PState.Falling)
        {
            YVelocity = Mathf.Lerp(YVelocity, Gravity, Time.deltaTime * velocityChangeSpeed);
            mVector.y = YVelocity;
        }

        //TriToolHub.AddForce(gameObject, MovementVector, Space.World, ForceMode.Force);
        CharacterController.Move(mVector);
        P_AnimationHandler.SurveyorWheel();
    }