Corgi Engine  v9.2
MoreMountains.CorgiEngine.Character Class Reference

This class will pilot the CorgiController component of your character. This is where you'll implement all of your character's game rules, like jump, dash, shoot, stuff like that. Animator parameters : Grounded (bool), xSpeed (float), ySpeed (float), CollidingLeft (bool), CollidingRight (bool), CollidingBelow (bool), CollidingAbove (bool), Idle (bool) Random : a random float between 0 and 1, updated every frame, useful to add variance to your state entry transitions for example RandomConstant : a random int (between 0 and 1000), generated at Start and that'll remain constant for the entire lifetime of this animator, useful to have different characters of the same type behave differently More...

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

Public Types

enum  CharacterTypes { CharacterTypes.Player, CharacterTypes.AI }
 the possible character types : player controller or AI (controlled by the computer) More...
 
enum  FacingDirections { FacingDirections.Left, FacingDirections.Right }
 the possible initial facing direction for your character More...
 
enum  SpawnFacingDirections { SpawnFacingDirections.Default, SpawnFacingDirections.Left, SpawnFacingDirections.Right }
 the possible directions you can force your character to look at after its spawn More...
 

Public Member Functions

virtual void Initialization ()
 Gets and stores input manager, camera and components More...
 
virtual void GetMainCamera ()
 Gets the main camera and stores it More...
 
virtual void CacheAbilities ()
 Grabs abilities and caches them for further use Make sure you call this if you add abilities at runtime Ideally you'll want to avoid adding components at runtime, it's costly, and it's best to activate/disable components instead. But if you need to, call this method. More...
 
FindAbility< T > ()
 A method to check whether a Character has a certain ability or not More...
 
List< T > FindAbilities< T > ()
 A method to check whether a Character has a certain ability or not More...
 
virtual void ChangeAnimator (Animator newAnimator)
 Use this method to change the character animator at runtime More...
 
virtual void AssignAnimator ()
 Binds an animator to this character More...
 
virtual void SetInputManager ()
 Gets (if it exists) the InputManager matching the Character's Player ID More...
 
virtual void SetInputManager (InputManager inputManager)
 Sets a new input manager for this Character and all its abilities More...
 
virtual void ResetInput ()
 Resets the input for all abilities More...
 
virtual void SetPlayerID (string newPlayerID)
 Sets the player ID More...
 
virtual void Freeze ()
 Freezes this character. More...
 
virtual void UnFreeze ()
 Unfreezes this character More...
 
virtual void RecalculateRays ()
 Use this method to force the controller to recalculate the rays, especially useful when the size of the character has changed. More...
 
virtual void Disable ()
 Called to disable the player (at the end of a level for example. It won't move and respond to input after this. More...
 
virtual void RespawnAt (Transform spawnPoint, FacingDirections facingDirection)
 Makes the player respawn at the location passed in parameters More...
 
virtual void Flip (bool IgnoreFlipOnDirectionChange=false)
 Flips the character and its dependencies (jetpack for example) horizontally More...
 
virtual void FlipModel ()
 Flips the model only, no impact on weapons or attachments More...
 
virtual void Face (FacingDirections facingDirection)
 Forces the character to face right or left More...
 
virtual void ChangeCharacterConditionTemporarily (CharacterStates.CharacterConditions newCondition, float duration, bool resetControllerForces, bool disableGravity)
 Use this method to change the character's condition for a specified duration, and resetting it afterwards. You can also use this to disable gravity for a while, and optionally reset forces too. More...
 
virtual void SetCameraTargetOffset (Vector3 offset)
 Sets a new offset for the camera target More...
 
virtual void Reset ()
 Called when the Character dies. Calls every abilities' Reset() method, so you can restore settings to their original value if needed More...
 

Public Attributes

CharacterTypes CharacterType = CharacterTypes.AI
 Is the character player-controlled or controlled by an AI ? More...
 
string PlayerID = ""
 Only used if the character is player-controlled. The PlayerID must match an input manager's PlayerID. It's also used to match Unity's input settings. So you'll be safe if you keep to Player1, Player2, Player3 or Player4. More...
 
FacingDirections InitialFacingDirection = FacingDirections.Right
 true if the player is facing right More...
 
SpawnFacingDirections DirectionOnSpawn = SpawnFacingDirections.Default
 the direction the character will face on spawn More...
 
Animator CharacterAnimator
 the character animator More...
 
bool UseDefaultMecanim = true
 Set this to false if you want to implement your own animation system. More...
 
bool PerformAnimatorSanityChecks = true
 If this is true, sanity checks will be performed to make sure animator parameters exist before updating them. Turning this to false will increase performance but will throw errors if you're trying to update non existing parameters. Make sure your animator has the required parameters. More...
 
bool DisableAnimatorLogs = false
 if this is true, animator logs for the associated animator will be turned off to avoid potential spam More...
 
GameObject CharacterModel
 the 'model' (can be any gameobject) used to manipulate the character. Ideally it's separated (and nested) from the collider/corgi controller/abilities, to avoid messing with collisions. More...
 
GameObject CameraTarget
 the object to use as the camera target for this character More...
 
float CameraTargetSpeed = 5f
 the speed at which the Camera Target moves More...
 
List< GameObject > AdditionalAbilityNodes
 A list of gameobjects (usually nested under the Character) under which to search for additional abilities. More...
 
bool FlipModelOnDirectionChange = true
 whether we should flip the model's scale when the character changes direction or not More...
 
Vector3 ModelFlipValue = new Vector3(-1,1,1)
 the FlipValue will be used to multiply the model's transform's localscale on flip. Usually it's -1,1,1, but feel free to change it to suit your model's specs More...
 
bool RotateModelOnDirectionChange
 whether we should rotate the model on direction change or not More...
 
Vector3 ModelRotationValue = new Vector3(0f,180f,0f)
 the rotation to apply to the model when it changes direction More...
 
float ModelRotationSpeed = 0f
 the speed at which to rotate the model when changing direction, 0f means instant rotation More...
 
Health CharacterHealth
 the Health script associated to this Character, will be grabbed automatically if left empty More...
 
bool SendStateChangeEvents = true
 If this is true, the Character's state machine will emit events when entering/exiting a state. More...
 
bool SendStateUpdateEvents = true
 If this is true, a state machine processor component will be added and it'll emit events on updates (see state machine processor's doc for more details) More...
 
float AirborneDistance = 0.5f
 The distance after which the character is considered airborne. More...
 
float AirborneMinimumTime = 0.1f
 The time (in seconds) to consider the character airborne, used to reset Jumping state. More...
 
AIBrain CharacterBrain
 The brain currently associated with this character, if it's an Advanced AI. By default the engine will pick the one on this object, but you can attach another one if you'd like. More...
 
MMStateMachine< CharacterStates.MovementStatesMovementState
 the movement state machine More...
 
MMStateMachine< CharacterStates.CharacterConditionsConditionState
 the condition state machine More...
 

Protected Member Functions

virtual void Awake ()
 Initializes this instance of the character More...
 
virtual void CacheAbilitiesAtInit ()
 Caches abilities if not already cached More...
 
virtual void UpdateInputManagersInAbilities ()
 Updates the linked input manager for all abilities More...
 
virtual void Update ()
 This is called every frame. More...
 
virtual void EveryFrame ()
 We do this every frame. This is separate from Update for more flexibility. More...
 
virtual void RotateModel ()
 
virtual void EarlyProcessAbilities ()
 Calls all registered abilities' Early Process methods More...
 
virtual void ProcessAbilities ()
 Calls all registered abilities' Process methods More...
 
virtual void LateProcessAbilities ()
 Calls all registered abilities' Late Process methods More...
 
virtual void InitializeAnimatorParameters ()
 Initializes the animator parameters. More...
 
virtual void UpdateAnimators ()
 This is called at Update() and sets each of the animators parameters to their corresponding State values More...
 
virtual void UpdateAnimationRandomNumber ()
 Generates a random number to send to the animator More...
 
virtual void HandleCharacterStatus ()
 Handles the character status. More...
 
virtual void ForceSpawnDirection ()
 Forces the character to face left or right on spawn (and respawn) More...
 
virtual IEnumerator ChangeCharacterConditionTemporarilyCo (CharacterStates.CharacterConditions newCondition, float duration, bool resetControllerForces, bool disableGravity)
 Coroutine handling the temporary change of condition mandated by ChangeCharacterConditionTemporarily More...
 
virtual void HandleCameraTarget ()
 Called every frame, makes the camera target move More...
 
virtual void OnRevive ()
 On revive, we force the spawn direction More...
 
virtual void OnDeath ()
 On character death, disables the brain and any damage on touch area More...
 
virtual void OnEnable ()
 OnEnable, we register our OnRevive event More...
 
