Corgi Engine  v8.8
MoreMountains.CorgiEngine.CorgiController Class Reference

The character controller that handles the character's gravity and collisions. It requires a Collider2D and a rigidbody to function. More...

Inheritance diagram for MoreMountains.CorgiEngine.CorgiController:
MoreMountains.CorgiEngine.CorgiMonoBehaviour

Public Types

enum  UpdateModes { UpdateModes.Update, UpdateModes.FixedUpdate }
 the possible modes this controller can update on More...
 
enum  RaycastDirections { RaycastDirections.up, RaycastDirections.down, RaycastDirections.left, RaycastDirections.right }
 the possible directions a ray can be cast More...
 
enum  DetachmentMethods { DetachmentMethods.Layer, DetachmentMethods.Object, DetachmentMethods.LayerChange }
 The possible ways a character can detach from a oneway or moving platform. More...
 

Public Member Functions

virtual float Width ()
 Returns the character's bounds width More...
 
virtual float Height ()
 Returns the character's bounds height More...
 
virtual void AddForce (Vector2 force)
 Use this to add force to the character More...
 
virtual void AddHorizontalForce (float x)
 use this to set the horizontal force applied to the character More...
 
virtual void AddVerticalForce (float y)
 use this to set the vertical force applied to the character More...
 
virtual void SetForce (Vector2 force)
 Use this to set the force applied to the character More...
 
virtual void SetHorizontalForce (float x)
 use this to set the horizontal force applied to the character More...
 
virtual void SetVerticalForce (float y)
 use this to set the vertical force applied to the character More...
 
virtual void CachePlatformMask ()
 A method you can use to cache the PlatformMask should you change it More...
 
virtual void SetPusherPlatform (MMPathMovement newPusherPlatform)
 
virtual void DetachFromMovingPlatform ()
 Disconnects the CorgiController from its current moving platform. More...
 
virtual bool CastRays (RaycastDirections direction, float rayLength, Color color, ref RaycastHit2D[] storageArray)
 A public API to cast rays to any of the 4 cardinal directions using the built-in setup. You can specify the length and color of your rays, and pass a storageArray as a ref parameter, and then analyse its contents to do whatever you want. Note that in most situations (other than collision detection) this may be a bit overkill and maybe you should consider casting a single ray instead. It's up to you! Will return true if any of the rays hit something, false otherwise More...
 
virtual void SetRaysParameters ()
 Creates a rectangle with the boxcollider's size for ease of use and draws debug lines along the different raycast origin axis More...
 
virtual void SetIgnoreCollider (Collider2D newIgnoredCollider)
 
virtual IEnumerator DisableCollisions (float duration)
 Disables the collisions for the specified duration More...
 
virtual void CollisionsOn ()
 Resets the collision mask with the default settings More...
 
virtual void CollisionsOff ()
 Turns all collisions off More...
 
virtual IEnumerator DisableCollisionsWithOneWayPlatforms (float duration)
 Disables the collisions with one way platforms for the specified duration More...
 
virtual IEnumerator DisableCollisionsWithMovingPlatforms (float duration)
 Disables the collisions with moving platforms for the specified duration More...
 
virtual void CollisionsOffWithOneWayPlatformsLayer ()
 Disables collisions only with the one way platform layers More...
 
virtual void CollisionsOffWithMovingPlatformsLayer ()
 Disables collisions only with moving platform layers More...
 
virtual void CollisionsOnWithStairs ()
 Enables collisions with the stairs layer More...
 
virtual void CollisionsOffWithStairs ()
 Disables collisions with the stairs layer More...
 
virtual void ResetParameters ()
 Resets all overridden parameters. More...
 
virtual void SlowFall (float factor)
 Slows the character's fall by the specified factor. More...
 
virtual void GravityActive (bool state)
 Activates or desactivates the gravity for this character only. More...
 
virtual void ResizeCollider (Vector2 newSize)
 Resizes the collider to the new size set in parameters This is temporary - typically when crouching - and will be reverted by ResetColliderSize() More...
 
virtual void ResizeColliderPermanently (Vector2 newSize)
 Resizes the collider to the new size set in parameters, won't be reverted by ResetColliderSize() More...
 
virtual void ResetColliderSize ()
 Returns the collider to its initial size More...
 
virtual bool CanGoBackToOriginalSize ()
 Determines whether this instance can go back to original size. More...
 
virtual bool TrySetSafeTransformPosition (Vector3 position, bool moveToClosestPosition=false)
 Tries to move to a safe position, and moves to the closest position if specified. Returns true if movement was possible, false otherwise More...
 
virtual void SetTransformPosition (Vector3 position)
 Moves the controller's transform to the desired position More...
 
virtual Vector2 GetClosestSafePosition (Vector2 destination)
 Returns the closest "safe" point (not overlapping any platform) to the destination More...
 
virtual void AnchorToGround ()
 Teleports the character to the ground More...
 

Public Attributes

CorgiControllerParameters DefaultParameters
 the initial parameters More...
 
LayerMask PlatformMask = LayerManager.PlatformsLayerMask | LayerManager.PushablesLayerMask
 The layer mask the platforms are on. More...
 
LayerMask MovingPlatformMask = LayerManager.MovingPlatformsLayerMask
 The layer mask the moving platforms are on. More...
 
LayerMask OneWayPlatformMask = LayerManager.OneWayPlatformsLayerMask
 The layer mask the one way platforms are on. More...
 
LayerMask MovingOneWayPlatformMask = LayerManager.MovingOneWayPlatformsMask
 The layer mask the moving one way platforms are on. More...
 
LayerMask MidHeightOneWayPlatformMask = LayerManager.MidHeightOneWayPlatformsLayerMask
 The layer mask the mid height one way paltforms are on. More...
 
LayerMask StairsMask = LayerManager.StairsLayerMask
 The layer mask the stairs are on. More...
 
DetachmentMethods DetachmentMethod = DetachmentMethods.Layer
 When a character jumps from a oneway or moving platform, collisions are off for a short moment. You can decide if they should happen on a whole moving/1way platform layer basis or just with the object the character just left. More...
 
MMLayer DetachmentLayer
 When using the LayerChange detachment method, this is the layer one way and moving platforms will be moved to temporarily. More...
 
GameObject StandingOn
 gives you the object the character is standing on More...
 
UpdateModes UpdateMode = UpdateModes.Update
 whether this controller should run on Update or FixedUpdate More...
 
int NumberOfHorizontalRays = 8
 the number of rays cast horizontally More...
 
int NumberOfVerticalRays = 8
 the number of rays cast vertically More...
 
float RayOffsetHorizontal = 0.05f
 a small value added to all raycasts to accomodate for edge cases
More...
 
float RayOffsetVertical = 0.05f
 a small value added to all raycasts to accomodate for edge cases
More...
 
float RayExtraLengthHorizontal = 0f
 an extra length you an add when casting rays horizontally More...
 
float RayExtraLengthVertical = 0f
 an extra length you an add when casting rays vertically More...
 
float CrouchedRaycastLengthMultiplier = 1f
 by default, the length of the raycasts used to get back to normal size will be auto generated based on your character's normal/standing height, but here you can specify a different value More...
 
bool CastRaysOnBothSides = false
 if this is true, rays will be cast on both sides, otherwise only in the current movement's direction. More...
 
float DistanceToTheGroundRayMaximumLength = 100f
 the maximum length of the ray used to detect the distance to the ground More...
 
float OnMovingPlatformRaycastLengthMultiplier = 2f
 a multiplier to apply to vertical downward raycasts while on a moving platform (longer == more stable movement on platforms) More...
 
float ObstacleHeightTolerance = 0.05f
 an offset to apply vertically to the origin of the controller's raycasts that will have an impact on obstacle detection. Tweak this to adapt to your character's and obstacle's size. More...
 
bool StickToSlopes = false
 If this is set to true, the character will stick to slopes when walking down them. More...
 
float StickyRaycastLength = 0f
 The length of the raycasts used to stick to downward slopes. More...
 
float StickToSlopesOffsetY = 0.2f
 the movement's Y offset to evaluate for stickiness. More...
 
float TimeAirborne = 0f
 the time (in seconds) since the last time the character was grounded More...
 
bool SafeSetTransform = false
 whether or not to perform additional checks when setting the transform's position (typically done by abilities like CharacterGrip). Slightly more expensive in terms of performance, but also safer. More...
 
bool AutomaticallySetPhysicsSettings = true
 if this is true, this controller will set a number of physics settings automatically on init, to ensure they're correct More...
 
bool AutomaticGravitySettings = true
 if this is true, gravity ability settings will be automatically set. It's recommended to set that to true. More...
 
bool PerformSafetyBoxcast = false
 
bool SafetyBoxcastInAirOnly = true
 whether or not to only perform the safety boxcast check in the air More...
 
Vector2 SafetyBoxcastSizeRatio = new Vector2(0.8f, 0.8f)
 the ratio to apply to the Character's size when boxcasting. You'll want it to be always smaller than the actual bounds. 0.8, or 0.5 are good default values in most contexts More...
 
float ExtractionIncrement = 0.05f
 
int MaxExtractionsIterations = 10
 The amount of times the controller should try to extract from a potential non safe space. More...
 
Vector3 ColliderSize => Vector3.Scale(transform.localScale, _boxCollider.size)
 
Vector2 ColliderOffset => _boxCollider.offset
 
Vector3 ColliderCenterPosition => _boxCollider.bounds.center
 
bool IsGravityActive => _gravityActive
 Is gravity active? More...
 
virtual float DeltaTime => _update ? Time.deltaTime : Time.fixedDeltaTime
 
float Friction => _friction
 

Protected Member Functions

virtual void Awake ()
 initialization More...
 
virtual void Initialization ()
 
virtual void ApplyPhysicsSettings ()
 Forces a number of physics settings, if needed More...
 
virtual void ApplyGravitySettings ()
 Forces rotation if we don't have a gravity ability More...
 
virtual void FixedUpdate ()
 On FixedUpdate we run our routine if needed More...
 
virtual void Update ()
 On Update we run our routine if needed More...
 
virtual void LateUpdate ()
 On late update we reset our airborne time More...
 
virtual void EveryFrame ()
 Every frame, we apply the gravity to our character, then check using raycasts if an object's been hit, and modify its new position accordingly. When all the checks have been done, we apply that new position. More...
 
virtual void FrameInitialization ()
 
virtual void FrameExit ()
 Called at the very last moment More...
 
virtual void DetermineMovementDirection ()
 Determines the current movement direction More...
 
virtual void ApplyMovingPlatformMovementDirection (MMPathMovement movingPlatform)
 
virtual void MoveTransform ()
 Moves the transform to its new position, after having performed an optional safety boxcast More...
 
virtual void RunSafetyBoxcast ()
 Returns true if a safety extraction is required, false otherwise More...
 
virtual void ApplyGravity ()
 Applies gravity to the current speed More...
 
virtual void HandleMovingPlatforms (MMPathMovement movingPlatform, bool pushingPlatform=false)
 If the CorgiController is standing on a moving platform, we match its speed More...
 
virtual void CastRaysToTheLeft ()
 
virtual void CastRaysToTheRight ()
 
virtual void CastRaysToTheSides (float raysDirection)
 Casts rays to the sides of the character, from its center axis. If we hit a wall/slope, we check its angle and move or not according to it. More...
 
virtual void CastRaysBelow ()
 Every frame, we cast a number of rays below our character to check for platform collisions More...
 
virtual void CastRaysAbove ()
 If we're in the air and moving up, we cast rays above the character's head to check for collisions More...
 
virtual void StickToSlope ()
 If we're going down a slope, sticks the character to the slope to avoid bounces More...
 
virtual void ComputeNewSpeed ()
 Computes the new speed of the character More...
 
virtual void ClampSpeed ()
 
virtual void ClampExternalForce ()
 
virtual void SetStates ()
 Sets grounded state and collision states More...
 
virtual void ComputeDistanceToTheGround ()
 Computes the distance to the ground More...
 
virtual void OnCorgiColliderHit ()
 triggered when the character's raycasts collide with something More...
 
virtual void OnTriggerEnter2D (Collider2D collider)
 triggered when the character enters a collider More...
 
virtual void OnTriggerStay2D (Collider2D collider)
 triggered while the character stays inside another collider More...
 
virtual void OnTriggerExit2D (Collider2D collider)
 triggered when the character exits a collider More...
 

Protected Attributes

CorgiControllerParameters _overrideParameters
 
Vector2 _speed
 
float _friction =0
 
float _fallSlowFactor
 
float _currentGravity = 0
 
Vector2 _externalForce
 
Vector2 _newPosition
 
Transform _transform
 
BoxCollider2D _boxCollider
 
CharacterGravity _characterGravity
 
LayerMask _platformMaskSave
 
LayerMask _raysBelowLayerMaskPlatforms
 
LayerMask _raysBelowLayerMaskPlatformsWithoutOneWay
 
LayerMask _raysBelowLayerMaskPlatformsWithoutMidHeight
 
int _savedBelowLayer
 
MMPathMovement _movingPlatform = null
 
MMPathMovement _pusherPlatform = null
 
float _movingPlatformCurrentGravity
 
bool _gravityActive =true
 
Collider2D _ignoredCollider = null
 
bool _collisionsOnWithStairs = false
 
Vector2 _originalColliderSize
 
Vector2 _originalColliderOffset
 
Vector2 _originalSizeRaycastOrigin
 
Vector3 _crossBelowSlopeAngle
 
RaycastHit2D[] _sideHitsStorage
 
RaycastHit2D[] _belowHitsStorage
 
RaycastHit2D[] _aboveHitsStorage
 
RaycastHit2D _stickRaycastLeft
 
RaycastHit2D _stickRaycastRight
 
RaycastHit2D _stickRaycast
 
RaycastHit2D _distanceToTheGroundRaycast
 
float _movementDirection
 
float _storedMovementDirection = 1
 
Vector2 _horizontalRayCastFromBottom = Vector2.zero
 
Vector2 _horizontalRayCastToTop = Vector2.zero
 
Vector2 _verticalRayCastFromLeft = Vector2.zero
 
Vector2 _verticalRayCastToRight = Vector2.zero
 
Vector2 _aboveRayCastStart = Vector2.zero
 
Vector2 _aboveRayCastEnd = Vector2.zero
 
Vector2 _rayCastOrigin = Vector2.zero
 
Vector3 _colliderBottomCenterPosition
 
Vector3 _colliderLeftCenterPosition
 
Vector3 _colliderRightCenterPosition
 
Vector3 _colliderTopCenterPosition
 
MMPathMovement _movingPlatformTest
 
SurfaceModifier _frictionTest
 
bool _update
 
RaycastHit2D[] _raycastNonAlloc = new RaycastHit2D[0]
 
Vector2 _boundsTopLeftCorner
 
Vector2 _boundsBottomLeftCorner
 
Vector2 _boundsTopRightCorner
 
Vector2 _boundsBottomRightCorner
 
Vector2 _boundsCenter
 
Vector2 _bounds
 
float _boundsWidth
 
float _boundsHeight
 
float _distanceToTheGround
 
Vector2 _worldSpeed
 
List< RaycastHit2D > _contactList
 
bool _shouldComputeNewSpeed = false
 
Vector2 _safetyExtractionSize = Vector2.zero
 
GameObject _detachmentObject
 

Static Protected Attributes

const float _smallValue =0.0001f
 
const float _movingPlatformsGravity =-500
 
const float _movementDirectionThreshold = 0.0001f
 

Properties

CorgiControllerState State [get, protected set]
 the various states of our character More...
 
CorgiControllerParameters?? Parameters [get]
 the current parameters More...
 
GameObject StandingOnLastFrame [get, protected set]
 the object the character was standing on last frame More...
 
Collider2D StandingOnCollider [get, protected set]
 gives you the collider the character is standing on More...
 
GameObject LastStandingOn [get, protected set]
 gives you the collider the character is standing on More...
 
Vector2 Speed [get]
 the current speed of the character More...
 
virtual Vector2 WorldSpeed [get]
 the world speed of the character More...
 
virtual Vector2 ForcesApplied [get, protected set]
 the value of the forces applied at one point in time More...
 
virtual GameObject CurrentWallCollider [get, protected set]
 the wall we're currently colliding with More...
 
virtual Vector3 ColliderBottomPosition [get]
 
virtual Vector3 ColliderLeftPosition [get]
 
virtual Vector3 ColliderTopPosition [get]
 
virtual Vector3 ColliderRightPosition [get]
 
SurfaceModifier CurrentSurfaceModifier [get, set]
 
GameObject[] StandingOnArray [get, set]
 
virtual Vector2 Bounds [get]
 
virtual Vector3 BoundsTopLeftCorner [get]
 
virtual Vector3 BoundsBottomLeftCorner [get]
 
virtual Vector3 BoundsTopRightCorner [get]
 
virtual Vector3 BoundsBottomRightCorner [get]
 
virtual Vector3 BoundsTop [get]
 
virtual Vector3 BoundsBottom [get]
 
virtual Vector3 BoundsRight [get]
 
virtual Vector3 BoundsLeft [get]
 
virtual Vector3 BoundsCenter [get]
 
virtual float DistanceToTheGround [get]
 
virtual Vector2 ExternalForce [get]
 

Detailed Description

The character controller that handles the character's gravity and collisions. It requires a Collider2D and a rigidbody to function.

Member Enumeration Documentation

◆ DetachmentMethods

The possible ways a character can detach from a oneway or moving platform.

Enumerator
Layer 
Object 
LayerChange 

◆ RaycastDirections

the possible directions a ray can be cast

Enumerator
up 
down 
left 
right 

◆ UpdateModes

the possible modes this controller can update on

Enumerator
Update 
FixedUpdate 

Member Function Documentation

◆ AddForce()

virtual void MoreMountains.CorgiEngine.CorgiController.AddForce ( Vector2  force)
virtual

Use this to add force to the character

Parameters
forceForce to add to the character.

◆ AddHorizontalForce()

virtual void MoreMountains.CorgiEngine.CorgiController.AddHorizontalForce ( float  x)
virtual

use this to set the horizontal force applied to the character

Parameters
xThe x value of the velocity.

◆ AddVerticalForce()

virtual void MoreMountains.CorgiEngine.CorgiController.AddVerticalForce ( float  y)
virtual

use this to set the vertical force applied to the character

Parameters
yThe y value of the velocity.

◆ AnchorToGround()

virtual void MoreMountains.CorgiEngine.CorgiController.AnchorToGround ( )
virtual

Teleports the character to the ground

◆ ApplyGravity()

virtual void MoreMountains.CorgiEngine.CorgiController.ApplyGravity ( )
protectedvirtual

Applies gravity to the current speed

◆ ApplyGravitySettings()

virtual void MoreMountains.CorgiEngine.CorgiController.ApplyGravitySettings ( )
protectedvirtual

Forces rotation if we don't have a gravity ability

◆ ApplyMovingPlatformMovementDirection()

virtual void MoreMountains.CorgiEngine.CorgiController.ApplyMovingPlatformMovementDirection ( MMPathMovement  movingPlatform)
protectedvirtual

◆ ApplyPhysicsSettings()

virtual void MoreMountains.CorgiEngine.CorgiController.ApplyPhysicsSettings ( )
protectedvirtual

Forces a number of physics settings, if needed

◆ Awake()

virtual void MoreMountains.CorgiEngine.CorgiController.Awake ( )
protectedvirtual

initialization

◆ CachePlatformMask()

virtual void MoreMountains.CorgiEngine.CorgiController.CachePlatformMask ( )
virtual

A method you can use to cache the PlatformMask should you change it

◆ CanGoBackToOriginalSize()

virtual bool MoreMountains.CorgiEngine.CorgiController.CanGoBackToOriginalSize ( )
virtual

Determines whether this instance can go back to original size.

Returns
true if this instance can go back to original size; otherwise, false.

◆ CastRays()

virtual bool MoreMountains.CorgiEngine.CorgiController.CastRays ( RaycastDirections  direction,
float  rayLength,
Color  color,
ref RaycastHit2D[]  storageArray 
)
virtual

A public API to cast rays to any of the 4 cardinal directions using the built-in setup. You can specify the length and color of your rays, and pass a storageArray as a ref parameter, and then analyse its contents to do whatever you want. Note that in most situations (other than collision detection) this may be a bit overkill and maybe you should consider casting a single ray instead. It's up to you! Will return true if any of the rays hit something, false otherwise

Returns
true, if one of the rays hit something, false otherwise.
Parameters
directionDirection.
rayLengthRay length.
colorColor.
storageArrayStorage array.

◆ CastRaysAbove()

virtual void MoreMountains.CorgiEngine.CorgiController.CastRaysAbove ( )
protectedvirtual

If we're in the air and moving up, we cast rays above the character's head to check for collisions

◆ CastRaysBelow()

virtual void MoreMountains.CorgiEngine.CorgiController.CastRaysBelow ( )
protectedvirtual

Every frame, we cast a number of rays below our character to check for platform collisions

◆ CastRaysToTheLeft()

virtual void MoreMountains.CorgiEngine.CorgiController.CastRaysToTheLeft ( )
protectedvirtual

◆ CastRaysToTheRight()

virtual void MoreMountains.CorgiEngine.CorgiController.CastRaysToTheRight ( )
protectedvirtual

◆ CastRaysToTheSides()

virtual void MoreMountains.CorgiEngine.CorgiController.CastRaysToTheSides ( float  raysDirection)
protectedvirtual

Casts rays to the sides of the character, from its center axis. If we hit a wall/slope, we check its angle and move or not according to it.

◆ ClampExternalForce()

virtual void MoreMountains.CorgiEngine.CorgiController.ClampExternalForce ( )
protectedvirtual

◆ ClampSpeed()

virtual void MoreMountains.CorgiEngine.CorgiController.ClampSpeed ( )
protectedvirtual

◆ CollisionsOff()

virtual void MoreMountains.CorgiEngine.CorgiController.CollisionsOff ( )
virtual

Turns all collisions off

◆ CollisionsOffWithMovingPlatformsLayer()

virtual void MoreMountains.CorgiEngine.CorgiController.CollisionsOffWithMovingPlatformsLayer ( )
virtual

Disables collisions only with moving platform layers

◆ CollisionsOffWithOneWayPlatformsLayer()

virtual void MoreMountains.CorgiEngine.CorgiController.CollisionsOffWithOneWayPlatformsLayer ( )
virtual

Disables collisions only with the one way platform layers

◆ CollisionsOffWithStairs()

virtual void MoreMountains.CorgiEngine.CorgiController.CollisionsOffWithStairs ( )
virtual

Disables collisions with the stairs layer

◆ CollisionsOn()

virtual void MoreMountains.CorgiEngine.CorgiController.CollisionsOn ( )
virtual

Resets the collision mask with the default settings

◆ CollisionsOnWithStairs()

virtual void MoreMountains.CorgiEngine.CorgiController.CollisionsOnWithStairs ( )
virtual

Enables collisions with the stairs layer

◆ ComputeDistanceToTheGround()

virtual void MoreMountains.CorgiEngine.CorgiController.ComputeDistanceToTheGround ( )
protectedvirtual

Computes the distance to the ground

◆ ComputeNewSpeed()

virtual void MoreMountains.CorgiEngine.CorgiController.ComputeNewSpeed ( )
protectedvirtual

Computes the new speed of the character

◆ DetachFromMovingPlatform()

virtual void MoreMountains.CorgiEngine.CorgiController.DetachFromMovingPlatform ( )
virtual

Disconnects the CorgiController from its current moving platform.

◆ DetermineMovementDirection()

virtual void MoreMountains.CorgiEngine.CorgiController.DetermineMovementDirection ( )
protectedvirtual

Determines the current movement direction

◆ DisableCollisions()

virtual IEnumerator MoreMountains.CorgiEngine.CorgiController.DisableCollisions ( float  duration)
virtual

Disables the collisions for the specified duration

Parameters
durationthe duration for which the collisions must be disabled

◆ DisableCollisionsWithMovingPlatforms()

virtual IEnumerator MoreMountains.CorgiEngine.CorgiController.DisableCollisionsWithMovingPlatforms ( float  duration)
virtual

Disables the collisions with moving platforms for the specified duration

Parameters
durationthe duration for which the collisions must be disabled

◆ DisableCollisionsWithOneWayPlatforms()

virtual IEnumerator MoreMountains.CorgiEngine.CorgiController.DisableCollisionsWithOneWayPlatforms ( float  duration)
virtual

Disables the collisions with one way platforms for the specified duration

Parameters
durationthe duration for which the collisions must be disabled

◆ EveryFrame()

virtual void MoreMountains.CorgiEngine.CorgiController.EveryFrame ( )
protectedvirtual

Every frame, we apply the gravity to our character, then check using raycasts if an object's been hit, and modify its new position accordingly. When all the checks have been done, we apply that new position.

◆ FixedUpdate()

virtual void MoreMountains.CorgiEngine.CorgiController.FixedUpdate ( )
protectedvirtual

On FixedUpdate we run our routine if needed

◆ FrameExit()

virtual void MoreMountains.CorgiEngine.CorgiController.FrameExit ( )
protectedvirtual

Called at the very last moment

◆ FrameInitialization()

virtual void MoreMountains.CorgiEngine.CorgiController.FrameInitialization ( )
protectedvirtual

◆ GetClosestSafePosition()

virtual Vector2 MoreMountains.CorgiEngine.CorgiController.GetClosestSafePosition ( Vector2  destination)
virtual

Returns the closest "safe" point (not overlapping any platform) to the destination

