表示テーマ
Animator
AnimationClipをGroupとStateへ登録し、プロパティAnimationを再生します。
型の情報
- 名前空間:
NEMEngine - 型:
NEMEngine.Animator(Class) - 継承元:NEMEngine.Component
- Inspector:AnimationPlayer
ClipDuration
csharp
public float ClipDuration現在のClipの長さです。単位は秒です。
操作:読取専用。
対応するInspector:AnimationPlayer。
CrossFade
csharp
public void CrossFade(string stateName, float normalizedTransitionDuration, int layer = -1, float normalizedTimeOffset = -Infinity)指定した再生へフェードで切り替えます。
| 引数 | 型 | 既定値 |
|---|---|---|
stateName | string | 必須 |
normalizedTransitionDuration | float | 必須 |
layer | int | -1 |
normalizedTimeOffset | float | -Infinity |
CrossFadeInFixedTime
csharp
public void CrossFadeInFixedTime(string stateName, float fixedTransitionDuration, int layer = -1, float fixedTimeOffset = 0)フェード秒数を指定してAnimation Groupを切り替えます。
| 引数 | 型 | 既定値 |
|---|---|---|
stateName | string | 必須 |
fixedTransitionDuration | float | 必須 |
layer | int | -1 |
fixedTimeOffset | float | 0 |
CurrentGroup
csharp
public string CurrentGroup現在再生中のGroup名です。
操作:読取専用。
対応するInspector:AnimationPlayer。
DefaultGroup
csharp
public string DefaultGroup再生開始時に選ばれるGroup名です。
操作:読取・変更。
対応するInspector:AnimationPlayer。
DirectClipRequest
csharp
public AnimationClip? DirectClipRequestGroupを経由せず再生するClip参照です。
操作:読取・変更。
対応するInspector:AnimationPlayer。
Finished
csharp
public bool Finished再生完了状態を取得します。
操作:読取専用。
対応するInspector:AnimationPlayer。
FromEntity
csharp
public static Animator FromEntity(GameObject gameObject)既にComponentを持つGameObjectから操作用の参照を作ります。Componentを追加する操作ではありません。
| 引数 | 型 | 既定値 |
|---|---|---|
gameObject | NEMEngine.GameObject | 必須 |
戻り値:NEMEngine.Animator。
GetCurrentAnimatorStateInfo
csharp
public AnimatorStateInfo GetCurrentAnimatorStateInfo(int layerIndex)現在のAnimation再生時刻やGroup名を取得します。
| 引数 | 型 | 既定値 |
|---|---|---|
layerIndex | int | 必須 |
戻り値:NEMEngine.AnimatorStateInfo。
GetGroups
csharp
public IReadOnlyList<AnimationGroupSettings> GetGroups()GroupとStateの設定Snapshotを取得します。
戻り値:System.Collections.Generic.IReadOnlyList<NEMEngine.AnimationGroupSettings>。
IsPlaying
csharp
public bool IsPlaying指定名のAnimationなどが再生中かを調べます。
操作:読取専用。
IsPlayingValue
csharp
public bool IsPlayingValue再生中かを取得します。
操作:読取専用。
対応するInspector:AnimationPlayer。
Looping
csharp
public bool Looping現在の再生がループするかを取得します。
操作:読取専用。
対応するInspector:AnimationPlayer。
NormalizedFade
csharp
public bool NormalizedFadeフェード時間を正規化した値として扱うかを指定します。
操作:読取・変更。
対応するInspector:AnimationPlayer。
NormalizedOffset
csharp
public bool NormalizedOffset開始位置を0〜1の正規化時間として扱うかを指定します。
操作:読取・変更。
対応するInspector:AnimationPlayer。
NormalizedTimeValue
csharp
public float NormalizedTimeValue現在のClip内時刻を0〜1で表した値です。
操作:読取専用。
対応するInspector:AnimationPlayer。
Play
csharp
public void Play(string stateName, int layer = -1, float normalizedTime = -Infinity)指定した再生を開始または再開します。
| 引数 | 型 | 既定値 |
|---|---|---|
stateName | string | 必須 |
layer | int | -1 |
normalizedTime | float | -Infinity |
PlayClip
csharp
public void PlayClip(AnimationClip clip, float normalizedTime = 0)保存済みグループを変更せずに単独Clipを再生
| 引数 | 型 | 既定値 |
|---|---|---|
clip | NEMEngine.AnimationClip | 必須 |
normalizedTime | float | 0 |
PlayFade
csharp
public float PlayFade再生切替時のフェード秒数です。
操作:読取・変更。
対応するInspector:AnimationPlayer。
PlayOnStart
csharp
public bool PlayOnStartPlay開始時に自動再生します。
操作:読取・変更。
対応するInspector:AnimationPlayer。
PlayRequest
csharp
public string PlayRequest次の更新で再生するGroup名を要求します。
操作:読取・変更。
対応するInspector:AnimationPlayer。
PlaybackTimeRequest
csharp
public float PlaybackTimeRequest再生またはSeekに使う時刻です。
操作:読取・変更。
対応するInspector:AnimationPlayer。
RepeatCount
csharp
public int RepeatCount現在の繰り返し回数です。
操作:読取専用。
対応するInspector:AnimationPlayer。
Seek
csharp
public void Seek(float normalizedTime)移動した区間のAnimation Eventは発火しない
| 引数 | 型 | 既定値 |
|---|---|---|
normalizedTime | float | 必須 |
SeekRequest
csharp
public bool SeekRequest指定時刻への移動を要求します。
操作:読取・変更。
対応するInspector:AnimationPlayer。
SetGroups
csharp
public void SetGroups(IEnumerable<AnimationGroupSettings> groups)編集したGroup一覧をAnimatorへ反映します。
| 引数 | 型 | 既定値 |
|---|---|---|
groups | System.Collections.Generic.IEnumerable<NEMEngine.AnimationGroupSettings> | 必須 |
Stop
csharp
public void Stop()再生を停止します。Particleでは既存粒子を残すかも引数で選べます。
StopRequest
csharp
public bool StopRequest停止を要求します。
操作:読取・変更。
対応するInspector:AnimationPlayer。
componentTypeID
csharp
public static int componentTypeID組み込みComponentの接続識別子です。通常のゲームコードではGetComponentで取得します。
操作:読取専用。
enabled
csharp
public bool enabledこのComponentの処理を有効にします。GameObject全体のアクティブ状態とは別です。
操作:読取・変更。
対応するInspector:AnimationPlayer。
speed
csharp
public float speed全GroupのAnimation時刻に掛ける再生倍率です。
操作:読取・変更。
対応するInspector:AnimationPlayer。
実行時の扱い
Nativeと接続する操作は、Scriptが実行される有効なWorld内で使用します。破棄したGameObjectやComponentへのアクセスは避けてください。設定Snapshotは取得・編集・反映を1組で扱います。