virtual void OnDisable ()
 OnDisable, we unregister our OnRevive event More...
 

Protected Attributes

int _groundedAnimationParameter
 
int _fallingAnimationParameter
 
int _airborneSpeedAnimationParameter
 
int _xSpeedAnimationParameter
 
int _ySpeedAnimationParameter
 
int _xSpeedAbsoluteAnimationParameter
 
int _ySpeedAbsoluteAnimationParameter
 
int _worldXSpeedAnimationParameter
 
int _worldYSpeedAnimationParameter
 
int _collidingLeftAnimationParameter
 
int _collidingRightAnimationParameter
 
int _collidingBelowAnimationParameter
 
int _collidingAboveAnimationParameter
 
int _idleSpeedAnimationParameter
 
int _aliveAnimationParameter
 
int _facingRightAnimationParameter
 
int _randomAnimationParameter
 
int _randomConstantAnimationParameter
 
int _flipAnimationParameter
 
CorgiController _controller
 
SpriteRenderer _spriteRenderer
 
Color _initialColor
 
CharacterAbility[] _characterAbilities
 
float _originalGravity
 
bool _spawnDirectionForced = false
 
Vector3 _targetModelRotation
 
DamageOnTouch _damageOnTouch
 
Vector3 _cameraTargetInitialPosition
 
Vector3 _cameraOffset = Vector3.zero
 
bool _abilitiesCachedOnce = false
 
float _animatorRandomNumber
 
CharacterPersistence _characterPersistence
 
Coroutine _conditionChangeCoroutine
 
CharacterStates.CharacterConditions _lastState
 
CharacterStates.CharacterConditions _conditionStateBeforeFreeze
 

Static Protected Attributes

const string _groundedAnimationParameterName = "Grounded"
 
const string _fallingAnimationParameterName = "Falling"
 
const string _airborneAnimationParameterName = "Airborne"
 
const string _xSpeedAnimationParameterName = "xSpeed"
 
const string _ySpeedAnimationParameterName = "ySpeed"
 
const string _xSpeedAbsoluteAnimationParameterName = "xSpeedAbsolute"
 
const string _ySpeedAbsoluteAnimationParameterName = "ySpeedAbsolute"
 
const string _worldXSpeedAnimationParameterName = "WorldXSpeed"
 
const string _worldYSpeedAnimationParameterName = "WorldYSpeed"
 
const string _collidingLeftAnimationParameterName = "CollidingLeft"
 
const string _collidingRightAnimationParameterName = "CollidingRight"
 
const string _collidingBelowAnimationParameterName = "CollidingBelow"
 
const string _collidingAboveAnimationParameterName = "CollidingAbove"
 
const string _idleSpeedAnimationParameterName = "Idle"
 
const string _aliveAnimationParameterName = "Alive"
 
const string _facingRightAnimationParameterName = "FacingRight"
 
const string _randomAnimationParameterName = "Random"
 
const string _randomConstantAnimationParameterName = "RandomConstant"
 
const string _flipAnimationParameterName = "Flip"
 

Properties

CharacterStates CharacterState [get, protected set]
 the various states of the character More...
 
bool IsFacingRight [get, set]
 if this is true, the character is currently facing right More...
 
virtual bool Airborne [get]
 Whether or not the character is airborne this frame. More...
 
CameraController SceneCamera [get, protected set]
 
InputManager LinkedInputManager [get, protected set]
 associated input manager More...
 
Animator _animator [get, protected set]
 associated animator More...
 
HashSet< int > _animatorParameters [get, set]
 a list of animator parameters to update More...
 
bool CanFlip [get, set]
 whether or not the character can flip this frame More...
 

Detailed Description

This class will pilot the CorgiController component of your character. This is where you'll implement all of your character's game rules, like jump, dash, shoot, stuff like that. Animator parameters : Grounded (bool), xSpeed (float), ySpeed (float), CollidingLeft (bool), CollidingRight (bool), CollidingBelow (bool), CollidingAbove (bool), Idle (bool) Random : a random float between 0 and 1, updated every frame, useful to add variance to your state entry transitions for example RandomConstant : a random int (between 0 and 1000), generated at Start and that'll remain constant for the entire lifetime of this animator, useful to have different characters of the same type behave differently

Member Enumeration Documentation

◆ CharacterTypes

the possible character types : player controller or AI (controlled by the computer)

Enumerator
Player 
AI 

