Adventure Creator
1.79.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2022
|
Public Member Functions | |
virtual bool | IsCapableOfJumping () |
virtual bool | IsActivePlayer () |
virtual void | _Update () |
virtual void | _LateUpdate () |
virtual void | _FixedUpdate () |
void | RecalculateActivePathfind () |
bool | AccurateDestination () |
Checks if the character should attempt to be as accurate as possible when moving to a destination. More... | |
void | Teleport (Vector3 _position, bool recalculateActivePathFind=false) |
Teleports the character. The message 'OnTeleport' will be sent to the character's GameObject after the position is set. More... | |
void | SetRotation (Quaternion _rotation) |
Instantly rotates the character More... | |
void | SetRotation (float angle) |
Instantly rotates the Player More... | |
void | StopTurning () |
virtual void | StopTankTurning () |
float | GetAngleDifference () |
Gets the difference between the character's current facing angle, and the angle they wish to face. More... | |
void | SetLookDirection (Vector3 _direction, bool isInstant) |
Sets the intended direction to face. More... | |
void | SetMoveDirection (Vector3 _direction, bool useSmoothing=false) |
Moves the character in a particular direction. More... | |
void | SetMoveDirectionAsForward () |
void | SetMoveDirectionAsBackward () |
Animation | GetAnimation () |
Gets the character's Animation component. More... | |
Animator | GetAnimator () |
Gets the character's Animator component. An Animator placed on the spriteChild GameObject will be given priority. More... | |
void | ResetAnimator () |
Vector3 | GetMoveDirection () |
Gets the direction that the character is moving in. More... | |
bool | WillStopAtNextNode () |
Checks if the character is pathfinding, and the next node on the path will be their intended destination More... | |
bool | IsPathfinding () |
Checks if the character is currently pathfinding to a pre-determined destination More... | |
void | EndPath (Paths optionalPath, bool stopTurningToo=true) |
Stops the character from moving along the current Paths object. More... | |
void | StartDecelerating () |
virtual void | EndPath () |
void | ResumeLastPath () |
void | ForgetLastPath () |
void | Halt (bool haltTurning=true) |
Stops the character moving. More... | |
void | ForceIdle () |
bool | IsTurningBeforeWalking () |
Checks if the character is spot-turning before making their move. isTurningBeforeWalking must be True for this to ever be the case. More... | |
void | SetPath (Paths pathOb, PathSpeed _speed) |
Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More... | |
void | SetPath (Paths pathOb) |
Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More... | |
void | SetPath (Paths pathOb, int _targetNode, int _prevNode) |
Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More... | |
void | SetPath (Paths pathOb, int _targetNode, int _prevNode, bool affectY) |
Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined. More... | |
Paths | GetPath () |
Gets the current Paths object that the character is moving along. If the character is pathfinding, the Paths component on the character's root will be returned. More... | |
int | GetTargetNode () |
int | GetPreviousNode () |
Paths | GetLastPath () |
void | MoveToPoint (Vector3 point, bool run=false, bool usePathfinding=false) |
Moves towards a point in the scene. More... | |
void | MoveAlongPoints (Vector3[] pointData, bool run, bool allowUpdating=true) |
Moves along a series of points in the scene. More... | |
void | ResetBaseClips () |
float | GetSpriteAngle () |
Gets the angle that a 2D character's sprite is facing, relative to the root. More... | |
string | GetSpriteDirection (bool ignoreFrameFlipping=false) |
Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR". More... | |
int | GetSpriteDirectionInt (bool ignoreFrameFlipping=false) |
Gets the direction that a 2D character is facing (Down = 0, Left = 1, Right = 2, Up = 3, DownLeft = 4, DownRight = 5, UpLeft = 6, UpRight = 7) More... | |
void | SetSpriteDirection (CharDirection direction) |
Locks a 2D character's sprite to face a particular direction. More... | |
void | ResetAnimationEngine () |
float | FlattenSpriteAngle (float angle, AngleSnapping _angleSnapping) |
Snaps a given angle to the nearest 90 or 45 degrees More... | |
void | SetSorting (int order) |
Locks the Renderer's sortingOrder. More... | |
void | SetSorting (string layer) |
Locks the Renderer's sorting layer. More... | |
void | ReleaseSorting () |
float | GetMoveSpeed (bool reduceNonFacing=false) |
Gets the current movement speed. More... | |
virtual void | SetHeadTurnTarget (Transform _headTurnTarget, Vector3 _headTurnTargetOffset, bool isInstant, HeadFacing _headFacing=HeadFacing.Manual) |
Controls the head-facing position. More... | |
void | ClearHeadTurnTarget (bool isInstant, HeadFacing _headFacing) |
Ceases a particular type of head-facing. More... | |
void | ClearHeadTurnTarget (bool isInstant) |
Stops the head from facing a fixed point. More... | |
void | SnapHeadMovement () |
bool | IsMovingHead () |
Checks if the head is rotating to face its target, but has not yet reached it. More... | |
Shapeable | GetShapeable () |
Gets the Shapeable script component attached to the GameObject's root or child. More... | |
Vector3 | GetHeadTurnTarget () |
Gets the position of where the character's head is facing towards. More... | |
Transform | GetHandTransform (Hand hand) |
bool | HoldObject (GameObject objectToHold, Hand hand) |
Parents an object to the character's hand More... | |
void | ReleaseHeldObjects (bool delete) |
void | ReleaseHeldObject (Hand hand, bool delete) |
Vector3 | GetSpeechWorldPosition () |
Gets the position of the top of the character, in world-space. More... | |
Vector2 | GetSpeechScreenPosition (bool keepWithinScreen=true) |
Gets the position of the top of the character, in screen-space. More... | |
void | StartLipSync (List< LipSyncShape > _lipSyncShapes) |
Begins a lip-syncing animation based on a series of LipSyncShapes. More... | |
int | GetLipSyncFrame () |
Gets the current lip-sync frame. More... | |
float | GetLipSyncNormalised () |
Gets the current lip-sync frame, as a fraction of the total number of phoneme frames. More... | |
bool | LipSyncGameObject () |
Checks if the character is playing a lip-sync animation that affects the GameObject. More... | |
void | StopSpeaking () |
int | GetExpressionID (string expressionLabel) |
Gets the ID number of the Expression that has a specific label. More... | |
int | GetExpressionID () |
Gets the ID number of the currently-active Expression. More... | |
void | ClearExpression () |
Clears the current Expression so that the default portrait icon is used. More... | |
void | SetExpression (int ID) |
Changes the active Expression. More... | |
void | SetExpression (string _name) |
Changes the active Expression. More... | |
CursorIconBase | GetPortrait () |
Gets the active portrait that's displayed in a MenuGraphic element when the character speaks. The portrait can change if an Expression has been defined. More... | |
bool | IsGrounded (bool reportError=false) |
Checks if the character (if 3D) is in contact with the ground. More... | |
MotionControl | GetMotionControl () |
Gets the extent to which motion is controlled by the character script (Automatic, JustTurning, Manual). More... | |
Vector3 | GetTargetPosition (bool wantFinalDestination=false) |
Gets the character's destination when walking along a path. More... | |
Quaternion | GetTargetRotation () |
Gets the character's target rotation. More... | |
Quaternion | GetFrameRotation () |
Gets the character's calculated rotation for this frame. This is not the same as GetTargetRotation, which is the 'final' rotation, but instead the rotation that a smoothly-rotated character should take. More... | |
AnimEngine | GetAnimEngine () |
Gets the character's AnimEngine ScriptableObject. More... | |
void | SetAnimEngine (AnimationEngine _animationEngine, string customClassName="") |
Sets the character's AnimEngine ScriptableObject. More... | |
float | GetHeightChange () |
Gets the character's change in height over the last frame. More... | |
bool | IsReversing () |
Checks if the character is moving backwards. More... | |
virtual float | GetTurnFloat () |
Gets the rate at which the character is turning (negative values used when turning anti-clockwise). More... | |
bool | IsTurning () |
Checks if the character is turning. More... | |
bool | IsTurning (float maxAngleThreshold) |
Checks if the character is turning. More... | |
bool | IsMovingAlongPath () |
Checks if the character is moving along a path. More... | |
string | GetName (int languageNumber=0) |
Gets the Character's current display name. More... | |
void | SetName (string newName, int _lineID) |
Renames the Character mid-game. More... | |
void | SetSpeechVolume (float volume) |
Updates the volume level of the Character's speech audio. More... | |
Speech | GetCurrentSpeech () |
Gets the character's current speech line More... | |
void | OnEnterTimeline (PlayableDirector director, int trackIndex) |
Called whenever the character is bound to a Timeline track that's starting, and used to deactivate certain control components to allow them freedom. More... | |
void | OnExitTimeline (PlayableDirector director, int trackIndex) |
Called whenever the character is bound to a Timeline track that's ending, and used to re-activate certain control components. More... | |
Sprite | GetPortraitSprite () |
Gets a Sprite based on the portrait graphic of the character. If lipsincing is enabled, the sprite will be based on the current phoneme. More... | |
string | GetTranslatableString (int index) |
Gets the text to be translated, given its index. More... | |
int | GetTranslationID (int index) |
Gets the translation ID of a given text index. More... | |
AC_TextType | GetTranslationType (int index) |
Gets the translation type of a given text index. More... | |
void | UpdateTranslatableString (int index, string updatedText) |
int | GetNumTranslatables () |
Gets the maximum number of possible translatable texts. More... | |
bool | HasExistingTranslation (int index) |
Checks if a given text index has already been assigned a unique translation ID. More... | |
void | SetTranslationID (int index, int _lineID) |
Sets the translation ID of a given text index More... | |
string | GetOwner (int index) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element. More... | |
bool | OwnerIsPlayer (int index) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line. More... | |
bool | CanTranslate (int index) |
Checks if a given text index can and should be translated. More... | |
void | SetTimelineHeadTurnOverride (Transform _timelineHeadTurnTarget, Vector3 _timelineHeadTurnTargetOffset, float _timelineHeadTurnWeight) |
void | ReleaseTimelineHeadTurnOverride () |
Protected Member Functions | |
virtual void | _Awake () |
virtual void | OnEnable () |
virtual void | OnDisable () |
void | BaseUpdate () |
void | PathUpdate () |
float | GetTargetSpeed () |
void | AccurateAcc (float targetSpeed, bool canStop) |
virtual void | Accelerate () |
void | SetLastPath (Paths _lastPathActivePath, int _lastPathTargetNode, int _lastPathPrevNode) |
void | ReverseDirection () |
int | GetLastTargetNode () |
int | GetLastPrevNode () |
string | GetSpriteDirectionToSave () |
void | PrepareSpriteChild (bool isTopDown, bool isUnity2D) |
void | UpdateFrameFlipping (bool ignoreLockDirectionOption=false) |
void | UpdateSpriteChild (bool isTopDown, bool isUnity2D) |
void | UpdateScale () |
virtual bool | CanBeDirectControlled () |
Protected Attributes | |
LerpUtils.FloatLerp | moveSpeedLerp = new LerpUtils.FloatLerp () |
Quaternion | newRotation |
Transform | _transform |
Speech | activeSpeech |
float | pathfindUpdateTime = 0f |
bool | isJumping = false |
float | turnFloat = 0f |
Paths | ownPath |
AC_PathType | lockedPathType |
Rigidbody | _rigidbody = null |
Rigidbody2D | _rigidbody2D = null |
float | originalGravityScale = 1f |
Collider | _collider = null |
CharacterController | _characterController |
AudioSource | audioSource |
Paths | activePath = null |
float | moveSpeed |
Vector3 | moveDirection |
int | targetNode = 0 |
bool | pausePath = false |
Vector3 | lookDirection |
int | prevNode = 0 |
bool | tankTurning = false |
bool | timelineHeadTurnOverride |
Vector3 | timelineHeadTurnTargetOffset |
Transform | timelineHeadTurnTarget |
float | timelineHeadTurnWeight |
Properties | |
bool | isRunning [get, set] |
virtual bool | IsPlayer [get] |
float | MoveSpeed [get] |
Expression | CurrentExpression [get] |
bool | AffectedByVerticalReduction [set] |
Quaternion | TransformRotation [get, set] |
Vector3 | TransformForward [get] |
Vector3 | TransformRight [get] |
bool | IsJumping [get] |
SpriteDirectionData | spriteDirectionData [get] |
CharacterAnimationShot | ActiveCharacterAnimationShot [get, set] |
IKLimbController | LeftHandIKController [get] |
IKLimbController | RightHandIKController [get] |
Transform | Transform [get, set] |
bool | isTalking [get] |
float | PathfindUpdateFrequency [get, set] |
The base class for both NPCs and the Player. It contains the functions needed for animation and movement.
|
virtual |
The character's "FixedUpdate" function, called by StateHandler.
Reimplemented in AC.Player.
|
virtual |
The character's "LateUpdate" function, called by StateHandler.
Reimplemented in AC.Player.
|
virtual |
The character's "Update" function, called by StateHandler.
bool AC.Char.AccurateDestination | ( | ) |
Checks if the character should attempt to be as accurate as possible when moving to a destination.
bool AC.Char.CanTranslate | ( | int | index | ) |
Checks if a given text index can and should be translated.
index | The index of the translatable text |
Implements AC.ITranslatable.
void AC.Char.ClearExpression | ( | ) |
Clears the current Expression so that the default portrait icon is used.
void AC.Char.ClearHeadTurnTarget | ( | bool | isInstant | ) |
Stops the head from facing a fixed point.
isInstant | If True, the head will return to normal instantly |
void AC.Char.ClearHeadTurnTarget | ( | bool | isInstant, |
HeadFacing | _headFacing | ||
) |
Ceases a particular type of head-facing.
_headFacing | The type of head-facing to cease (Hotspot, Manual) |
isInstant | If True, the head will return to normal instantly |
|
virtual |
void AC.Char.EndPath | ( | Paths | optionalPath, |
bool | stopTurningToo = true |
||
) |
Stops the character from moving along the current Paths object.
optionalPath | If set, the character will only stop if moving along this path |
float AC.Char.FlattenSpriteAngle | ( | float | angle, |
AngleSnapping | _angleSnapping | ||
) |
Snaps a given angle to the nearest 90 or 45 degrees
angle | The angle to snap |
_angleSnapping | The neareset angle it should be snapped to (FortyFiveDegrees, NinetyDegrees) |
void AC.Char.ForceIdle | ( | ) |
Forces the character into an idle state.
void AC.Char.ForgetLastPath | ( | ) |
Clears the record of the character's last Paths object, so that they can no longer resume it
float AC.Char.GetAngleDifference | ( | ) |
Gets the difference between the character's current facing angle, and the angle they wish to face.
Animation AC.Char.GetAnimation | ( | ) |
Gets the character's Animation component.
Animator AC.Char.GetAnimator | ( | ) |
Gets the character's Animator component. An Animator placed on the spriteChild GameObject will be given priority.
AnimEngine AC.Char.GetAnimEngine | ( | ) |
Gets the character's AnimEngine ScriptableObject.
Speech AC.Char.GetCurrentSpeech | ( | ) |
Gets the character's current speech line
int AC.Char.GetExpressionID | ( | ) |
Gets the ID number of the currently-active Expression.
int AC.Char.GetExpressionID | ( | string | expressionLabel | ) |
Gets the ID number of the Expression that has a specific label.
expressionLabel | The label of the Expression to return the ID number of. |
Quaternion AC.Char.GetFrameRotation | ( | ) |
Gets the character's calculated rotation for this frame. This is not the same as GetTargetRotation, which is the 'final' rotation, but instead the rotation that a smoothly-rotated character should take.
Transform AC.Char.GetHandTransform | ( | Hand | hand | ) |
Gets the Transform associated with a given hand bone
Vector3 AC.Char.GetHeadTurnTarget | ( | ) |
Gets the position of where the character's head is facing towards.
float AC.Char.GetHeightChange | ( | ) |
Gets the character's change in height over the last frame.
Paths AC.Char.GetLastPath | ( | ) |
Gets the last Path that the character was moving along
int AC.Char.GetLipSyncFrame | ( | ) |
Gets the current lip-sync frame.
float AC.Char.GetLipSyncNormalised | ( | ) |
Gets the current lip-sync frame, as a fraction of the total number of phoneme frames.
MotionControl AC.Char.GetMotionControl | ( | ) |
Gets the extent to which motion is controlled by the character script (Automatic, JustTurning, Manual).
Vector3 AC.Char.GetMoveDirection | ( | ) |
Gets the direction that the character is moving in.
float AC.Char.GetMoveSpeed | ( | bool | reduceNonFacing = false | ) |
Gets the current movement speed.
reduceNonFacing | If True, then movement speed will be reduced if the character is not facing their indented target. |
string AC.Char.GetName | ( | int | languageNumber = 0 | ) |
Gets the Character's current display name.
languageNumber | The index number of the game's current language |
int AC.Char.GetNumTranslatables | ( | ) |
Gets the maximum number of possible translatable texts.
Implements AC.ITranslatable.
string AC.Char.GetOwner | ( | int | index | ) |
Gets the name of the translatable text's owner. In the case of speech text, it is the name of the character. In the case of menu element text, it is the name of the menu element.
index | The index of the translatable text |
Implements AC.ITranslatable.
Paths AC.Char.GetPath | ( | ) |
CursorIconBase AC.Char.GetPortrait | ( | ) |
Gets the active portrait that's displayed in a MenuGraphic element when the character speaks. The portrait can change if an Expression has been defined.
Sprite AC.Char.GetPortraitSprite | ( | ) |
Gets a Sprite based on the portrait graphic of the character. If lipsincing is enabled, the sprite will be based on the current phoneme.
int AC.Char.GetPreviousNode | ( | ) |
The last-reached node on the character's current path or Paths object
Shapeable AC.Char.GetShapeable | ( | ) |
Vector2 AC.Char.GetSpeechScreenPosition | ( | bool | keepWithinScreen = true | ) |
Gets the position of the top of the character, in screen-space.
keepWithinScreen | If False, and the character is behind the camera, then the returned vector will be shifted far to the right in order to hide it |
Vector3 AC.Char.GetSpeechWorldPosition | ( | ) |
Gets the position of the top of the character, in world-space.
float AC.Char.GetSpriteAngle | ( | ) |
Gets the angle that a 2D character's sprite is facing, relative to the root.
string AC.Char.GetSpriteDirection | ( | bool | ignoreFrameFlipping = false | ) |
Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR".
int AC.Char.GetSpriteDirectionInt | ( | bool | ignoreFrameFlipping = false | ) |
Gets the direction that a 2D character is facing (Down = 0, Left = 1, Right = 2, Up = 3, DownLeft = 4, DownRight = 5, UpLeft = 6, UpRight = 7)
int AC.Char.GetTargetNode | ( | ) |
The next node to reach on the character's current path or Paths object
Vector3 AC.Char.GetTargetPosition | ( | bool | wantFinalDestination = false | ) |
Gets the character's destination when walking along a path.
wantFinalDestination | If True, the paths' end-point will be returned; otherwise, the current node target position will be returned. |
Quaternion AC.Char.GetTargetRotation | ( | ) |
Gets the character's target rotation.
|
protected |
Stupid bug alert!
A check was made way back in v1.28 for a root Animator component because back then only Legacy and Mecanim animation was available (no 2D!). With this animation mode, the "move speed float" had to be tied directly to the walk/run speeds so that transitions could be properly built. This wasn't the right way to do this, of course, but the problem is now everyone's using this - so it can't be changed without having to get basically everyone working in 3D to update their movement values and transitions.
Since you can still achieve the same movement speeds as non-animator-on-root characters by lowering your movement values, all things considered it's probably best to just leave as is and say 'Yes I was stupid back then'! :/
string AC.Char.GetTranslatableString | ( | int | index | ) |
Gets the text to be translated, given its index.
index | The index of the translatable text |
Implements AC.ITranslatable.
int AC.Char.GetTranslationID | ( | int | index | ) |
Gets the translation ID of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
AC_TextType AC.Char.GetTranslationType | ( | int | index | ) |
Gets the translation type of a given text index.
index | The index of the translatable text |
Implements AC.ITranslatable.
|
virtual |
Gets the rate at which the character is turning (negative values used when turning anti-clockwise).
Reimplemented in AC.Player.
void AC.Char.Halt | ( | bool | haltTurning = true | ) |
Stops the character moving.
haltTurning | If True, turning will be halted too |
bool AC.Char.HasExistingTranslation | ( | int | index | ) |
Checks if a given text index has already been assigned a unique translation ID.
index | The index of the translatable text |
Implements AC.ITranslatable.
bool AC.Char.HoldObject | ( | GameObject | objectToHold, |
Hand | hand | ||
) |
Parents an object to the character's hand
objectToHold | The object to hold |
hand | Which hand to parent the object to (Left, Right) |
|
virtual |
|
virtual |
True if the character is capable of jumping
Reimplemented in AC.Player.
bool AC.Char.IsGrounded | ( | bool | reportError = false | ) |
Checks if the character (if 3D) is in contact with the ground.
reportError | If True, then an error message will be displayed if no means of detecting the ground can be found |
bool AC.Char.IsMovingAlongPath | ( | ) |
Checks if the character is moving along a path.
bool AC.Char.IsMovingHead | ( | ) |
Checks if the head is rotating to face its target, but has not yet reached it.
bool AC.Char.IsPathfinding | ( | ) |
Checks if the character is currently pathfinding to a pre-determined destination
<returnsy>True if the character is currently pathfinding to a pre-determined destination
bool AC.Char.IsReversing | ( | ) |
Checks if the character is moving backwards.
bool AC.Char.IsTurning | ( | ) |
Checks if the character is turning.
bool AC.Char.IsTurning | ( | float | maxAngleThreshold | ) |
Checks if the character is turning.
maxAngleThreshold | The maximum angle difference between the character's actual direction, and their intended direction, for a turn to be detected |
bool AC.Char.IsTurningBeforeWalking | ( | ) |
Checks if the character is spot-turning before making their move. isTurningBeforeWalking must be True for this to ever be the case.
bool AC.Char.LipSyncGameObject | ( | ) |
Checks if the character is playing a lip-sync animation that affects the GameObject.
void AC.Char.MoveAlongPoints | ( | Vector3[] | pointData, |
bool | run, | ||
bool | allowUpdating = true |
||
) |
Moves along a series of points in the scene.
pointData | The array of points to move along |
run | If True, the character will run |
allowUpdating | If True, it will be recalculated over time according to SettingsManager's pathfindUpdateFrequency value |
void AC.Char.MoveToPoint | ( | Vector3 | point, |
bool | run = false , |
||
bool | usePathfinding = false |
||
) |
Moves towards a point in the scene.
point | The point to move to |
run | If True, the character will run |
usePathfinding | If True, the character will pathfind using the scene's chosen navigation algorithm |
void AC.Char.OnEnterTimeline | ( | PlayableDirector | director, |
int | trackIndex | ||
) |
Called whenever the character is bound to a Timeline track that's starting, and used to deactivate certain control components to allow them freedom.
director | The PlayableDirector that is playing the Timeline |
trackIndex | The index number of the track within the director's TimelineAsset that the character appears on |
void AC.Char.OnExitTimeline | ( | PlayableDirector | director, |
int | trackIndex | ||
) |
Called whenever the character is bound to a Timeline track that's ending, and used to re-activate certain control components.
director | The PlayableDirector that is playing the Timeline |
trackIndex | The index number of the track within the director's TimelineAsset that the character appears on |
bool AC.Char.OwnerIsPlayer | ( | int | index | ) |
Checks if the translatable text's owner is a Player. This is necessary for speech lines, since multiple player prefabs can feasibly share the same line.
index | The index of the translatable text |
Implements AC.ITranslatable.
void AC.Char.RecalculateActivePathfind | ( | ) |
Rebuilds the active pathfind.
void AC.Char.ReleaseHeldObject | ( | Hand | hand, |
bool | delete | ||
) |
Drops any objects held in the character's hands.
void AC.Char.ReleaseHeldObjects | ( | bool | delete | ) |
Drops any objects held in the character's hands.
void AC.Char.ReleaseSorting | ( | ) |
Unlocks any FollowSortingMap that was locked to a sorting order/layer by SetSorting().
void AC.Char.ResetAnimator | ( | ) |
Resets the internal record of the character's Animator component, which will be re-assigned the next time GetAnimator() is called.
void AC.Char.ResetBaseClips | ( | ) |
Removes all AnimationClips from the Animation component that are not "standard", e.g. Idle, Walk, Run and Talk.
void AC.Char.ResumeLastPath | ( | ) |
Resumes moving along the character's last Paths object, if there was one.
void AC.Char.SetAnimEngine | ( | AnimationEngine | _animationEngine, |
string | customClassName = "" |
||
) |
Sets the character's AnimEngine ScriptableObject.
_animationEngine | The new AnimationEngine (Legacy, Mecanim, SpritesUnity, SpritesUnityComplex, Sprites2DToolkit) |
customClassName | The name of the ScriptableObject class to rely on for animation, if _animationEngine = AnimationEngine.Custom |
void AC.Char.SetExpression | ( | int | ID | ) |
Changes the active Expression.
ID | The ID number of the Expression, in expressions, to make active. |
void AC.Char.SetExpression | ( | string | _name | ) |
Changes the active Expression.
_name | The name of the Expression, in expressions, to make active. |
|
virtual |
void AC.Char.SetLookDirection | ( | Vector3 | _direction, |
bool | isInstant | ||
) |
Sets the intended direction to face.
_direction | The relative direction to face |
isInstant | If True, the Player will instantly turn to face the direction |
void AC.Char.SetMoveDirection | ( | Vector3 | _direction, |
bool | useSmoothing = false |
||
) |
Moves the character in a particular direction.
_direction | The direction to move in |
useSmoothing | If True, smoothing will be applied to the change in direction, so the change will be gradual |
void AC.Char.SetMoveDirectionAsBackward | ( | ) |
Moves the character backward.
void AC.Char.SetMoveDirectionAsForward | ( | ) |
Moves the character forward.
void AC.Char.SetName | ( | string | newName, |
int | _lineID | ||
) |
Renames the Character mid-game.
newName | The new name of the character |
_lineID | The translation ID number assocated with the new name, as set by SpeechManager |
void AC.Char.SetPath | ( | Paths | pathOb | ) |
void AC.Char.SetPath | ( | Paths | pathOb, |
int | _targetNode, | ||
int | _prevNode | ||
) |
void AC.Char.SetPath | ( | Paths | pathOb, |
int | _targetNode, | ||
int | _prevNode, | ||
bool | affectY | ||
) |
Assigns the character to a Paths object to move along. This is not the same as pathfinding - this assumes a path has already been defined.
pathOb | The Paths object to move along |
_targetNode | The index number of the first node to move to |
_prevNode | The index number of the node moving away from |
affectY | If True, then the character will account for the "Y" position of nodes |
void AC.Char.SetPath | ( | Paths | pathOb, |
PathSpeed | _speed | ||
) |
void AC.Char.SetRotation | ( | float | angle | ) |
Instantly rotates the Player
angle | The angle, in degrees, around the Y-axis to rotate to |
void AC.Char.SetRotation | ( | Quaternion | _rotation | ) |
Instantly rotates the character
_rotation | The new rotation |
void AC.Char.SetSorting | ( | int | order | ) |
Locks the Renderer's sortingOrder.
order | The sorting order to lock the Renderer to |
void AC.Char.SetSorting | ( | string | layer | ) |
Locks the Renderer's sorting layer.
layer | The sorting layer to lock the Renderer to |
void AC.Char.SetSpeechVolume | ( | float | volume | ) |
Updates the volume level of the Character's speech audio.
volume | The new volume level |
void AC.Char.SetSpriteDirection | ( | CharDirection | direction | ) |
Locks a 2D character's sprite to face a particular direction.
direction | The direction to face (Down, Left, Right, Up, DownLeft, DownRight, UpLeft, UpRight) |
void AC.Char.SetTranslationID | ( | int | index, |
int | lineID | ||
) |
Sets the translation ID of a given text index
index | The index of the translatable text |
lineID | The new translation ID to assign the translatable text |
Implements AC.ITranslatable.
void AC.Char.SnapHeadMovement | ( | ) |
Snaps the head so that it faces the fixed point it's been told to, instead of rotating towards it over time.
void AC.Char.StartDecelerating | ( | ) |
Causes the character to slow down and stop moving.
void AC.Char.StartLipSync | ( | List< LipSyncShape > | _lipSyncShapes | ) |
Begins a lip-syncing animation based on a series of LipSyncShapes.
_lipSyncShapes | The LipSyncShapes to use as the basis for the animation |
void AC.Char.StopSpeaking | ( | ) |
void AC.Char.StopTurning | ( | ) |
Instantly stops the character turning.
void AC.Char.Teleport | ( | Vector3 | _position, |
bool | recalculateActivePathFind = false |
||
) |
Teleports the character. The message 'OnTeleport' will be sent to the character's GameObject after the position is set.
_position | The point to teleport to |
recalculateActivePathFind | If True and the character is walking, then their navigation path will be recalculated to account for the position change |
bool AC.Char.WillStopAtNextNode | ( | ) |
Checks if the character is pathfinding, and the next node on the path will be their intended destination
SpriteDirectionData AC.Char._spriteDirectionData = null |
The direction settings, if using sprite-based characters
float AC.Char.acceleration = 6f |
The acceleration factor
string AC.Char.angleParameter = "Angle" |
The name of the Animator float parameter set to the facing angle, if using AnimEngine_SpritesUnityComplex
AngleSnapping AC.Char.angleSnapping = AngleSnapping.None |
If using Sprites Unity Complex to animate the character, then the 'Body angle float' and 'Head angle float' parameters will be snapped according to this value
AnimationEngine AC.Char.animationEngine = AnimationEngine.SpritesUnity |
The animation engine enum (SpritesUnity, SpritesUnityComplex, Sprites2DToolkit, Legacy, Mecanim, Custom)
float AC.Char.animCrossfadeSpeed = 0.2f |
The default duration, in seconds, when crossfading standard animations, if using AnimEngine_Legacy
bool AC.Char.antiGlideMode = false |
If True, then sprite-based characters will only move when their sprite frame changes
float AC.Char.bodyIKTurnFactor = 0f |
The amount that the body is influenced by IK head-turning.
bool AC.Char.canRunInReverse = true |
If True, it is possible to run backwards (Tank Controls / First Person only)
CharState AC.Char.charState |
The character's state (Idle, Move, Decelarate, Custom)
bool AC.Char.crossfadeAnims = false |
If True, characters will crossfade between standard animations, if using AnimEngine_SpritesUnity
string AC.Char.customAnimationClass = "" |
The class name of the AnimEngine ScriptableObject that animates the character, if animationEngine = AnimationEngine.Custom
Animator AC.Char.customAnimator |
The Animator component, which will be assigned automatically if not set manually
float AC.Char.deceleration = 0f |
The deceleration factor
string AC.Char.directionParameter = "Direction" |
The name of the Animator integer parameter set to the sprite direction (set by GetSpriteDirectionInt()), if using AnimEngine_SpritesUnityComplex
int AC.Char.displayLineID = -1 |
The translation ID number of the Hotspot's name, if it was changed mid-game
bool AC.Char.doDiagonals = false |
(DEPRECATED - Use spriteDirectionData instead)
bool AC.Char.doDirections = true |
(DEPRECATED - Use spriteDirectionData instead)
bool AC.Char.doWallReduction = false |
If True, then characters will slow down when walking into walls, if using AnimEngine_Mecanim or AnimEngine_SpritesUnityComplex
int AC.Char.expressionGroupID |
The Shapeable group ID that controls expression blendshapes, if using AnimEngine_Legacy / AnimEngine_Mecanim
string AC.Char.expressionParameter = "" |
The name of the Animator integer parameter set to the active Expression ID number
List<Expression> AC.Char.expressions = new List<Expression> () |
The character's available expressions, if useExpressions = True
float AC.Char.expressionTransitionTime = 0.2f |
The transition time when changing expressions via shapekey
float AC.Char.eyesIKTurnFactor = 1f |
The amount that the eyes are influenced by IK head-turning.
bool AC.Char.flipCustomAnims = false |
If True, and frameFlipping != AC_2DFrameFlipping.None, then custom animations will also be flipped
AC_2DFrameFlipping AC.Char.frameFlipping = AC_2DFrameFlipping.None |
The type of frame-flipping to use on sprite-based characters (None, LeftMirrorsRight, RightMirrorsLeft)
bool AC.Char.freezeRigidbodyWhenIdle = false |
If True, the character's Rigidbody will be frozen in place when idle. This is to help slipping when on sloped surfaces
int AC.Char.groundCheckLayerMask = 1 |
The layermask to use when Raycasting to determine if the character is grounded or not
HeadFacing AC.Char.headFacing = HeadFacing.None |
The type of head-turning effect that is currently active (None, Hotspot, Manual)
float AC.Char.headIKTurnFactor = 1f |
The amount that the head is influenced by IK head-turning. Normally this should be left as 1, but may need reducing if the neck is made of multiple bones.
int AC.Char.headLayer = 1 |
The Animator layer used to play head animations while talking, by AnimEngine_Mecanim / AnimEngine_SpritesUnity
AnimationClip AC.Char.headLookDownAnim |
The "Look down" animation, if using AnimEngine_Legacy
AnimationClip AC.Char.headLookLeftAnim |
The "Look left" animation, if using AnimEngine_Legacy
AnimationClip AC.Char.headLookRightAnim |
The "Look right" animation, if using AnimEngine_Legacy
AnimationClip AC.Char.headLookUpAnim |
The "Look up" animation, if using AnimEngine_Legacy
string AC.Char.headPitchParameter = "" |
The name of the Animator float parameter set to the head pitch, if using AnimEngine_Mecanim
float AC.Char.headTurnSpeed = 4f |
The speed of head-turning
Transform AC.Char.headTurnTarget |
The Transform that the character is turning its head towards, if headFacing != HeadFacing.None
Vector3 AC.Char.headTurnTargetOffset |
The offset point in World Space that the character is turning its head towards, if headFacing != HeadFacing.None
string AC.Char.headYawParameter = "" |
The name of the Animator float parameter set to the head yaw, if using AnimEngine_Mecanim
AnimationClip AC.Char.idleAnim |
The "Idle" animation, if using AnimEngine_Legacy
string AC.Char.idleAnimSprite = "idle" |
The name of the 'Idle' animation(s), without suffix, used by AnimEngine_SpritesUnity
bool AC.Char.ignoreGravity = false |
If True, the character will ignore the effects of gravity
bool AC.Char.ikHeadTurning = false |
If True, then inverse-kinematics will be used to turn the character's head dynamically, rather than playing pre-made animations
string AC.Char.isGroundedParameter |
The name of the Animator bool parameter set to the 'Is Grounded' check, is using AnimEngine_Mecanim
bool AC.Char.isLipSyncing = false |
If True, the character is currently lip-syncing
string AC.Char.jumpParameter = "" |
The name of the Animator boolean parameter to set to 'True' when jumping, if using Mecanim animation (Player characters only)
Transform AC.Char.leftArmBone |
The "Left arm" bone Transform, used to isolate animations if using AnimEngine_Legacy
Transform AC.Char.leftHandBone |
The Transform to parent objects held in the character's left hand to
int AC.Char.lineID = -1 |
The translation ID number of the Character's name, as generated by SpeechManager
float AC.Char.lipSyncBlendShapeSpeedFactor = 1f |
A speed tfactor to apply to the changing of blend-shapes based on lipsyncing
int AC.Char.lipSyncGroupID |
The Shapeable group ID that controls phoneme blendshapes, if using AnimEngine_Legacy / AnimEngine_Mecanim
bool AC.Char.lockDirection = false |
If True, sprite-based characters will be locked to face a set direction
bool AC.Char.lockScale = false |
If True, sprite-based characters will not resize along a SortingMap
bool AC.Char.mapExpressionsToShapeable = false |
If useExpressions = True, and the chosen animation engine allows for it, a Shapeable component can be mapped to expressions to allow for expression tokens to control blendshapes
MotionControl AC.Char.motionControl = MotionControl.Automatic |
How motion is controlled, if animationEngine = AnimationEngine.Custom (Automatic, JustTurning, Manual)
int AC.Char.mouthLayer = 2 |
The Animator layer used to play mouth animations while talking, by AnimEngine_Mecanim / AnimEngine_SpritesUnity
string AC.Char.moveSpeedParameter = "Speed" |
The name of the Animator float parameter set to the movement speed, if using AnimEngine_Mecanim
Transform AC.Char.neckBone |
The "Neck" bone Transform, used to isolate animations if using AnimEngine_Legacy
string AC.Char.phonemeNormalisedParameter = "" |
The name of the Animator float parameter set to the lip-syncing phoneme index, relative to the total number of phonemes
string AC.Char.phonemeParameter = "" |
The name of the Animator integer parameter set to the lip-syncing phoneme index, if using AnimEngine_SpritesUnityComplex
CursorIconBase AC.Char.portraitIcon = new CursorIconBase () |
The character's portrait graphic, used in MenuGraphic elements when speaking
bool AC.Char.retroPathfinding = false |
Enables 'retro-style' movement when pathfinding, where characters ignore Acceleration and Deceleration values, and turn instantly when moving
float AC.Char.reverseSpeedFactor = 1f |
The factor by which speed is reduced when reversing (Tank Controls / First Person only)
Transform AC.Char.rightArmBone |
The "Right arm" bone Transform, used to isolate animations if using AnimEngine_Legacy
Transform AC.Char.rightHandBone |
The Transform to parent objects held in the character's right hand to
float AC.Char.rootTurningFactor = 0f |
The factor by which the job of turning is left to Mecanim root motion, if using AnimEngine_Mecanim
RotateSprite3D AC.Char.rotateSprite3D = RotateSprite3D.CameraFacingDirection |
The method by which a sprite-based character should face the camera in 3D games (CameraRotation, CameraPosition)
AnimationClip AC.Char.runAnim |
The "Run" animation, if using AnimEngine_Legacy
string AC.Char.runAnimSprite = "run" |
The name of the 'Run' animation(s), without suffix, used by AnimEngine_SpritesUnity
float AC.Char.runDistanceThreshold = 1f |
The minimum distance between the character and its destination for running to be possible
AudioClip AC.Char.runSound |
The sound to play when running
float AC.Char.runSpeedScale = 6f |
The movement speed when running
bool AC.Char.separateTalkingLayer = false |
If True, using SpritesUnity animation, and talkingAnimation = TalkingAnimation.Standard, then the head animation (talking) will be handled on a non-root layer.
float AC.Char.simulatedMass = 1 |
The character's simulated mass, if using a Character Controller
Sound AC.Char.soundChild |
AudioSource AC.Char.speechAudioSource |
The AudioSource from which to play speech audio
Color AC.Char.speechColor = Color.white |
The colour of the character's speech text
string AC.Char.speechLabel = "" |
The character's display name when speaking
Transform AC.Char.speechMenuPlacement |
The Transform at which to place Menus set to appear 'Above Speaking Character'. If this is not set, the placement will be set automatically.
Transform AC.Char.spriteChild |
The sprite Transform, that's a child GameObject, used by AnimEngine_SpritesUnity / AnimEngine_SpritesUnityComplex / AnimEngine_Sprites2DToolkit
string AC.Char.spriteDirection = "D" |
The directional suffix to face (e.g. "L" for "Left"), if lockDirection = True
float AC.Char.spriteScale = 1f |
A sprite-based character's scale, if lockScale = True
AnimationClip AC.Char.talkAnim |
The "Talk" animation, if using AnimEngine_Legacy
string AC.Char.talkAnimSprite = "talk" |
The name of the 'Talk' animation(s), without suffix, used by AnimEngine_SpritesUnity
TalkingAnimation AC.Char.talkingAnimation = TalkingAnimation.Standard |
How talking animations are handled (Standard, CustomFace)
string AC.Char.talkParameter = "IsTalking" |
The name of the Animator bool parameter set to True while talking, if using AnimEngine_Mecanim
AudioClip AC.Char.textScrollClip |
The sound to play when the character's speech text is scrolling
bool AC.Char.turn2DCharactersIn3DSpace = true |
If True, then the root object of a 2D, sprite-based character will rotate around the Z-axis. Otherwise, turning will be simulated and the actual rotation will be unaffected
bool AC.Char.turnBeforeWalking = false |
If True, the character will turn on the spot to face their destination before moving
float AC.Char.turningAngleThreshold = 4f |
The minimum angle between the character's current direction, and their intended direction, for spot-turning to be possible
AnimationClip AC.Char.turnLeftAnim |
The "Turn left" animation, if using AnimEngine_Legacy
string AC.Char.turnParameter = "" |
The name of the Animator float parameter set to the turning direction, if using AnimEngine_Mecanim
AnimationClip AC.Char.turnRightAnim |
The "Turn right" animation, if using AnimEngine_Legacy
float AC.Char.turnSpeed = 7f |
The turn speed
Transform AC.Char.upperBodyBone |
The "Upper body" bone Transform, used to isolate animations if using AnimEngine_Legacy
bool AC.Char.useExpressions |
If True, speech text can use expression tokens to change the character's expression
bool AC.Char.useRigidbody2DForMovement = false |
If True, and the character has a Rigidbody2D component, then it will be moved by adding forces in FixedUpdate, as opposed to the transform being manipulated in Update
bool AC.Char.useRigidbodyForMovement = true |
If True, and the character has a Rigidbody component, then it will be moved by adding forces in FixedUpdate, as opposed to the transform being manipulated in Update
string AC.Char.verticalMovementParameter = "" |
The name of the Animator float parameter set to the vertical movement speed, if using AnimEngine_Mecanim
AnimationClip AC.Char.walkAnim |
The "Walk" animation, if using AnimEngine_Legacy
string AC.Char.walkAnimSprite = "walk" |
The name of the 'Walk' animation(s), without suffix, used by AnimEngine_SpritesUnity
AudioClip AC.Char.walkSound |
The sound to play when walking
float AC.Char.walkSpeedScale = 2f |
The movement speed when walking
float AC.Char.wallDistance = 0.5f |
The distance to keep away from walls, if doWallReduction = True
string AC.Char.wallLayer = "Default" |
The layer that walls are expected to be placed on, if doWallReduction = True
bool AC.Char.wallReductionOnlyParameter = true |
If True, and doWallReduction = True, then the wall reduction factor will only affect the Animator move speed float parameter, and not character's actual speed
|
getset |
The CharacterAnimationShot that's currently being applied to the character, if sprite-based
|
set |
If set to False, the character's vertical speed will not be affected by the scene's 'Vertical reduction factor'
|
get |
The character's current Expression
|
get |
If True, then the character is mid-jump
|
get |
|
getset |
If True, the character will run when moving
|
get |
Checks if the character is currently speaking
|
getset |
The time (in seconds) to take to recalculate pathfinding. If 0, pathfind updating is disabled, if negative, the Settings Manager's pathfindUpdateFrequence is used instead
|
get |
Data related to what directions the character can face, if sprite-based
|
getset |
A cache of the character's root transform component
|
get |
The character's forward vector. This is normally the transform.forward, but if the character is sprite-based and turn2DCharactersIn3DSpace = False, then this is a 'dummy' forward instead.
|
get |
The character's right vector. This is normally the transform.right, but if the character is sprite-based and turn2DCharactersIn3DSpace = False, then this is a 'dummy' forward instead.
|
getset |
The character's rotation. This is normally the transform.rotation, but if the character is sprite-based and turn2DCharactersIn3DSpace = False, then this is a 'dummy' rotation instead.