Adventure Creator  1.55b
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2016
AC.Char Class Reference
Inheritance diagram for AC.Char:
AC.NPC AC.Player

Public Member Functions

virtual void _Update ()
 
void _LateUpdate ()
 
void _FixedUpdate ()
 
void RecalculateActivePathfind ()
 Rebuilds the active pathfind.
 
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 SetLookDirection (Vector3 _direction, bool isInstant)
 Sets the intended direction to face. More...
 
void SetMoveDirection (Vector3 _direction)
 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 ()
 
void EndPath ()
 Stops the character from moving along the current Paths object.
 
void ResumeLastPath ()
 
void Halt ()
 
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...
 
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 ()
 Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR". More...
 
int GetSpriteDirectionInt ()
 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 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...
 
bool HoldObject (GameObject objectToHold, Hand hand)
 Parents an object to the character's hand More...
 
void ReleaseHeldObjects ()
 
Vector2 GetScreenCentre ()
 Gets the position of the top of the character, in screen-space. More...
 
void AfterLoad ()
 
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 ()
 
void SetExpression (int ID)
 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.
 
bool IsGrounded ()
 Checks if the character (if 3D) is in contact with the ground. More...
 
virtual bool CanBeDirectControlled ()
 Checks if the character can be controlled directly at this time. More...
 
MotionControl GetMotionControl ()
 Gets the extent to which motion is controlled by the character script (Automatic, JustTurning, Manual). More...
 
Vector3 GetTargetPosition ()
 Gets the character's destination when walking along a path. More...
 
Quaternion GetTargetRotation ()
 Gets the character's target rotation. 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 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...
 

Public Attributes

CharState charState
 
AnimationEngine animationEngine = AnimationEngine.SpritesUnity
 
string customAnimationClass = ""
 
MotionControl motionControl = MotionControl.Automatic
 
TalkingAnimation talkingAnimation = TalkingAnimation.Standard
 
string speechLabel = ""
 
int lineID = -1
 
int displayLineID = -1
 
Color speechColor = Color.white
 
CursorIconBase portraitIcon = new CursorIconBase ()
 
bool useExpressions
 
List< Expressionexpressions = new List<Expression>()
 
Transform speechMenuPlacement
 
bool isLipSyncing = false
 
string phonemeParameter = ""
 
int lipSyncGroupID
 
Transform leftHandBone
 
Transform rightHandBone
 
AnimationClip idleAnim
 
AnimationClip walkAnim
 
AnimationClip runAnim
 
AnimationClip talkAnim
 
AnimationClip turnLeftAnim
 
AnimationClip turnRightAnim
 
AnimationClip headLookLeftAnim
 
AnimationClip headLookRightAnim
 
AnimationClip headLookUpAnim
 
AnimationClip headLookDownAnim
 
Transform upperBodyBone
 
Transform leftArmBone
 
Transform rightArmBone
 
Transform neckBone
 
float animCrossfadeSpeed = 0.2f
 
string moveSpeedParameter = "Speed"
 
string verticalMovementParameter = ""
 
string turnParameter = ""
 
string talkParameter = "IsTalking"
 
string directionParameter = "Direction"
 
string angleParameter = "Angle"
 
string headYawParameter = ""
 
string headPitchParameter = ""
 
string expressionParameter = ""
 
float rootTurningFactor = 0f
 
int headLayer = 1
 
int mouthLayer = 2
 
Transform spriteChild
 
RotateSprite3D rotateSprite3D = RotateSprite3D.CameraFacingDirection
 
string idleAnimSprite = "idle"
 
string walkAnimSprite = "walk"
 
string runAnimSprite = "run"
 
string talkAnimSprite = "talk"
 
bool lockScale = false
 
float spriteScale = 1f
 
bool lockDirection = false
 
string spriteDirection = "D"
 
bool doDirections = true
 
bool crossfadeAnims = false
 
bool doDiagonals = false
 
bool isTalking = false
 
AC_2DFrameFlipping frameFlipping = AC_2DFrameFlipping.None
 
bool flipCustomAnims = false
 
float walkSpeedScale = 2f
 
float runSpeedScale = 6f
 
float turnSpeed = 7f
 
float acceleration = 6f
 
float deceleration = 0f
 
bool turnBeforeWalking = false
 
float runDistanceThreshold = 1f
 
bool antiGlideMode = false
 
bool isJumping = false
 
bool ignoreGravity = false
 
bool freezeRigidbodyWhenIdle = false
 
bool doWallReduction = false
 
string wallLayer = "Default"
 
float wallDistance = 0.5f
 
AudioClip walkSound
 
