Exemplo n.º 1
0
        public void HandleWheel(InputBase input)
        {
            if (wheelCol)
            {
                //out stores output at this variable
                wheelCol.GetWorldPose(out worldPos, out worldRot);
                if (wheelGraphic)
                {
                    wheelGraphic.rotation = worldRot;
                    wheelGraphic.position = worldPos;
                }

                /*
                 * if (isBraking) {
                 *  if (input.Brake > 0.1f) {
                 *      finalBrakeForce = Mathf.Lerp(finalBrakeForce, input.Brake * brakePower, Time.deltaTime);
                 *      wheelCol.brakeTorque = finalBrakeForce;
                 *  }
                 *  else {
                 *      wheelCol.brakeTorque = 0f;
                 *  }
                 * }
                 *
                 * if (isSteering) {
                 *  finalSteerAngle = Mathf.Lerp(finalSteerAngle, -input.Yaw * steerAngle, Time.deltaTime * steerSmoothSpeed);
                 *  wheelCol.steerAngle = finalSteerAngle;
                 * }*/
            }
        }
Exemplo n.º 2
0
 private void OnEnable()
 {
     targetInput = (InputBase)target;
 }