Property | Type | Description | |
---|---|---|---|
ignoreOneWayPlatformsThisFrame | bool | ||
jumpingThreshold | float | ||
platformMask | |||
slopeSpeedMultiplier | |||
triggerMask |
Method | Description | |
---|---|---|
OnTriggerEnter2D ( |
||
OnTriggerExit2D ( |
||
OnTriggerStay2D ( |
||
move ( Vector3 deltaMovement ) : void |
attempts to move the character to position + deltaMovement. Any colliders in the way will cause the movement to stop when run into.
|
|
recalculateDistanceBetweenRays ( ) : void |
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.
|
|
warpToGrounded ( ) : void |
moves directly down until grounded
|
Method | Description | |
---|---|---|
Awake ( ) : void | ||
DrawRay ( Vector3 start, Vector3 dir, Color color ) : void | ||
handleHorizontalSlope ( Vector3 &deltaMovement, float angle ) : bool |
handles adjusting deltaMovement if we are going up a slope.
|
|
handleVerticalSlope ( Vector3 &deltaMovement ) : void |
checks the center point under the BoxCollider2D for a slope. If it finds one then the deltaMovement is adjusted so that the player stays grounded and the slopeSpeedModifier is taken into account to speed up movement.
|
|
moveHorizontally ( Vector3 &deltaMovement ) : void |
we have to use a bit of trickery in this one. The rays must be cast from a small distance inside of our collider (skinWidth) to avoid zero distance rays which will get the wrong normal. Because of this small offset we have to increase the ray distance skinWidth then remember to remove skinWidth from deltaMovement before actually moving the player
|
|
moveVertically ( Vector3 &deltaMovement ) : void | ||
primeRaycastOrigins ( ) : void |
resets the raycastOrigins to the current extents of the box collider inset by the skinWidth. It is inset to avoid casting a ray from a position directly touching another collider which results in wonky normal data.
|
public OnTriggerEnter2D ( |
||
col | ||
return | void |
public OnTriggerExit2D ( |
||
col | ||
return | void |
public OnTriggerStay2D ( |
||
col | ||
return | void |
public move ( Vector3 deltaMovement ) : void | ||
deltaMovement | Vector3 | Delta movement. |
return | void |
public recalculateDistanceBetweenRays ( ) : void | ||
return | void |
public bool ignoreOneWayPlatformsThisFrame | ||
return | bool |
public AnimationCurve,UnityEngine slopeSpeedMultiplier | ||
return |