です以下は私のスクリプトですが、アニメーターの状態が終了したことを確認したいと思います。アニメーターの状態(アニメーション)が完了したら、何らかのアクションを実行しますが、これを有効にしています。ありがとうございます。アニメーターの状態をチェックする方法はunity3d
using UnityEngine;
using System.Collections;
public class fun_for_level_complet : MonoBehaviour
{
public Animator animator_obj;
// Use this for initialization
void Start()
{
}
// Update is called once per frame
void Update()
{
check_end_state();
}
public void level_complete()
{
if (this.GetComponent<movement_of_player>() != null)
{
this.GetComponent<movement_of_player>().enabled = false;
}
animator_obj.SetBool ("congo",true);
}
public void check_end_state()
{
// here I want to check if animation ends then print
// my state name is congo
// animation name Waving
// using base layer
if (animator_obj.GetCurrentAnimatorStateInfo (0).IsName ("congo") && !animator_obj.IsInTransition (0))
{
Debug.Log ("anim_done");
}
}
}
@RiaanWalters That's Animation。 OPはAnimatorを使用しています。彼らはどちらも異なっています。 – Programmer
@Programmer、十分に公正、私は旗を削除した –