Parameters
destination
Returns

◆ GravityActive()

virtual void MoreMountains.CorgiEngine.CorgiController.GravityActive ( bool  state)
virtual

Activates or desactivates the gravity for this character only.

Parameters
stateIf set to true, activates the gravity. If set to false, turns it off.


◆ HandleMovingPlatforms()

virtual void MoreMountains.CorgiEngine.CorgiController.HandleMovingPlatforms ( MMPathMovement  movingPlatform,
bool  pushingPlatform = false 
)
protectedvirtual

If the CorgiController is standing on a moving platform, we match its speed

◆ Height()

virtual float MoreMountains.CorgiEngine.CorgiController.Height ( )
virtual

Returns the character's bounds height

◆ Initialization()

virtual void MoreMountains.CorgiEngine.CorgiController.Initialization ( )
protectedvirtual

◆ LateUpdate()

virtual void MoreMountains.CorgiEngine.CorgiController.LateUpdate ( )
protectedvirtual

On late update we reset our airborne time

◆ MoveTransform()

virtual void MoreMountains.CorgiEngine.CorgiController.MoveTransform ( )
protectedvirtual

Moves the transform to its new position, after having performed an optional safety boxcast

◆ OnCorgiColliderHit()

virtual void MoreMountains.CorgiEngine.CorgiController.OnCorgiColliderHit ( )
protectedvirtual

triggered when the character's raycasts collide with something

◆ OnTriggerEnter2D()

virtual void MoreMountains.CorgiEngine.CorgiController.OnTriggerEnter2D ( Collider2D  collider)
protectedvirtual

triggered when the character enters a collider

Parameters
colliderthe object we're colliding with.


◆ OnTriggerExit2D()

virtual void MoreMountains.CorgiEngine.CorgiController.OnTriggerExit2D ( Collider2D  collider)
protectedvirtual

triggered when the character exits a collider

Parameters
colliderthe object we're colliding with.

◆ OnTriggerStay2D()

virtual void MoreMountains.CorgiEngine.CorgiController.OnTriggerStay2D ( Collider2D  collider)
protectedvirtual

triggered while the character stays inside another collider

Parameters
colliderthe object we're colliding with.

◆ ResetColliderSize()

virtual void MoreMountains.CorgiEngine.CorgiController.ResetColliderSize ( )
virtual

Returns the collider to its initial size

◆ ResetParameters()

virtual void MoreMountains.CorgiEngine.CorgiController.ResetParameters ( )
virtual

Resets all overridden parameters.

◆ ResizeCollider()

virtual void MoreMountains.CorgiEngine.CorgiController.ResizeCollider ( Vector2  newSize)
virtual

Resizes the collider to the new size set in parameters This is temporary - typically when crouching - and will be reverted by ResetColliderSize()

Parameters
newSizeNew size.

◆ ResizeColliderPermanently()

virtual void MoreMountains.CorgiEngine.CorgiController.ResizeColliderPermanently ( Vector2  newSize)
virtual

Resizes the collider to the new size set in parameters, won't be reverted by ResetColliderSize()

Parameters
newSize

◆ RunSafetyBoxcast()

virtual void MoreMountains.CorgiEngine.CorgiController.RunSafetyBoxcast ( )
protectedvirtual

Returns true if a safety extraction is required, false otherwise

Returns

◆ SetForce()

virtual void MoreMountains.CorgiEngine.CorgiController.SetForce ( Vector2  force)
virtual

Use this to set the force applied to the character

Parameters
forceForce to apply to the character.

◆ SetHorizontalForce()

virtual void MoreMountains.CorgiEngine.CorgiController.SetHorizontalForce ( float  x)
virtual

use this to set the horizontal force applied to the character

Parameters
xThe x value of the velocity.

◆ SetIgnoreCollider()

virtual void MoreMountains.CorgiEngine.CorgiController.SetIgnoreCollider ( Collider2D  newIgnoredCollider)
virtual

◆ SetPusherPlatform()

virtual void MoreMountains.CorgiEngine.CorgiController.SetPusherPlatform ( MMPathMovement  newPusherPlatform)
virtual

◆ SetRaysParameters()

virtual void MoreMountains.CorgiEngine.CorgiController.SetRaysParameters ( )
virtual

Creates a rectangle with the boxcollider's size for ease of use and draws debug lines along the different raycast origin axis

◆ SetStates()

virtual void MoreMountains.CorgiEngine.CorgiController.SetStates ( )
protectedvirtual

Sets grounded state and collision states

◆ SetTransformPosition()

virtual void MoreMountains.CorgiEngine.CorgiController.SetTransformPosition ( Vector3  position)
virtual

Moves the controller's transform to the desired position

Parameters
position

◆ SetVerticalForce()

virtual void MoreMountains.CorgiEngine.CorgiController.SetVerticalForce ( float  y)
virtual

use this to set the vertical force applied to the character

Parameters
yThe y value of the velocity.

◆ SlowFall()

virtual void MoreMountains.CorgiEngine.CorgiController.SlowFall ( float  factor)
virtual

Slows the character's fall by the specified factor.

Parameters
factorFactor.

◆ StickToSlope()

virtual void MoreMountains.CorgiEngine.CorgiController.StickToSlope ( )
protectedvirtual

If we're going down a slope, sticks the character to the slope to avoid bounces

◆ TrySetSafeTransformPosition()

virtual bool MoreMountains.CorgiEngine.CorgiController.TrySetSafeTransformPosition ( Vector3  position,
bool  moveToClosestPosition = false 
)
virtual

Tries to move to a safe position, and moves to the closest position if specified. Returns true if movement was possible, false otherwise

Parameters
position
moveToClosestPosition
Returns

◆ Update()

virtual void MoreMountains.CorgiEngine.CorgiController.Update ( )
protectedvirtual

On Update we run our routine if needed

◆ Width()

virtual float MoreMountains.CorgiEngine.CorgiController.Width ( )
virtual

Returns the character's bounds width

Member Data Documentation

◆ _aboveHitsStorage

RaycastHit2D [] MoreMountains.CorgiEngine.CorgiController._aboveHitsStorage
protected

◆ _aboveRayCastEnd

Vector2 MoreMountains.CorgiEngine.CorgiController._aboveRayCastEnd = Vector2.zero
protected

◆ _aboveRayCastStart

Vector2 MoreMountains.CorgiEngine.CorgiController._aboveRayCastStart = Vector2.zero
protected

◆ _belowHitsStorage

RaycastHit2D [] MoreMountains.CorgiEngine.CorgiController._belowHitsStorage
protected

◆ _bounds

Vector2 MoreMountains.CorgiEngine.CorgiController._bounds
protected

◆ _boundsBottomLeftCorner

Vector2 MoreMountains.CorgiEngine.CorgiController._boundsBottomLeftCorner
protected

◆ _boundsBottomRightCorner

Vector2 MoreMountains.CorgiEngine.CorgiController._boundsBottomRightCorner
protected

◆ _boundsCenter

Vector2 MoreMountains.CorgiEngine.CorgiController._boundsCenter
protected

◆ _boundsHeight

float MoreMountains.CorgiEngine.CorgiController._boundsHeight
protected

◆ _boundsTopLeftCorner

Vector2 MoreMountains.CorgiEngine.CorgiController._boundsTopLeftCorner
protected

◆ _boundsTopRightCorner

Vector2 MoreMountains.CorgiEngine.CorgiController._boundsTopRightCorner
protected

◆ _boundsWidth

float MoreMountains.CorgiEngine.CorgiController._boundsWidth
protected

◆ _boxCollider

BoxCollider2D MoreMountains.CorgiEngine.CorgiController._boxCollider
protected

◆ _characterGravity

CharacterGravity MoreMountains.CorgiEngine.CorgiController._characterGravity
protected

◆ _colliderBottomCenterPosition

Vector3 MoreMountains.CorgiEngine.CorgiController._colliderBottomCenterPosition
protected

◆ _colliderLeftCenterPosition

Vector3 MoreMountains.CorgiEngine.CorgiController._colliderLeftCenterPosition
protected

◆ _colliderRightCenterPosition

Vector3 MoreMountains.CorgiEngine.CorgiController._colliderRightCenterPosition
protected

◆ _colliderTopCenterPosition

Vector3 MoreMountains.CorgiEngine.CorgiController._colliderTopCenterPosition
protected

◆ _collisionsOnWithStairs

bool MoreMountains.CorgiEngine.CorgiController._collisionsOnWithStairs = false
protected

◆ _contactList

List<RaycastHit2D> MoreMountains.CorgiEngine.CorgiController._contactList
protected

◆ _crossBelowSlopeAngle

Vector3 MoreMountains.CorgiEngine.CorgiController._crossBelowSlopeAngle
protected

◆ _currentGravity

float MoreMountains.CorgiEngine.CorgiController._currentGravity = 0
protected

◆ _detachmentObject

GameObject MoreMountains.CorgiEngine.CorgiController._detachmentObject
protected

◆ _distanceToTheGround

float MoreMountains.CorgiEngine.CorgiController._distanceToTheGround
protected

◆ _distanceToTheGroundRaycast

RaycastHit2D MoreMountains.CorgiEngine.CorgiController._distanceToTheGroundRaycast
protected

◆ _externalForce

Vector2 MoreMountains.CorgiEngine.CorgiController._externalForce
protected

◆ _fallSlowFactor

float MoreMountains.CorgiEngine.CorgiController._fallSlowFactor
protected

◆ _friction

float MoreMountains.CorgiEngine.CorgiController._friction =0
protected

◆ _frictionTest

SurfaceModifier MoreMountains.CorgiEngine.CorgiController._frictionTest
protected

◆ _gravityActive

bool MoreMountains.CorgiEngine.CorgiController._gravityActive =true
protected

◆ _horizontalRayCastFromBottom

Vector2 MoreMountains.CorgiEngine.CorgiController._horizontalRayCastFromBottom = Vector2.zero
protected

◆ _horizontalRayCastToTop

Vector2 MoreMountains.CorgiEngine.CorgiController._horizontalRayCastToTop = Vector2.zero
protected

◆ _ignoredCollider

Collider2D MoreMountains.CorgiEngine.CorgiController._ignoredCollider = null
protected

◆ _movementDirection

float MoreMountains.CorgiEngine.CorgiController._movementDirection
protected

◆ _movementDirectionThreshold

const float MoreMountains.CorgiEngine.CorgiController._movementDirectionThreshold = 0.0001f
staticprotected

◆ _movingPlatform

MMPathMovement MoreMountains.CorgiEngine.CorgiController._movingPlatform = null
protected

◆ _movingPlatformCurrentGravity

float MoreMountains.CorgiEngine.CorgiController._movingPlatformCurrentGravity
protected

◆ _movingPlatformsGravity

const float MoreMountains.CorgiEngine.CorgiController._movingPlatformsGravity =-500
staticprotected

◆ _movingPlatformTest

MMPathMovement MoreMountains.CorgiEngine.CorgiController._movingPlatformTest
protected

◆ _newPosition

Vector2 MoreMountains.CorgiEngine.CorgiController._newPosition
protected

◆ _originalColliderOffset

Vector2 MoreMountains.CorgiEngine.CorgiController._originalColliderOffset
protected

◆ _originalColliderSize

Vector2 MoreMountains.CorgiEngine.CorgiController._originalColliderSize
protected

◆ _originalSizeRaycastOrigin

Vector2 MoreMountains.CorgiEngine.CorgiController._originalSizeRaycastOrigin
protected

◆ _overrideParameters

CorgiControllerParameters MoreMountains.CorgiEngine.CorgiController._overrideParameters
protected

◆ _platformMaskSave

LayerMask MoreMountains.CorgiEngine.CorgiController._platformMaskSave
protected

◆ _pusherPlatform

MMPathMovement MoreMountains.CorgiEngine.CorgiController._pusherPlatform = null
protected

◆ _raycastNonAlloc

RaycastHit2D [] MoreMountains.CorgiEngine.CorgiController._raycastNonAlloc = new RaycastHit2D[0]
protected

◆ _rayCastOrigin

Vector2 MoreMountains.CorgiEngine.CorgiController._rayCastOrigin = Vector2.zero
protected

◆ _raysBelowLayerMaskPlatforms

LayerMask MoreMountains.CorgiEngine.CorgiController._raysBelowLayerMaskPlatforms
protected

◆ _raysBelowLayerMaskPlatformsWithoutMidHeight

LayerMask MoreMountains.CorgiEngine.CorgiController._raysBelowLayerMaskPlatformsWithoutMidHeight
protected

◆ _raysBelowLayerMaskPlatformsWithoutOneWay

LayerMask MoreMountains.CorgiEngine.CorgiController._raysBelowLayerMaskPlatformsWithoutOneWay
protected

◆ _safetyExtractionSize

Vector2 MoreMountains.CorgiEngine.CorgiController._safetyExtractionSize = Vector2.zero
protected

◆ _savedBelowLayer

int MoreMountains.CorgiEngine.CorgiController._savedBelowLayer
protected

◆ _shouldComputeNewSpeed

bool MoreMountains.CorgiEngine.CorgiController._shouldComputeNewSpeed = false
protected

◆ _sideHitsStorage

RaycastHit2D [] MoreMountains.CorgiEngine.CorgiController._sideHitsStorage
protected

◆ _smallValue

const float MoreMountains.CorgiEngine.CorgiController._smallValue =0.0001f
staticprotected

◆ _speed

Vector2 MoreMountains.CorgiEngine.CorgiController._speed
protected

◆ _stickRaycast

RaycastHit2D MoreMountains.CorgiEngine.CorgiController._stickRaycast
protected

◆ _stickRaycastLeft

RaycastHit2D MoreMountains.CorgiEngine.CorgiController._stickRaycastLeft
protected

◆ _stickRaycastRight

RaycastHit2D MoreMountains.CorgiEngine.CorgiController._stickRaycastRight
protected

◆ _storedMovementDirection

float MoreMountains.CorgiEngine.CorgiController._storedMovementDirection = 1
protected

◆ _transform

Transform MoreMountains.CorgiEngine.CorgiController._transform
protected

◆ _update

bool MoreMountains.CorgiEngine.CorgiController._update
protected

◆ _verticalRayCastFromLeft

Vector2 MoreMountains.CorgiEngine.CorgiController._verticalRayCastFromLeft = Vector2.zero
protected

◆ _verticalRayCastToRight

Vector2 MoreMountains.CorgiEngine.CorgiController._verticalRayCastToRight = Vector2.zero
protected

◆ _worldSpeed

Vector2 MoreMountains.CorgiEngine.CorgiController._worldSpeed
protected

◆ AutomaticallySetPhysicsSettings

bool MoreMountains.CorgiEngine.CorgiController.AutomaticallySetPhysicsSettings = true

if this is true, this controller will set a number of physics settings automatically on init, to ensure they're correct

◆ AutomaticGravitySettings

bool MoreMountains.CorgiEngine.CorgiController.AutomaticGravitySettings = true

if this is true, gravity ability settings will be automatically set. It's recommended to set that to true.

◆ CastRaysOnBothSides

bool MoreMountains.CorgiEngine.CorgiController.CastRaysOnBothSides = false

if this is true, rays will be cast on both sides, otherwise only in the current movement's direction.

◆ ColliderCenterPosition

Vector3 MoreMountains.CorgiEngine.CorgiController.ColliderCenterPosition => _boxCollider.bounds.center

◆ ColliderOffset

Vector2 MoreMountains.CorgiEngine.CorgiController.ColliderOffset => _boxCollider.offset

◆ ColliderSize

Vector3 MoreMountains.CorgiEngine.CorgiController.ColliderSize => Vector3.Scale(transform.localScale, _boxCollider.size)

◆ CrouchedRaycastLengthMultiplier

float MoreMountains.CorgiEngine.CorgiController.CrouchedRaycastLengthMultiplier = 1f

by default, the length of the raycasts used to get back to normal size will be auto generated based on your character's normal/standing height, but here you can specify a different value

◆ DefaultParameters

CorgiControllerParameters MoreMountains.CorgiEngine.CorgiController.DefaultParameters

the initial parameters

◆ DeltaTime

virtual float MoreMountains.CorgiEngine.CorgiController.DeltaTime => _update ? Time.deltaTime : Time.fixedDeltaTime

◆ DetachmentLayer

MMLayer MoreMountains.CorgiEngine.CorgiController.DetachmentLayer

When using the LayerChange detachment method, this is the layer one way and moving platforms will be moved to temporarily.

◆ DetachmentMethod

DetachmentMethods MoreMountains.CorgiEngine.CorgiController.DetachmentMethod = DetachmentMethods.Layer

When a character jumps from a oneway or moving platform, collisions are off for a short moment. You can decide if they should happen on a whole moving/1way platform layer basis or just with the object the character just left.

◆ DistanceToTheGroundRayMaximumLength

float MoreMountains.CorgiEngine.CorgiController.DistanceToTheGroundRayMaximumLength = 100f

the maximum length of the ray used to detect the distance to the ground

◆ ExtractionIncrement

float MoreMountains.CorgiEngine.CorgiController.ExtractionIncrement = 0.05f

if an obstacle is found, extraction will be attempted, and the controller will move back along its last movement line, trying to find a safe space to put the character. This defines the distance of each of these moves. Keep it small, and consistent with your character's size and speed

◆ Friction

float MoreMountains.CorgiEngine.CorgiController.Friction => _friction

◆ IsGravityActive

bool MoreMountains.CorgiEngine.CorgiController.IsGravityActive => _gravityActive

Is gravity active?

◆ MaxExtractionsIterations

int MoreMountains.CorgiEngine.CorgiController.MaxExtractionsIterations = 10

The amount of times the controller should try to extract from a potential non safe space.

◆ MidHeightOneWayPlatformMask

LayerMask MoreMountains.CorgiEngine.CorgiController.MidHeightOneWayPlatformMask = LayerManager.MidHeightOneWayPlatformsLayerMask

The layer mask the mid height one way paltforms are on.

◆ MovingOneWayPlatformMask

LayerMask MoreMountains.CorgiEngine.CorgiController.MovingOneWayPlatformMask = LayerManager.MovingOneWayPlatformsMask

The layer mask the moving one way platforms are on.

◆ MovingPlatformMask

LayerMask MoreMountains.CorgiEngine.CorgiController.MovingPlatformMask = LayerManager.MovingPlatformsLayerMask

The layer mask the moving platforms are on.

◆ NumberOfHorizontalRays

int MoreMountains.CorgiEngine.CorgiController.NumberOfHorizontalRays = 8

the number of rays cast horizontally

◆ NumberOfVerticalRays

int MoreMountains.CorgiEngine.CorgiController.NumberOfVerticalRays = 8

the number of rays cast vertically

◆ ObstacleHeightTolerance

float MoreMountains.CorgiEngine.CorgiController.ObstacleHeightTolerance = 0.05f

an offset to apply vertically to the origin of the controller's raycasts that will have an impact on obstacle detection. Tweak this to adapt to your character's and obstacle's size.

◆ OneWayPlatformMask

LayerMask MoreMountains.CorgiEngine.CorgiController.OneWayPlatformMask = LayerManager.OneWayPlatformsLayerMask

