Corgi Engine
v9.0
|
This class lets you grab, carry and throw objects with a GrabCarryAndThrowObject component. More...
Public Member Functions | |
override string | HelpBoxText () |
This method is only used to display a helpbox text at the beginning of the ability's inspector. More... | |
override void | UpdateAnimator () |
At the end of each cycle, we update our animator parameters with our current state More... | |
override void | ResetAbility () |
On reset ability, we cancel all the changes made More... | |
Public Member Functions inherited from MoreMountains.CorgiEngine.CharacterAbility | |
virtual void | SetInputManager (InputManager inputManager) |
Sets a new input manager for this ability to get input from More... | |
virtual void | BindAnimator () |
Binds the animator from the character and initializes the animator parameters More... | |
virtual void | ResetInput () |
Resets all input for this ability. Can be overridden for ability specific directives More... | |
virtual void | EarlyProcessAbility () |
The first of the 3 passes you can have in your ability. Think of it as EarlyUpdate() if it existed More... | |
virtual void | ProcessAbility () |
The second of the 3 passes you can have in your ability. Think of it as Update() More... | |
virtual void | LateProcessAbility () |
The last of the 3 passes you can have in your ability. Think of it as LateUpdate() More... | |
virtual void | PermitAbility (bool abilityPermitted) |
Changes the status of the ability's permission More... | |
virtual void | Flip () |
Override this to specify what should happen in this ability when the character flips More... | |
virtual void | PlayAbilityStartFeedbacks () |
Plays the ability start sound effect More... | |
virtual void | StopStartFeedbacks () |
Stops the ability used sound effect More... | |
virtual void | PlayAbilityStopFeedbacks () |
Plays the ability stop sound effect More... | |
virtual void | RegisterAnimatorParameter (string parameterName, AnimatorControllerParameterType parameterType, out int parameter) |
Registers a new animator parameter to the list More... | |
Public Attributes | |
Vector3 | RaycastDirection = Vector3.down |
float | RaycastDistance = 1f |
the distance the grab raycast should cover (you'll want it bigger than half your Character's dimensions More... | |
LayerMask | DetectionLayerMask = LayerManager.PlatformsLayerMask | LayerManager.EnemiesLayerMask |
the layer this grab raycast should look for objects on. This should match the layer you put your GrabCarryAndThrowObjects on More... | |
bool | Grabbing = false |
whether or not this Character is grabbing something right now More... | |
Transform | CarryParent |
a Transform used to attach carried objects to More... | |
bool | Carrying = false |
whether or not this Character is carrying an object this frame More... | |
int | CarryingID = -1 |
the ID of the object being carried More... | |
GrabCarryAndThrowObject | CarriedObject = null |
a reference to the object being carried More... | |
float | ThrowForce = 1f |
the force to apply when throwing More... | |
float | RecoilModifier = 1f |
a modifier to apply to the recoil set on the object More... | |
bool | Throwing = false |
whether or not this Character is throwing something this frame More... | |
bool | PreventThrowIfCarryingOnGrab = false |
whether or not to allow the character to throw if next to a grabbable object More... | |
Public Attributes inherited from MoreMountains.CorgiEngine.CharacterAbility | |
MMFeedbacks | AbilityStartFeedbacks |
the feedbacks to play when the ability starts More... | |
MMFeedbacks | AbilityStopFeedbacks |
the feedbacks to play when the ability stops More... | |
bool | AbilityPermitted = true |
if true, this ability can perform as usual, if not, it'll be ignored. You can use this to unlock abilities over time for example More... | |
CharacterStates.MovementStates[] | BlockingMovementStates |
an array containing all the blocking movement states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while Idle or Swimming, for example. More... | |
CharacterStates.CharacterConditions[] | BlockingConditionStates |
an array containing all the blocking condition states. If the Character is in one of these states and tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while dead, for example. More... | |
Weapon.WeaponStates[] | BlockingWeaponStates |
an array containing all the blocking weapon states. If one of the character's weapons is in one of these states and yet the character tries to trigger this ability, it won't be permitted. Useful to prevent this ability from being used while attacking, for example. More... | |
Protected Member Functions | |
override void | Initialization () |
On init we set our CarryParent to the character transform if null More... | |
override void | HandleInput () |
Looks for throw and grab inputs More... | |
virtual void | GrabAttempt () |
Tries to grab by casting a raycast More... | |
virtual GrabCarryAndThrowObject | GetGrababbleObject () |
virtual void | Grab () |
Sets the ability in carrying mode More... | |
virtual void | Throw () |
Throws the carried object More... | |
virtual void | StopFeedbacks () |
Stops all feedbacks More... | |
virtual void | LateUpdate () |
On late update we reset our states More... | |
override void | InitializeAnimatorParameters () |
Adds required animator parameters to the animator parameters list if they exist More... | |
Protected Member Functions inherited from MoreMountains.CorgiEngine.CharacterAbility | |
virtual void | Start () |
On Start(), we call the ability's intialization More... | |
virtual void | InternalHandleInput () |
Internal method to check if an input manager is present or not More... | |
virtual void | OnRespawn () |
Override this to describe what should happen to this ability when the character respawns More... | |
virtual void | OnDeath () |
Override this to describe what should happen to this ability when the character respawns More... | |
virtual void | OnHit () |
Override this to describe what should happen to this ability when the character takes a hit More... | |
virtual void | OnEnable () |
On enable, we bind our respawn delegate More... | |
virtual void | OnDisable () |
On disable, we unbind our respawn delegate More... | |
Protected Attributes | |
Vector2 | _raycastOrigin |
Vector2 | _recoilVector |
int | _grabbingAnimationParameter |
int | _carryingAnimationParameter |
int | _carryingIDAnimationParameter |
int | _throwingAnimationParameter |
Vector3 | _actualRaycastDirection |
Protected Attributes inherited from MoreMountains.CorgiEngine.CharacterAbility | |
Character | _character |
Transform | _characterTransform |
Health | _health |
CharacterHorizontalMovement | _characterHorizontalMovement |
CorgiController | _controller |
InputManager | _inputManager |
CameraController | _sceneCamera |
Animator | _animator |
CharacterStates | _state |
SpriteRenderer | _spriteRenderer |
MMStateMachine< CharacterStates.MovementStates > | _movement |
MMStateMachine< CharacterStates.CharacterConditions > | _condition |
bool | _abilityInitialized = false |
CharacterGravity | _characterGravity |
float | _verticalInput |
float | _horizontalInput |
bool | _startFeedbackIsPlaying = false |
List< CharacterHandleWeapon > | _handleWeaponList |
Static Protected Attributes | |
const string | _grabbingAnimationParameterName = "Grabbing" |
const string | _carryingAnimationParameterName = "Carrying" |
const string | _carryingIDAnimationParameterName = "CarryingID" |
const string | _throwingAnimationParameterName = "Throwing" |
Additional Inherited Members | |
Properties inherited from MoreMountains.CorgiEngine.CharacterAbility | |
virtual bool | AbilityAuthorized [get] |
virtual bool | AbilityInitialized [get] |
true if the ability has already been initialized More... | |
This class lets you grab, carry and throw objects with a GrabCarryAndThrowObject component.
Animation parameters :
|
protectedvirtual |
|
protectedvirtual |
Sets the ability in carrying mode
|
protectedvirtual |
Tries to grab by casting a raycast
|
protectedvirtual |
Looks for throw and grab inputs
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
virtual |
This method is only used to display a helpbox text at the beginning of the ability's inspector.
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
On init we set our CarryParent to the character transform if null
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Adds required animator parameters to the animator parameters list if they exist
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
On late update we reset our states
|
virtual |
On reset ability, we cancel all the changes made
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protectedvirtual |
Stops all feedbacks
|
protectedvirtual |
Throws the carried object
|
virtual |
At the end of each cycle, we update our animator parameters with our current state
Reimplemented from MoreMountains.CorgiEngine.CharacterAbility.
|
protected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
staticprotected |
|
protected |
|
protected |
|
protected |
|
staticprotected |
GrabCarryAndThrowObject MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.CarriedObject = null |
a reference to the object being carried
bool MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.Carrying = false |
whether or not this Character is carrying an object this frame
int MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.CarryingID = -1 |
the ID of the object being carried
Transform MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.CarryParent |
a Transform used to attach carried objects to
LayerMask MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.DetectionLayerMask = LayerManager.PlatformsLayerMask | LayerManager.EnemiesLayerMask |
the layer this grab raycast should look for objects on. This should match the layer you put your GrabCarryAndThrowObjects on
bool MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.Grabbing = false |
whether or not this Character is grabbing something right now
bool MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.PreventThrowIfCarryingOnGrab = false |
whether or not to allow the character to throw if next to a grabbable object
Vector3 MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.RaycastDirection = Vector3.down |
the direction the raycast used to detect grabbable objects will be cast in (if the Character is facing right). Use Vector3.down for Mario2-like grabs from the top, or Vector3.right for side grabs for example.
float MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.RaycastDistance = 1f |
the distance the grab raycast should cover (you'll want it bigger than half your Character's dimensions
float MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.RecoilModifier = 1f |
a modifier to apply to the recoil set on the object
float MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.ThrowForce = 1f |
the force to apply when throwing
bool MoreMountains.CorgiEngine.CharacterGrabCarryAndThrow.Throwing = false |
whether or not this Character is throwing something this frame