Adventure Creator  1.66.1
An adventure game toolkit for Unity, by Chris Burton, ICEBOX Studios 2013-2018
AC.ShapeGroup Class Reference

Public Member Functions

 ShapeGroup (int[] idArray)
 The default Constructor. More...
 
void SetSMR (SkinnedMeshRenderer _smr)
 Assigns the SkinnedMeshRenderer that this group is assocated with. More...
 
int GetActiveKeyID ()
 Gets the ID number of the active blendshape. More...
 
float GetActiveKeyValue ()
 Gets the intended value of the active blendshape. More...
 
void SetActive (int _ID, float _value, float _changeTime, MoveMethod _moveMethod, AnimationCurve _timeCurve)
 Sets a blendshape as the "active" one, causing all others to be disabled. More...
 
void SetActive (string _label, float _value, float _changeTime, MoveMethod _moveMethod, AnimationCurve _timeCurve)
 Sets a blendshape as the "active" one, causing all others to be disabled. More...
 
void UpdateKeys ()
 

Public Attributes

string label = ""
 
int ID = 0
 
List< ShapeKeyshapeKeys = new List<ShapeKey>()
 

Detailed Description

A data container for a group of blendshapes on a SkinnedMeshRenderer. By grouping blendshapes, we can make one "active" and have all others disable

Constructor & Destructor Documentation

◆ ShapeGroup()

AC.ShapeGroup.ShapeGroup ( int []  idArray)

The default Constructor.

Parameters
idArrayAn array of existing ShapeGroup ID numbers, to ensure that the groups's identifier is unique

Member Function Documentation

◆ GetActiveKeyID()

int AC.ShapeGroup.GetActiveKeyID ( )

Gets the ID number of the active blendshape.

Returns
The ID number of the active blendshape.

◆ GetActiveKeyValue()

float AC.ShapeGroup.GetActiveKeyValue ( )

Gets the intended value of the active blendshape.

Returns
The intended value of the active blendshape

◆ SetActive() [1/2]

void AC.ShapeGroup.SetActive ( int  _ID,
float  _value,
float  _changeTime,
MoveMethod  _moveMethod,
AnimationCurve  _timeCurve 
)

Sets a blendshape as the "active" one, causing all others to be disabled.

Parameters
_IDThe unique identifier of the blendshape to affect
_valueThe value to set the active blendshape
_changeTimeThe duration, in seconds, that the group's blendshapes should be affected
_moveMethodThe interpolation method by which the blendshapes are affected (Linear, Smooth, Curved, EaseIn, EaseOut, CustomCurve)
_timeCurveIf _moveMethod = MoveMethod.CustomCurve, then the transition speed will be follow the shape of the supplied AnimationCurve. This curve can exceed "1" in the Y-scale, allowing for overshoot effects.

◆ SetActive() [2/2]

void AC.ShapeGroup.SetActive ( string  _label,
float  _value,
float  _changeTime,
MoveMethod  _moveMethod,
AnimationCurve  _timeCurve 
)

Sets a blendshape as the "active" one, causing all others to be disabled.

Parameters
_labelThe name of the blendshape to affect
_valueThe value to set the active blendshape
_changeTimeThe duration, in seconds, that the group's blendshapes should be affected
_moveMethodThe interpolation method by which the blendshapes are affected (Linear, Smooth, Curved, EaseIn, EaseOut, CustomCurve)
_timeCurveIf _moveMethod = MoveMethod.CustomCurve, then the transition speed will be follow the shape of the supplied AnimationCurve. This curve can exceed "1" in the Y-scale, allowing for overshoot effects.

◆ SetSMR()

void AC.ShapeGroup.SetSMR ( SkinnedMeshRenderer  _smr)

Assigns the SkinnedMeshRenderer that this group is assocated with.

Parameters
_smrThe SkinnedMeshRenderer that this group is associated with.

◆ UpdateKeys()

void AC.ShapeGroup.UpdateKeys ( )

Updates the values of all blendshapes within the group.

Member Data Documentation

◆ ID

int AC.ShapeGroup.ID = 0

A unique identifier

◆ label

string AC.ShapeGroup.label = ""

The editor-friendly name of the group

◆ shapeKeys

List<ShapeKey> AC.ShapeGroup.shapeKeys = new List<ShapeKey>()

A list of ShapeKey instances - each ShapeKey representing a blendshape