The layer mask the one way platforms are on.

◆ OnMovingPlatformRaycastLengthMultiplier

float MoreMountains.CorgiEngine.CorgiController.OnMovingPlatformRaycastLengthMultiplier = 2f

a multiplier to apply to vertical downward raycasts while on a moving platform (longer == more stable movement on platforms)

◆ PerformSafetyBoxcast

bool MoreMountains.CorgiEngine.CorgiController.PerformSafetyBoxcast = false

if this is true, the controller will perform an extra boxcast before authorizing movement, from the previous place to the next. If an obstacle is found between the two, movement will be prevented, and extraction will be attempted In most contexts this can remain false, but if you experience characters going through platforms, turn it on

◆ PlatformMask

LayerMask MoreMountains.CorgiEngine.CorgiController.PlatformMask = LayerManager.PlatformsLayerMask | LayerManager.PushablesLayerMask

The layer mask the platforms are on.

◆ RayExtraLengthHorizontal

float MoreMountains.CorgiEngine.CorgiController.RayExtraLengthHorizontal = 0f

an extra length you an add when casting rays horizontally

◆ RayExtraLengthVertical

float MoreMountains.CorgiEngine.CorgiController.RayExtraLengthVertical = 0f

an extra length you an add when casting rays vertically

◆ RayOffsetHorizontal

float MoreMountains.CorgiEngine.CorgiController.RayOffsetHorizontal = 0.05f

a small value added to all raycasts to accomodate for edge cases

◆ RayOffsetVertical

float MoreMountains.CorgiEngine.CorgiController.RayOffsetVertical = 0.05f

a small value added to all raycasts to accomodate for edge cases

◆ SafeSetTransform

bool MoreMountains.CorgiEngine.CorgiController.SafeSetTransform = false

whether or not to perform additional checks when setting the transform's position (typically done by abilities like CharacterGrip). Slightly more expensive in terms of performance, but also safer.

◆ SafetyBoxcastInAirOnly

bool MoreMountains.CorgiEngine.CorgiController.SafetyBoxcastInAirOnly = true

whether or not to only perform the safety boxcast check in the air

◆ SafetyBoxcastSizeRatio

Vector2 MoreMountains.CorgiEngine.CorgiController.SafetyBoxcastSizeRatio = new Vector2(0.8f, 0.8f)

the ratio to apply to the Character's size when boxcasting. You'll want it to be always smaller than the actual bounds. 0.8, or 0.5 are good default values in most contexts

◆ StairsMask

LayerMask MoreMountains.CorgiEngine.CorgiController.StairsMask = LayerManager.StairsLayerMask

The layer mask the stairs are on.

◆ StandingOn

GameObject MoreMountains.CorgiEngine.CorgiController.StandingOn

gives you the object the character is standing on

◆ StickToSlopes

bool MoreMountains.CorgiEngine.CorgiController.StickToSlopes = false

If this is set to true, the character will stick to slopes when walking down them.

◆ StickToSlopesOffsetY

float MoreMountains.CorgiEngine.CorgiController.StickToSlopesOffsetY = 0.2f

the movement's Y offset to evaluate for stickiness.

◆ StickyRaycastLength

float MoreMountains.CorgiEngine.CorgiController.StickyRaycastLength = 0f

The length of the raycasts used to stick to downward slopes.

◆ TimeAirborne

float MoreMountains.CorgiEngine.CorgiController.TimeAirborne = 0f

the time (in seconds) since the last time the character was grounded

◆ UpdateMode

UpdateModes MoreMountains.CorgiEngine.CorgiController.UpdateMode = UpdateModes.Update

whether this controller should run on Update or FixedUpdate

Property Documentation

◆ Bounds

virtual Vector2 MoreMountains.CorgiEngine.CorgiController.Bounds
get

◆ BoundsBottom

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsBottom
get

◆ BoundsBottomLeftCorner

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsBottomLeftCorner
get

◆ BoundsBottomRightCorner

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsBottomRightCorner
get

◆ BoundsCenter

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsCenter
get

◆ BoundsLeft

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsLeft
get

◆ BoundsRight

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsRight
get

◆ BoundsTop

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsTop
get

◆ BoundsTopLeftCorner

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsTopLeftCorner
get

◆ BoundsTopRightCorner

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.BoundsTopRightCorner
get

◆ ColliderBottomPosition

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.ColliderBottomPosition
get

◆ ColliderLeftPosition

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.ColliderLeftPosition
get

◆ ColliderRightPosition

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.ColliderRightPosition
get

◆ ColliderTopPosition

virtual Vector3 MoreMountains.CorgiEngine.CorgiController.ColliderTopPosition
get

◆ CurrentSurfaceModifier

SurfaceModifier MoreMountains.CorgiEngine.CorgiController.CurrentSurfaceModifier
getset

◆ CurrentWallCollider

virtual GameObject MoreMountains.CorgiEngine.CorgiController.CurrentWallCollider
getprotected set

the wall we're currently colliding with

◆ DistanceToTheGround

virtual float MoreMountains.CorgiEngine.CorgiController.DistanceToTheGround
get

◆ ExternalForce

virtual Vector2 MoreMountains.CorgiEngine.CorgiController.ExternalForce
get

◆ ForcesApplied

virtual Vector2 MoreMountains.CorgiEngine.CorgiController.ForcesApplied
getprotected set

the value of the forces applied at one point in time

◆ LastStandingOn

GameObject MoreMountains.CorgiEngine.CorgiController.LastStandingOn
getprotected set

gives you the collider the character is standing on

◆ Parameters

CorgiControllerParameters?? MoreMountains.CorgiEngine.CorgiController.Parameters
get

the current parameters

◆ Speed

Vector2 MoreMountains.CorgiEngine.CorgiController.Speed
get

the current speed of the character

◆ StandingOnArray

GameObject [] MoreMountains.CorgiEngine.CorgiController.StandingOnArray
getset

◆ StandingOnCollider

Collider2D MoreMountains.CorgiEngine.CorgiController.StandingOnCollider
getprotected set

gives you the collider the character is standing on

◆ StandingOnLastFrame

GameObject MoreMountains.CorgiEngine.CorgiController.StandingOnLastFrame
getprotected set

the object the character was standing on last frame

◆ State

CorgiControllerState MoreMountains.CorgiEngine.CorgiController.State
getprotected set

the various states of our character

◆ WorldSpeed

virtual Vector2 MoreMountains.CorgiEngine.CorgiController.WorldSpeed
get

the world speed of the character


The documentation for this class was generated from the following file: