Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created June 26, 2022 10:21
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/8e4b7f37f2e91206d9d2ee3db3f40e88 to your computer and use it in GitHub Desktop.
Save flushpot1125/8e4b7f37f2e91206d9d2ee3db3f40e88 to your computer and use it in GitHub Desktop.
private _swordSlashAnimNoExeFlag : boolean;
public onUpdate(): void {
if(this._swordSlashAnimNoExeFlag == false){//剣を振るアニメーションが発動されていたらif文を通過する
if(this._animSwordAndShieldSlash.animatables[0].animationStarted == true){//アニメーションが実行されていないと、animationStartedが存在しないと表示され処理が止まる
if (this._animSwordAndShieldSlash.animatables[0].masterFrame < 0.8 && this._animSwordAndShieldSlash.animatables[0].masterFrame > 0.7){
this._impluseShot();//衝撃波を発生させる関数
this._swordSlashAnimFlag = true;//もう一度呼ばれないようにtrueに変更
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment