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

A class needed on pushable objects if you want your character to be able to detect them More...

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

Public Member Functions

virtual void Attach (CorgiController pusher)
 Attaches a pusher controller to this pushable object More...
 
virtual void Detach (CorgiController pusher)
 Detaches the current pusher object from this pushable object More...
 

Public Attributes

float PushSpeed = 3f
 the speed at which this object can be pushed More...
 
float GroundedRaycastLength = 1f
 the length of the raycast we cast to detect if the object is grounded More...
 
float GroundedRaycastOffset = 0.1f
 the vertical offset to apply when trying to detect the ground More...
 
LayerMask GroundedLayerMask = LayerManager.ObstaclesLayerMask
 the layers this object considers as ground More...
 
bool Grounded = false
 whether or not the object touches the ground this frame More...
 
CorgiController Pusher
 the CorgiController currently pushing this object More...
 
Vector2 Direction = Vector2.zero
 the direction this object is being pushed towards More...
 

Protected Member Functions

virtual void Awake ()
 On Awake we grab our components More...
 
virtual void Update ()
 On Update, we apply a force if needed More...
 
virtual void CheckIfGrounded ()
 Casts rays below the object to check if it's grounded this frame More...
 

Protected Attributes

CorgiController _corgiController
 
Collider2D _collider2D
 
Vector2 _leftColliderBounds
 
Vector2 _rightColliderBounds
 

Detailed Description

A class needed on pushable objects if you want your character to be able to detect them

Member Function Documentation

◆ Attach()

virtual void MoreMountains.CorgiEngine.Pushable.Attach ( CorgiController  pusher)
virtual

Attaches a pusher controller to this pushable object

Parameters
pusher

◆ Awake()

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

On Awake we grab our components

◆ CheckIfGrounded()

virtual void MoreMountains.CorgiEngine.Pushable.CheckIfGrounded ( )
protectedvirtual

Casts rays below the object to check if it's grounded this frame

◆ Detach()

virtual void MoreMountains.CorgiEngine.Pushable.Detach ( CorgiController  pusher)
virtual

Detaches the current pusher object from this pushable object

Parameters
pusher

◆ Update()

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

On Update, we apply a force if needed

Member Data Documentation

◆ _collider2D

Collider2D MoreMountains.CorgiEngine.Pushable._collider2D
protected

◆ _corgiController

CorgiController MoreMountains.CorgiEngine.Pushable._corgiController
protected

◆ _leftColliderBounds

Vector2 MoreMountains.CorgiEngine.Pushable._leftColliderBounds
protected

◆ _rightColliderBounds

Vector2 MoreMountains.CorgiEngine.Pushable._rightColliderBounds
protected

◆ Direction

Vector2 MoreMountains.CorgiEngine.Pushable.Direction = Vector2.zero

the direction this object is being pushed towards

◆ Grounded

bool MoreMountains.CorgiEngine.Pushable.Grounded = false

whether or not the object touches the ground this frame

◆ GroundedLayerMask

LayerMask MoreMountains.CorgiEngine.Pushable.GroundedLayerMask = LayerManager.ObstaclesLayerMask

the layers this object considers as ground

◆ GroundedRaycastLength

float MoreMountains.CorgiEngine.Pushable.GroundedRaycastLength = 1f

the length of the raycast we cast to detect if the object is grounded

◆ GroundedRaycastOffset

float MoreMountains.CorgiEngine.Pushable.GroundedRaycastOffset = 0.1f

the vertical offset to apply when trying to detect the ground

◆ Pusher

CorgiController MoreMountains.CorgiEngine.Pushable.Pusher

the CorgiController currently pushing this object

◆ PushSpeed

float MoreMountains.CorgiEngine.Pushable.PushSpeed = 3f

the speed at which this object can be pushed


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