Last active
February 20, 2016 08:49
-
-
Save tsubaki/716dc44f76caa0a884e6 to your computer and use it in GitHub Desktop.
再生中のアニメーションが判別できない
This file contains hidden or 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
using UnityEngine; | |
using System.Collections; | |
public class EnemyMovement : MonoBehaviour { | |
public Transform player; | |
private NavMeshAgent nav; | |
private Animator animator; | |
// Use this for initialization | |
void Start () { | |
nav = GetComponent <NavMeshAgent> (); | |
animator = GetComponent <Animator> (); | |
} | |
// Update is called once per frame | |
void Update () { | |
//目的地の更新(Playerの現在の位置) | |
//nav.SetDestination (player.position); | |
//アニメーション中の挙動 | |
Behave_In_Animation(); | |
} | |
void Behave_In_Animation(){ | |
AnimatorStateInfo stateInfo = animator.GetCurrentAnimatorStateInfo(0); | |
Debug.Log (stateInfo.fullPathHash); | |
if(stateInfo.IsName("Attack1")){ | |
Debug.Log ("aaa"); | |
} | |
if(stateInfo.IsName("Attack2")){ | |
Debug.Log ("bbb"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment