/// toggles if the RigidBody2D methods should be used for movement or if Transform.Translate will be used. All the usual Unity rules for physics based movement apply when true
/// such as getting your input in Update and only calling move in FixedUpdate amonst others.
/// </summary>
publicboolusePhysicsForMovement=false;
[SerializeField]
[Range(0.001f,0.3f)]
privatefloat_skinWidth=0.02f;
/// <summary>
/// defines how far in from the edges of the collider rays are cast from. If cast with a 0 extent it will often result in ray hits that are
/// not desired (for example a foot collider casting horizontally from directly on the surface can result in a hit)
/// </summary>
publicfloatskinWidth
{
get{return_skinWidth;}
set
{
_skinWidth=value;
recalculateDistanceBetweenRays();
}
}
/// <summary>
/// mask with all layers that the player should interact with
/// </summary>
publicLayerMaskplatformMask=0;
/// <summary>
/// mask with all layers that trigger events should fire when intersected
/// </summary>
publicLayerMasktriggerMask=0;
/// <summary>
/// mask with all layers that should act as one-way platforms. Note that one-way platforms should always be EdgeCollider2Ds. This is private because it does not support being
/// updated anytime outside of the inspector for now.
/// </summary>
[SerializeField]
privateLayerMaskoneWayPlatformMask=0;
/// <summary>
/// the max slope angle that the CC2D can climb
/// </summary>
/// <value>The slope limit.</value>
[Range(0,90f)]
publicfloatslopeLimit=30f;
/// <summary>
/// the threshold in the change in vertical movement between frames that constitutes jumping
/// </summary>
/// <value>The jumping threshold.</value>
publicfloatjumpingThreshold=0.07f;
/// <summary>
/// curve for multiplying speed based on slope (negative = down slope and positive = up slope)
/// this should be called anytime you have to modify the BoxCollider2D at runtime. It will recalculate the distance between the rays used for collision detection.
/// It is also used in the skinWidth setter in case it is changed at runtime.
/// </summary>
publicvoidrecalculateDistanceBetweenRays()
{
// figure out the distance between our rays in both directions