AudioClip runSound
 
AudioClip textScrollClip
 
Sound soundChild
 
AudioSource speechAudioSource
 
Transform headTurnTarget
 
Vector3 headTurnTargetOffset
 
HeadFacing headFacing = HeadFacing.None
 
bool ikHeadTurning = false
 

Protected Member Functions

void _Awake ()
 
void PathUpdate ()
 
float GetTargetSpeed ()
 
void AccurateAcc (float targetSpeed, bool canStop)
 
virtual void Accelerate ()
 
void SetLastPath (Paths _lastPathActivePath, int _lastPathTargetNode, int _lastPathPrevNode)
 
void ReverseDirection ()
 
void CheckIfStuck ()
 
int GetTargetNode ()
 
int GetPrevNode ()
 
Paths GetLastPath ()
 
int GetLastTargetNode ()
 
int GetLastPrevNode ()
 
void PrepareSpriteChild (bool isTopDown, bool isUnity2D)
 
void UpdateSpriteChild (bool isTopDown, bool isUnity2D)
 

Protected Attributes

Quaternion newRotation
 
float pathfindUpdateTime = 0f
 
float turnFloat = 0f
 
Rigidbody _rigidbody = null
 
Collider _collider = null
 
CharacterController _characterController
 
AudioSource audioSource
 
Paths activePath = null
 
float moveSpeed
 
Vector3 moveDirection
 
int targetNode = 0
 
bool pausePath = false
 
Vector3 lookDirection
 
bool tankTurning = false
 

Properties

bool isRunning [get, set]
 

Detailed Description

The base class for both NPCs and the Player. It contains the functions needed for animation and movement. Note that, for performance, the StateHandler calls the _Update function for each character manually. Its own list of characters is defined when GatherObjects is called. So, if you manually enable/disable characters in a scene, be sure to call StateHandler's GatherObjects function afterwards.

Member Function Documentation

void AC.Char._FixedUpdate ( )

The character's "FixedUpdate" function, called by StateHandler.

void AC.Char._LateUpdate ( )

The character's "LateUpdate" function, called by StateHandler.

virtual void AC.Char._Update ( )
virtual

The character's "Update" function, called by StateHandler.

Reimplemented in AC.Player, and AC.NPC.

bool AC.Char.AccurateDestination ( )

Checks if the character should attempt to be as accurate as possible when moving to a destination.

Returns
True if the character should attempt to be as accurate as possible when moving to a destination.
void AC.Char.AfterLoad ( )

Initialises the character after a scene change. This is called manually by SaveSystem so that the order is correct.

virtual bool AC.Char.CanBeDirectControlled ( )
virtual

Checks if the character can be controlled directly at this time.

Returns
True if the character can be controlled directly at this time

Reimplemented in AC.Player.

void AC.Char.ClearExpression ( )

Clears the current Expression so that the default portrait icon is used.

void AC.Char.ClearHeadTurnTarget ( bool  isInstant,
HeadFacing  _headFacing 
)

Ceases a particular type of head-facing.

Parameters
_headFacingThe type of head-facing to cease (Hotspot, Manual)
isInstantIf True, the head will return to normal instantly
void AC.Char.ClearHeadTurnTarget ( bool  isInstant)

Stops the head from facing a fixed point.

Parameters
isInstantIf True, the head will return to normal instantly
void AC.Char.ForceIdle ( )

Forces the character into an idle state.

Animation AC.Char.GetAnimation ( )

Gets the character's Animation component.

Returns
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.

Returns
The character's Animator component
AnimEngine AC.Char.GetAnimEngine ( )

Gets the character's AnimEngine ScriptableObject.

Returns
The character's AnimEngine ScriptableObject
int AC.Char.GetExpressionID ( string  expressionLabel)

Gets the ID number of the Expression that has a specific label.

Parameters
expressionLabelThe label of the Expression to return the ID number of.
Returns
The ID number of the Expression if found, or -1 if not found
int AC.Char.GetExpressionID ( )

Gets the ID number of the currently-active Expression.

Returns
The ID number of the currently-active Expression
Vector3 AC.Char.GetHeadTurnTarget ( )

Gets the position of where the character's head is facing towards.

Returns
The position of where the character's head is facing towards, or Vector3.zero if their head is not facing anything.
float AC.Char.GetHeightChange ( )

Gets the character's change in height over the last frame.

Returns
The character's change in height over the last frame
int AC.Char.GetLipSyncFrame ( )

Gets the current lip-sync frame.

Returns
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.

Returns
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).

Returns
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.

Returns
The direction that the character is moving in
float AC.Char.GetMoveSpeed ( bool  reduceNonFacing = false)

Gets the current movement speed.

Parameters
reduceNonFacingIf True, then movement speed will be reduced if the character is not facing their indented target.
Returns
The current movement speed
string AC.Char.GetName ( int  languageNumber = 0)

Gets the Character's current display name.

Parameters
languageNumberThe index number of the game's current language
Returns
The Character's current display name
Paths AC.Char.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.

Returns
The current Paths object that the character is moving along.
Vector2 AC.Char.GetScreenCentre ( )

Gets the position of the top of the character, in screen-space.

Returns
The position of the top of the character, in screen-space.
Shapeable AC.Char.GetShapeable ( )

Gets the Shapeable script component attached to the GameObject's root or child.

Returns
The Shapeable script component attached to the GameObject's root or child.
float AC.Char.GetSpriteAngle ( )

Gets the angle that a 2D character's sprite is facing, relative to the root.

Returns
The angle that a 2D character's sprite is facing, relative to the root
string AC.Char.GetSpriteDirection ( )

Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR".

Returns
Gets the suffix to add to sprite animations that account for the facing direction - e.g. "Walk" -> "Walk_DR".
int AC.Char.GetSpriteDirectionInt ( )

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)

Returns
The direction that a 2D character is facing (Down = 0, Left = 1, Right = 2, Up = 3, DownLeft = 4, DownRight = 5, UpLeft = 6, UpRight = 7)
Vector3 AC.Char.GetTargetPosition ( )

Gets the character's destination when walking along a path.

Returns
The character's destination when walking along a path
Quaternion AC.Char.GetTargetRotation ( )

Gets the character's target rotation.

Returns
The character's target rotation
virtual float AC.Char.GetTurnFloat ( )
virtual

Gets the rate at which the character is turning (negative values used when turning anti-clockwise).

Returns
The rate at which the character is turning (negative values used when turninng anti-clockwise)

Reimplemented in AC.Player.

void AC.Char.Halt ( )

Stops the character moving.

bool AC.Char.HoldObject ( GameObject  objectToHold,
Hand  hand 
)

Parents an object to the character's hand

Parameters
objectToHoldThe object to hold
handWhich hand to parent the object to (Left, Right)
Returns
True if the parenting was sucessful
bool AC.Char.IsGrounded ( )

Checks if the character (if 3D) is in contact with the ground.

Returns
True if the character (if 3D) is in contact with the ground
bool AC.Char.IsMovingAlongPath ( )

Checks if the character is moving along a path.

Returns
True 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.

Returns
True if the head is rotating to face its target, but has not yet reached it.
bool AC.Char.IsReversing ( )

Checks if the character is moving backwards.

Returns
True if the character is moving backwards
bool AC.Char.IsTurning ( )

Checks if the character is turning.

Returns
True if the character is turning
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.

Returns
True if the character is spot-turning before maing their move.
bool AC.Char.LipSyncGameObject ( )

Checks if the character is playing a lip-sync animation that affects the GameObject.

Returns
True 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.

Parameters
pointDataThe array of points to move along
runIf True, the character will run
allowUpdatingIf 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.

Parameters
pointThe point to move to
runIf True, the character will run
usePathfindingIf True, the character will pathfind using the scene's chosen navigation algorithm
void AC.Char.ReleaseHeldObjects ( )

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.

Parameters
_animationEngineThe new AnimationEngine (Legacy, Mecanim, SpritesUnity, SpritesUnityComplex, Sprites2DToolkit)
customClassNameThe name of the ScriptableObject class to rely on for animation, if _animationEngine = AnimationEngine.Custom
void AC.Char.SetExpression ( int  ID)

Changes the active Expression.

Parameters
IDThe ID number of the Expression, in expressions, to make active.
virtual void AC.Char.SetHeadTurnTarget ( Transform  _headTurnTarget,
Vector3  _headTurnTargetOffset,
bool  isInstant,
HeadFacing  _headFacing = HeadFacing.Manual 
)
virtual

Controls the head-facing position.

Parameters
_headTurnTargetThe Transform to face
_headTurnTargetOffsetThe position offset of the Transform
isInstantIf True, the head will turn instantly
_headFacingWhat the head should face (Manual, Hotspot, None)

Reimplemented in AC.Player.

void AC.Char.SetLookDirection ( Vector3  _direction,
bool  isInstant 
)

Sets the intended direction to face.

Parameters
_directionThe relative direction to face
isInstantIf True, the Player will instantly turn to face the direction
void AC.Char.SetMoveDirection ( Vector3  _direction)

Moves the character in a particular direction.

Parameters
_directionThe direction to move in
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.

Parameters
newNameThe new name of the character
_lineIDThe translation ID number assocated with the new name, as set by SpeechManager
void AC.Char.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.

Parameters
pathObThe Paths object to move along
_speedThe speed to move along the path (Walk, Run)
void AC.Char.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.

Parameters
pathObThe Paths object to move along
void AC.Char.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.

Parameters
pathObThe Paths object to move along
_targetNodeThe index number of the first node to move to
_prevNodeThe index number of the node moving away from
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.

Parameters
pathObThe Paths object to move along
_targetNodeThe index number of the first node to move to
_prevNodeThe index number of the node moving away from
affectYIf True, then the character will account for the "Y" position of nodes
void AC.Char.SetRotation ( Quaternion  _rotation)

Instantly rotates the character

Parameters
_rotationThe new rotation
void AC.Char.SetRotation ( float  angle)

Instantly rotates the Player

Parameters
angleThe angle, in degrees, around the Y-axis to rotate to
void AC.Char.SetSorting ( int  order)

Locks the Renderer's sortingOrder.

Parameters
orderThe sorting order to lock the Renderer to
void AC.Char.SetSorting ( string  layer)

Locks the Renderer's sorting layer.

Parameters
layerThe sorting layer to lock the Renderer to
void AC.Char.SetSpriteDirection ( CharDirection  direction)

Locks a 2D character's sprite to face a particular direction.

Parameters
directionThe direction to face (Down, Left, Right, Up, DownLeft, DownRight, UpLeft, UpRight)
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.StartLipSync ( List< LipSyncShape _lipSyncShapes)

Begins a lip-syncing animation based on a series of LipSyncShapes.

Parameters
_lipSyncShapesThe LipSyncShapes to use as the basis for the animation
void AC.Char.StopSpeaking ( )

Stops the character speaking.

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.

Parameters
_positionThe point to teleport to
recalculateActivePathFindIf True and the character is walking, then their navigation path will be recalculated to account for the position change

Member Data Documentation

float AC.Char.acceleration = 6f

The acceleration factor

string AC.Char.angleParameter = "Angle"

The name of the Mecanim float parameter set to the facing angle, if using AnimEngine_SpritesUnityComplex

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

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

float AC.Char.deceleration = 0f

The deceleration factor

string AC.Char.directionParameter = "Direction"

The name of the Mecanim 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

If True, sprite-based characters will be able to face 8 directions instead of 4, if doDirections = True

bool AC.Char.doDirections = true

If True, sprite-based characters will play different animations depending on which direction they are facing

bool AC.Char.doWallReduction = false

If True, then characters will slow down when walking into walls, if using AnimEngine_Mecanim

string AC.Char.expressionParameter = ""

The name of the Mecanim 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

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 surfaces

HeadFacing AC.Char.headFacing = HeadFacing.None

The type of head-turning effect that is currently active (None, Hotspot, Manual)

int AC.Char.headLayer = 1

The Mecanim 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 Mecanim float parameter set to the head pitch, if using AnimEngine_Mecanim

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 Mecanim 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

bool AC.Char.isJumping = false

If True, then the character is mid-jump

bool AC.Char.isLipSyncing = false

If True, the character is currently lip-syncing

bool AC.Char.isTalking = false

If True, the character is talking

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

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

MotionControl AC.Char.motionControl = MotionControl.Automatic

How motion is controlled, if animationEngine = AnimationEngine.Custom (Automatic, JustTurning, Manual)

int AC.Char.mouthLayer = 2

The Mecanim layer used to play mouth animations while talking, by AnimEngine_Mecanim / AnimEngine_SpritesUnity

string AC.Char.moveSpeedParameter = "Speed"

The name of the Mecanim 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.phonemeParameter = ""

The name of the Mecanim integer parameter set to the lip-syncing phoneme integer, if using AnimEngine_SpritesUnityComplex

CursorIconBase AC.Char.portraitIcon = new CursorIconBase ()

The character's portrait graphic, used in MenuGraphic elements when speaking

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 runing

Sound AC.Char.soundChild

The Sound child to play all non-speech AudioClips on. Speech AudioClips will be placed on the root GameObject

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 Mecanim 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.turnBeforeWalking = false

If True, the character will turn on the spot to face their destination before moving

AnimationClip AC.Char.turnLeftAnim

The "Turn left" animation, if using AnimEngine_Legacy

string AC.Char.turnParameter = ""

The name of the Mecanim 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

string AC.Char.verticalMovementParameter = ""

The name of the Mecanim 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

Property Documentation

bool AC.Char.isRunning
getset

If True, the character will run when moving