◆ FacingDirections

the possible initial facing direction for your character

Enumerator
Left 
Right 

◆ SpawnFacingDirections

the possible directions you can force your character to look at after its spawn

Enumerator
Default 
Left 
Right 

Member Function Documentation

◆ AssignAnimator()

virtual void MoreMountains.CorgiEngine.Character.AssignAnimator ( )
virtual

Binds an animator to this character

◆ Awake()

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

Initializes this instance of the character

◆ CacheAbilities()

virtual void MoreMountains.CorgiEngine.Character.CacheAbilities ( )
virtual

Grabs abilities and caches them for further use Make sure you call this if you add abilities at runtime Ideally you'll want to avoid adding components at runtime, it's costly, and it's best to activate/disable components instead. But if you need to, call this method.

◆ CacheAbilitiesAtInit()

virtual void MoreMountains.CorgiEngine.Character.CacheAbilitiesAtInit ( )
protectedvirtual

Caches abilities if not already cached

◆ ChangeAnimator()

virtual void MoreMountains.CorgiEngine.Character.ChangeAnimator ( Animator  newAnimator)
virtual

Use this method to change the character animator at runtime

Parameters
newAnimator

◆ ChangeCharacterConditionTemporarily()

virtual void MoreMountains.CorgiEngine.Character.ChangeCharacterConditionTemporarily ( CharacterStates.CharacterConditions  newCondition,
float  duration,
bool  resetControllerForces,
bool  disableGravity 
)
virtual

Use this method to change the character's condition for a specified duration, and resetting it afterwards. You can also use this to disable gravity for a while, and optionally reset forces too.

Parameters
newCondition
duration
resetControllerForces
disableGravity

◆ ChangeCharacterConditionTemporarilyCo()

virtual IEnumerator MoreMountains.CorgiEngine.Character.ChangeCharacterConditionTemporarilyCo ( CharacterStates.CharacterConditions  newCondition,
float  duration,
bool  resetControllerForces,
bool  disableGravity 
)
protectedvirtual

Coroutine handling the temporary change of condition mandated by ChangeCharacterConditionTemporarily

Parameters
newCondition
duration
resetControllerForces
disableGravity
Returns

◆ Disable()

virtual void MoreMountains.CorgiEngine.Character.Disable ( )
virtual

Called to disable the player (at the end of a level for example. It won't move and respond to input after this.

◆ EarlyProcessAbilities()

virtual void MoreMountains.CorgiEngine.Character.EarlyProcessAbilities ( )
protectedvirtual

Calls all registered abilities' Early Process methods

◆ EveryFrame()

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

We do this every frame. This is separate from Update for more flexibility.

◆ Face()

virtual void MoreMountains.CorgiEngine.Character.Face ( FacingDirections  facingDirection)
virtual

Forces the character to face right or left

Parameters
facingDirectionFacing direction.

◆ FindAbilities< T >()

List<T> MoreMountains.CorgiEngine.Character.FindAbilities< T > ( )

A method to check whether a Character has a certain ability or not

Template Parameters
T
Returns
Type Constraints
T :CharacterAbility 

◆ FindAbility< T >()

T MoreMountains.CorgiEngine.Character.FindAbility< T > ( )

A method to check whether a Character has a certain ability or not

Template Parameters
T
Returns
Type Constraints
T :CharacterAbility 

◆ Flip()

virtual void MoreMountains.CorgiEngine.Character.Flip ( bool  IgnoreFlipOnDirectionChange = false)
virtual

Flips the character and its dependencies (jetpack for example) horizontally

◆ FlipModel()

virtual void MoreMountains.CorgiEngine.Character.FlipModel ( )
virtual

Flips the model only, no impact on weapons or attachments

◆ ForceSpawnDirection()

virtual void MoreMountains.CorgiEngine.Character.ForceSpawnDirection ( )
protectedvirtual

Forces the character to face left or right on spawn (and respawn)

◆ Freeze()

virtual void MoreMountains.CorgiEngine.Character.Freeze ( )
virtual

Freezes this character.

◆ GetMainCamera()

virtual void MoreMountains.CorgiEngine.Character.GetMainCamera ( )
virtual

Gets the main camera and stores it

◆ HandleCameraTarget()

virtual void MoreMountains.CorgiEngine.Character.HandleCameraTarget ( )
protectedvirtual

Called every frame, makes the camera target move

◆ HandleCharacterStatus()

virtual void MoreMountains.CorgiEngine.Character.HandleCharacterStatus ( )
protectedvirtual

Handles the character status.

◆ Initialization()

virtual void MoreMountains.CorgiEngine.Character.Initialization ( )
virtual

Gets and stores input manager, camera and components

◆ InitializeAnimatorParameters()

virtual void MoreMountains.CorgiEngine.Character.InitializeAnimatorParameters ( )
protectedvirtual

Initializes the animator parameters.

◆ LateProcessAbilities()

virtual void MoreMountains.CorgiEngine.Character.LateProcessAbilities ( )
protectedvirtual

Calls all registered abilities' Late Process methods

◆ OnDeath()

virtual void MoreMountains.CorgiEngine.Character.OnDeath ( )
protectedvirtual

On character death, disables the brain and any damage on touch area

◆ OnDisable()

virtual void MoreMountains.CorgiEngine.Character.OnDisable ( )
protectedvirtual

OnDisable, we unregister our OnRevive event

◆ OnEnable()

virtual void MoreMountains.CorgiEngine.Character.OnEnable ( )
protectedvirtual

OnEnable, we register our OnRevive event

◆ OnRevive()

virtual void MoreMountains.CorgiEngine.Character.OnRevive ( )
protectedvirtual

On revive, we force the spawn direction

◆ ProcessAbilities()

virtual void MoreMountains.CorgiEngine.Character.ProcessAbilities ( )
protectedvirtual

Calls all registered abilities' Process methods

◆ RecalculateRays()

virtual void MoreMountains.CorgiEngine.Character.RecalculateRays ( )
virtual

Use this method to force the controller to recalculate the rays, especially useful when the size of the character has changed.

◆ Reset()

virtual void MoreMountains.CorgiEngine.Character.Reset ( )
virtual

Called when the Character dies. Calls every abilities' Reset() method, so you can restore settings to their original value if needed

◆ ResetInput()

virtual void MoreMountains.CorgiEngine.Character.ResetInput ( )
virtual

Resets the input for all abilities

◆ RespawnAt()

virtual void MoreMountains.CorgiEngine.Character.RespawnAt ( Transform  spawnPoint,
FacingDirections  facingDirection 
)
virtual

Makes the player respawn at the location passed in parameters

Parameters
spawnPointThe location of the respawn.

◆ RotateModel()

virtual void MoreMountains.CorgiEngine.Character.RotateModel ( )
protectedvirtual

◆ SetCameraTargetOffset()

virtual void MoreMountains.CorgiEngine.Character.SetCameraTargetOffset ( Vector3  offset)
virtual

Sets a new offset for the camera target

Parameters
offset

◆ SetInputManager() [1/2]

virtual void MoreMountains.CorgiEngine.Character.SetInputManager ( )
virtual

Gets (if it exists) the InputManager matching the Character's Player ID

◆ SetInputManager() [2/2]

virtual void MoreMountains.CorgiEngine.Character.SetInputManager ( InputManager  inputManager)
virtual

Sets a new input manager for this Character and all its abilities

Parameters
inputManager

◆ SetPlayerID()

virtual void MoreMountains.CorgiEngine.Character.SetPlayerID ( string  newPlayerID)
virtual

Sets the player ID

Parameters
newPlayerIDNew player ID.

◆ UnFreeze()

virtual void MoreMountains.CorgiEngine.Character.UnFreeze ( )
virtual

Unfreezes this character

◆ Update()

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

This is called every frame.

◆ UpdateAnimationRandomNumber()

virtual void MoreMountains.CorgiEngine.Character.UpdateAnimationRandomNumber ( )
protectedvirtual

Generates a random number to send to the animator

◆ UpdateAnimators()

virtual void MoreMountains.CorgiEngine.Character.UpdateAnimators ( )
protectedvirtual

This is called at Update() and sets each of the animators parameters to their corresponding State values

◆ UpdateInputManagersInAbilities()

virtual void MoreMountains.CorgiEngine.Character.UpdateInputManagersInAbilities ( )
protectedvirtual

Updates the linked input manager for all abilities

Member Data Documentation

◆ _abilitiesCachedOnce

bool MoreMountains.CorgiEngine.Character._abilitiesCachedOnce = false
protected

◆ _airborneAnimationParameterName

const string MoreMountains.CorgiEngine.Character._airborneAnimationParameterName = "Airborne"
staticprotected

◆ _airborneSpeedAnimationParameter

int MoreMountains.CorgiEngine.Character._airborneSpeedAnimationParameter
protected

◆ _aliveAnimationParameter

int MoreMountains.CorgiEngine.Character._aliveAnimationParameter
protected

◆ _aliveAnimationParameterName

const string MoreMountains.CorgiEngine.Character._aliveAnimationParameterName = "Alive"
staticprotected

◆ _animatorRandomNumber

float MoreMountains.CorgiEngine.Character._animatorRandomNumber
protected

◆ _cameraOffset

Vector3 MoreMountains.CorgiEngine.Character._cameraOffset = Vector3.zero
protected

◆ _cameraTargetInitialPosition

Vector3 MoreMountains.CorgiEngine.Character._cameraTargetInitialPosition
protected

◆ _characterAbilities

CharacterAbility [] MoreMountains.CorgiEngine.Character._characterAbilities
protected

◆ _characterPersistence

CharacterPersistence MoreMountains.CorgiEngine.Character._characterPersistence
protected

◆ _collidingAboveAnimationParameter

int MoreMountains.CorgiEngine.Character._collidingAboveAnimationParameter
protected

◆ _collidingAboveAnimationParameterName

const string MoreMountains.CorgiEngine.Character._collidingAboveAnimationParameterName = "CollidingAbove"
staticprotected

◆ _collidingBelowAnimationParameter

int MoreMountains.CorgiEngine.Character._collidingBelowAnimationParameter
protected

◆ _collidingBelowAnimationParameterName

const string MoreMountains.CorgiEngine.Character._collidingBelowAnimationParameterName = "CollidingBelow"
staticprotected

◆ _collidingLeftAnimationParameter

int MoreMountains.CorgiEngine.Character._collidingLeftAnimationParameter
protected

◆ _collidingLeftAnimationParameterName

const string MoreMountains.CorgiEngine.Character._collidingLeftAnimationParameterName = "CollidingLeft"
staticprotected

◆ _collidingRightAnimationParameter

int MoreMountains.CorgiEngine.Character._collidingRightAnimationParameter
protected

◆ _collidingRightAnimationParameterName

const string MoreMountains.CorgiEngine.Character._collidingRightAnimationParameterName = "CollidingRight"
staticprotected

◆ _conditionChangeCoroutine

Coroutine MoreMountains.CorgiEngine.Character._conditionChangeCoroutine
protected

◆ _conditionStateBeforeFreeze

CharacterStates.CharacterConditions MoreMountains.CorgiEngine.Character._conditionStateBeforeFreeze
protected

◆ _controller

CorgiController MoreMountains.CorgiEngine.Character._controller
protected

◆ _damageOnTouch

DamageOnTouch MoreMountains.CorgiEngine.Character._damageOnTouch
protected

◆ _facingRightAnimationParameter

int MoreMountains.CorgiEngine.Character._facingRightAnimationParameter
protected

◆ _facingRightAnimationParameterName

const string MoreMountains.CorgiEngine.Character._facingRightAnimationParameterName = "FacingRight"
staticprotected

◆ _fallingAnimationParameter

int MoreMountains.CorgiEngine.Character._fallingAnimationParameter
protected

◆ _fallingAnimationParameterName

const string MoreMountains.CorgiEngine.Character._fallingAnimationParameterName = "Falling"
staticprotected

◆ _flipAnimationParameter

int MoreMountains.CorgiEngine.Character._flipAnimationParameter
protected

◆ _flipAnimationParameterName

const string MoreMountains.CorgiEngine.Character._flipAnimationParameterName = "Flip"
staticprotected

◆ _groundedAnimationParameter

int MoreMountains.CorgiEngine.Character._groundedAnimationParameter
protected

◆ _groundedAnimationParameterName

const string MoreMountains.CorgiEngine.Character._groundedAnimationParameterName = "Grounded"
staticprotected

◆ _idleSpeedAnimationParameter

int MoreMountains.CorgiEngine.Character._idleSpeedAnimationParameter
protected

◆ _idleSpeedAnimationParameterName

const string MoreMountains.CorgiEngine.Character._idleSpeedAnimationParameterName = "Idle"
staticprotected

◆ _initialColor

Color MoreMountains.CorgiEngine.Character._initialColor
protected

◆ _lastState

CharacterStates.CharacterConditions MoreMountains.CorgiEngine.Character._lastState
protected

◆ _originalGravity

float MoreMountains.CorgiEngine.Character._originalGravity
protected

◆ _randomAnimationParameter

int MoreMountains.CorgiEngine.Character._randomAnimationParameter
protected

◆ _randomAnimationParameterName

const string MoreMountains.CorgiEngine.Character._randomAnimationParameterName = "Random"
staticprotected

◆ _randomConstantAnimationParameter

int MoreMountains.CorgiEngine.Character._randomConstantAnimationParameter
protected

◆ _randomConstantAnimationParameterName

const string MoreMountains.CorgiEngine.Character._randomConstantAnimationParameterName = "RandomConstant"
staticprotected

◆ _spawnDirectionForced

bool MoreMountains.CorgiEngine.Character._spawnDirectionForced = false
protected

◆ _spriteRenderer

SpriteRenderer MoreMountains.CorgiEngine.Character._spriteRenderer
protected

◆ _targetModelRotation

Vector3 MoreMountains.CorgiEngine.Character._targetModelRotation
protected

◆ _worldXSpeedAnimationParameter

int MoreMountains.CorgiEngine.Character._worldXSpeedAnimationParameter
protected

◆ _worldXSpeedAnimationParameterName

const string MoreMountains.CorgiEngine.Character._worldXSpeedAnimationParameterName = "WorldXSpeed"
staticprotected

◆ _worldYSpeedAnimationParameter

int MoreMountains.CorgiEngine.Character._worldYSpeedAnimationParameter
protected

◆ _worldYSpeedAnimationParameterName

const string MoreMountains.CorgiEngine.Character._worldYSpeedAnimationParameterName = "WorldYSpeed"
staticprotected

◆ _xSpeedAbsoluteAnimationParameter

int MoreMountains.CorgiEngine.Character._xSpeedAbsoluteAnimationParameter
protected

◆ _xSpeedAbsoluteAnimationParameterName

const string MoreMountains.CorgiEngine.Character._xSpeedAbsoluteAnimationParameterName = "xSpeedAbsolute"
staticprotected

◆ _xSpeedAnimationParameter

int MoreMountains.CorgiEngine.Character._xSpeedAnimationParameter
protected

◆ _xSpeedAnimationParameterName

const string MoreMountains.CorgiEngine.Character._xSpeedAnimationParameterName = "xSpeed"
staticprotected

◆ _ySpeedAbsoluteAnimationParameter

int MoreMountains.CorgiEngine.Character._ySpeedAbsoluteAnimationParameter
protected

◆ _ySpeedAbsoluteAnimationParameterName

const string MoreMountains.CorgiEngine.Character._ySpeedAbsoluteAnimationParameterName = "ySpeedAbsolute"
staticprotected

◆ _ySpeedAnimationParameter

int MoreMountains.CorgiEngine.Character._ySpeedAnimationParameter
protected

◆ _ySpeedAnimationParameterName

const string MoreMountains.CorgiEngine.Character._ySpeedAnimationParameterName = "ySpeed"
staticprotected

◆ AdditionalAbilityNodes

List<GameObject> MoreMountains.CorgiEngine.Character.AdditionalAbilityNodes

A list of gameobjects (usually nested under the Character) under which to search for additional abilities.

◆ AirborneDistance

float MoreMountains.CorgiEngine.Character.AirborneDistance = 0.5f

The distance after which the character is considered airborne.

◆ AirborneMinimumTime

float MoreMountains.CorgiEngine.Character.AirborneMinimumTime = 0.1f

The time (in seconds) to consider the character airborne, used to reset Jumping state.

◆ CameraTarget

GameObject MoreMountains.CorgiEngine.Character.CameraTarget

the object to use as the camera target for this character

◆ CameraTargetSpeed

float MoreMountains.CorgiEngine.Character.CameraTargetSpeed = 5f

the speed at which the Camera Target moves

◆ CharacterAnimator

Animator MoreMountains.CorgiEngine.Character.CharacterAnimator

the character animator

◆ CharacterBrain

AIBrain MoreMountains.CorgiEngine.Character.CharacterBrain

The brain currently associated with this character, if it's an Advanced AI. By default the engine will pick the one on this object, but you can attach another one if you'd like.

◆ CharacterHealth

Health MoreMountains.CorgiEngine.Character.CharacterHealth

the Health script associated to this Character, will be grabbed automatically if left empty

◆ CharacterModel

GameObject MoreMountains.CorgiEngine.Character.CharacterModel

the 'model' (can be any gameobject) used to manipulate the character. Ideally it's separated (and nested) from the collider/corgi controller/abilities, to avoid messing with collisions.

◆ CharacterType

CharacterTypes MoreMountains.CorgiEngine.Character.CharacterType = CharacterTypes.AI

Is the character player-controlled or controlled by an AI ?

◆ ConditionState

MMStateMachine<CharacterStates.CharacterConditions> MoreMountains.CorgiEngine.Character.ConditionState

the condition state machine

◆ DirectionOnSpawn

SpawnFacingDirections MoreMountains.CorgiEngine.Character.DirectionOnSpawn = SpawnFacingDirections.Default

the direction the character will face on spawn

◆ DisableAnimatorLogs

bool MoreMountains.CorgiEngine.Character.DisableAnimatorLogs = false

if this is true, animator logs for the associated animator will be turned off to avoid potential spam

◆ FlipModelOnDirectionChange

bool MoreMountains.CorgiEngine.Character.FlipModelOnDirectionChange = true

whether we should flip the model's scale when the character changes direction or not

◆ InitialFacingDirection

FacingDirections MoreMountains.CorgiEngine.Character.InitialFacingDirection = FacingDirections.Right

true if the player is facing right

◆ ModelFlipValue

Vector3 MoreMountains.CorgiEngine.Character.ModelFlipValue = new Vector3(-1,1,1)

the FlipValue will be used to multiply the model's transform's localscale on flip. Usually it's -1,1,1, but feel free to change it to suit your model's specs

◆ ModelRotationSpeed

float MoreMountains.CorgiEngine.Character.ModelRotationSpeed = 0f

the speed at which to rotate the model when changing direction, 0f means instant rotation

◆ ModelRotationValue

Vector3 MoreMountains.CorgiEngine.Character.ModelRotationValue = new Vector3(0f,180f,0f)

the rotation to apply to the model when it changes direction

◆ MovementState

MMStateMachine<CharacterStates.MovementStates> MoreMountains.CorgiEngine.Character.MovementState

the movement state machine

◆ PerformAnimatorSanityChecks

bool MoreMountains.CorgiEngine.Character.PerformAnimatorSanityChecks = true

If this is true, sanity checks will be performed to make sure animator parameters exist before updating them. Turning this to false will increase performance but will throw errors if you're trying to update non existing parameters. Make sure your animator has the required parameters.

◆ PlayerID

string MoreMountains.CorgiEngine.Character.PlayerID = ""

Only used if the character is player-controlled. The PlayerID must match an input manager's PlayerID. It's also used to match Unity's input settings. So you'll be safe if you keep to Player1, Player2, Player3 or Player4.

◆ RotateModelOnDirectionChange

bool MoreMountains.CorgiEngine.Character.RotateModelOnDirectionChange

whether we should rotate the model on direction change or not

◆ SendStateChangeEvents

bool MoreMountains.CorgiEngine.Character.SendStateChangeEvents = true

If this is true, the Character's state machine will emit events when entering/exiting a state.

◆ SendStateUpdateEvents

bool MoreMountains.CorgiEngine.Character.SendStateUpdateEvents = true

If this is true, a state machine processor component will be added and it'll emit events on updates (see state machine processor's doc for more details)

◆ UseDefaultMecanim

bool MoreMountains.CorgiEngine.Character.UseDefaultMecanim = true

Set this to false if you want to implement your own animation system.

Property Documentation

◆ _animator

Animator MoreMountains.CorgiEngine.Character._animator
getprotected set

associated animator

◆ _animatorParameters

HashSet<int> MoreMountains.CorgiEngine.Character._animatorParameters
getset

a list of animator parameters to update

◆ Airborne

virtual bool MoreMountains.CorgiEngine.Character.Airborne
get

Whether or not the character is airborne this frame.

◆ CanFlip

bool MoreMountains.CorgiEngine.Character.CanFlip
getset

whether or not the character can flip this frame

◆ CharacterState

CharacterStates MoreMountains.CorgiEngine.Character.CharacterState
getprotected set

the various states of the character

◆ IsFacingRight

bool MoreMountains.CorgiEngine.Character.IsFacingRight
getset

if this is true, the character is currently facing right

◆ LinkedInputManager

InputManager MoreMountains.CorgiEngine.Character.LinkedInputManager
getprotected set

associated input manager

◆ SceneCamera

CameraController MoreMountains.CorgiEngine.Character.SceneCamera
getprotected set

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