Created
March 10, 2014 12:50
-
-
Save enpel/9464444 to your computer and use it in GitHub Desktop.
Unityで再生しているアニメーションをスキップする方法 ref: http://qiita.com/enpel/items/5b1b5e001371573098a4
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void SkipCurrentAnimation() | |
{ | |
// 現在再生中のアニメーションクリップ名を取得 | |
// もっとよい方法があれば... | |
var clipName = ""; | |
foreach(AnimationState state in this.animation) { | |
if (this.animation.IsPlaying(state.name)) { | |
clipName = state.name; | |
break; | |
} | |
} | |
//clipNameが現在の再生クリップと一致していればうまいこと動作する | |
this.animation[clipName].time = this.animation.GetClip(clipName).length; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment