using System.Collections; using System.Collections.Generic; using UnityEngine; public class GetAnimationInfo : MonoBehaviour { public GameObject obj; private AnimatorStateInfo stateInfo; private Animator anim; // Use this for initialization void Start () { anim = GetComponent<Animator> (); } // Update is called once per frame void Update () { stateInfo = anim.GetCurrentAnimatorStateInfo (0); if(stateInfo.IsName("Base Layer.アニメーションの名前")){//アニメーションの名前にはそのままアニメーションの名前を入れる obj.SetActive (true); }else{ obj.SetActive(false); } } }
①当たり判定を出したいキャラクターにスクリプトを取り付ける
②取り付けたスクリプトのobjに出現させたい当たり判定をドラッグ&ドロップする
コメント
コメント一覧 (1件)
[…] 攻撃判定 […]