Summary
Base class for the various states a
Animancer.Samples.AnimatorControllers.GameKit.Character can be in and actions they can perform.
- Assembly
- Animancer
.dll - Namespace
- Animancer
.Samples .AnimatorControllers .GameKit - Interfaces
- Base Types
-
- MonoBehaviour
- StateBehaviour
- Derived Types
graph BT
Type-->Base0["StateBehaviour"]
click Base0 "/animancer/api/Animancer.FSM/StateBehaviour"
Base0-->Base1["MonoBehaviour"]
Type-.->Interface0["IOwnedState<CharacterState>"]
Type-.->Interface1["IState"]
click Interface1 "/animancer/api/Animancer.FSM/IState"
Type["CharacterState"]
class Type type-node
Derived0["LocomotionState"]-->Type
click Derived0 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/LocomotionState"
Derived1["AttackState"]-->Type
click Derived1 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/AttackState"
Derived2["IdleState"]-->Type
click Derived2 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/IdleState"
Derived3["LandingState"]-->Type
click Derived3 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/LandingState"
Derived4["RespawnState"]-->Type
click Derived4 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/RespawnState"
Derived5["AirborneState"]-->Type
click Derived5 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/AirborneState"
Derived6["FlinchState"]-->Type
click Derived6 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/FlinchState"
Derived7["DieState"]-->Type
click Derived7 "/animancer/api/Animancer.Samples.AnimatorControllers.GameKit/DieState"
Syntax
[AddComponentMenu(Strings.SamplesMenuPrefix + "Game Kit - Character State")]
[AnimancerHelpUrl(typeof(CharacterState))]
public abstract class CharacterState : StateBehaviour, IOwnedState<CharacterState>, IState
Remarks
Sample:
3D Game Kit
Attributes
| Type | Description |
|---|---|
| AddComponentMenu | |
| Animancer |
[Assert-Conditional]
A UnityEngine.HelpURLAttribute which points to Animancer's documentation.
|
Properties
| Name | Value | Summary |
|---|---|---|
| CanEnterState | bool |
[
Animancer.FSM.IState.CanEnterState]
Determines whether the Animancer.FSM.StateMachine`1 can enter this state.
Always returns true unless overridden.
Inherited from StateBehaviour
|
| CanExitState | bool |
[
Animancer.FSM.IState.CanExitState]
Determines whether the Animancer.FSM.StateMachine`1 can exit this state.
Always returns true unless overridden.
Inherited from StateBehaviour
|
| Character | Character | |
| Force |
bool |
[Editor-Only]
Should the Inspector be repainted when a
Animancer.FSM.StateBehaviour
is enabled or disabled while it is selected?
Inherited from StateBehaviour
static
|
| FullMovementControl | bool |
Indicates whether the root motion applied each frame while this state is active should be constrained to
only move in the specified
CharacterBrain.Movement. Otherwise the root motion can
move the Animancer.Samples.AnimatorControllers.GameKit.CharacterState.Character in any direction. Default is true.
|
| OwnerStateMachine | StateMachine |
The
Animancer.FSM.StateMachine`1 that this state is used in. |
| RootMotion | Vector3 |
Some states (such as
Animancer.Samples.AnimatorControllers.GameKit.AirborneState) will want to apply their own source of root motion, but
most will just use the root motion from the animations.
|
| StickToGround | bool |
Jumping enters the
Animancer.Samples.AnimatorControllers.GameKit.AirborneState, but UnityEngine.CharacterController.isGrounded doesn't
become false until after the first update, so we want to make sure the Animancer.Samples.AnimatorControllers.GameKit.CharacterState.Character won't stick
to the ground during that update.
|
Methods
| Name | Value | Summary |
|---|---|---|
| OnEnterState |
void |
[
Animancer.FSM.IState.OnEnterState]
Asserts that this component isn't already enabled, then enables it.
Inherited from StateBehaviour
|
| OnExitState |
void |
[
Animancer.FSM.IState.OnExitState]
Asserts that this component isn't already disabled, then disables it.
Inherited from StateBehaviour
|
| OnValidate |
void |
[Editor-Only] States start disabled and only the current state gets enabled at runtime.
|