Class GroundedController2D
A physics controller for grounded characters that help implement gravity, slope mechanics, collision for platforms,
and updates the MovementState while using the for custom collision callbacks.
Inheritance
System.Object
GroundedController2D
Assembly: cs.temp.dll.dll
Syntax
public class GroundedController2D : Controller2D
Fields
_character
Declaration
protected CharacterRenderer2D _character
Field Value
_modifiedColliderSize
Declaration
protected Vector2 _modifiedColliderSize
Field Value
_originalColliderSize
Declaration
protected Vector2 _originalColliderSize
Field Value
_previousColliderSize
Declaration
protected Vector2 _previousColliderSize
Field Value
_slopeNormal
Declaration
protected Vector2 _slopeNormal
Field Value
_wasGroundedLastFrame
Declaration
protected bool _wasGroundedLastFrame
Field Value
Type |
Description |
System.Boolean |
|
IsCrouching
Declaration
Field Value
Type |
Description |
System.Boolean |
|
IsFalling
Declaration
Field Value
Type |
Description |
System.Boolean |
|
IsGliding
Declaration
Field Value
Type |
Description |
System.Boolean |
|
IsGrounded
Declaration
Field Value
Type |
Description |
System.Boolean |
|
IsJumping
Declaration
Field Value
Type |
Description |
System.Boolean |
|
IsRunning
Declaration
Field Value
Type |
Description |
System.Boolean |
|
IsSwimming
Declaration
Field Value
Type |
Description |
System.Boolean |
|
Declaration
protected LayerMask MovingPlatformLayer
Field Value
Type |
Description |
LayerMask |
|
Declaration
public ContactFilter2D OneWayPlatformFilter
Field Value
Type |
Description |
ContactFilter2D |
|
OnGrounded
Declaration
Field Value
Properties
IsClimbing
Declaration
public bool IsClimbing { get; set; }
Property Value
Type |
Description |
System.Boolean |
|
OneWayFilterBitMask
Declaration
protected int OneWayFilterBitMask { get; }
Property Value
Type |
Description |
System.Int32 |
|
StandingOnObject
Declaration
public GameObject StandingOnObject { get; protected set; }
Property Value
Type |
Description |
GameObject |
|
Methods
CalculateHorizontal()
Declaration
protected override void CalculateHorizontal()
Overrides
CalculateMovementState()
Calculates the current movement state that the player is currently in.
Declaration
protected override void CalculateMovementState()
Overrides
CalculateVertical()
Declaration
protected override void CalculateVertical()
Overrides
ClimbableSurfaceChecks()
Declaration
protected virtual void ClimbableSurfaceChecks()
ColisionChecks()
Declaration
protected override void ColisionChecks()
Overrides
CorrectCollisionClipping()
If the transform translate puts us through a collider do to an off update frame for movement than correct the transform to prevent overlapping.
Declaration
protected override void CorrectCollisionClipping()
Overrides
GroundChecks()
Declaration
protected override void GroundChecks()
Overrides
Move()
Declaration
protected override void Move()
Overrides
OnAwake()
Declaration
protected override void OnAwake()
Overrides
ResetColliderSize()
Declaration
public void ResetColliderSize()
ResetPhysics(MovementProperties)
Declaration
public override void ResetPhysics(MovementProperties movementProperties)
Parameters
Type |
Name |
Description |
MovementProperties |
movementProperties |
|
Overrides
ResizeCollider(Vector2)
Declaration
public virtual void ResizeCollider(Vector2 newSize)
Parameters
Type |
Name |
Description |
Vector2 |
newSize |
|
SideCollisionChecks()
Declaration
protected override void SideCollisionChecks()
Overrides
SlopeChecks()
Declaration
public virtual void SlopeChecks()
UpdatePhysics(MovementProperties, PhysicsVolumeType)
Declaration
public override void UpdatePhysics(MovementProperties movementProperties, PhysicsVolumeType volumeType = null)
Parameters
Type |
Name |
Description |
MovementProperties |
movementProperties |
|
PhysicsVolumeType |
volumeType |
|
Overrides