using UnityEngine;
using System;

public static class AnimatorExtensions {

    /// GetBehaviourで取得出来ればfuncに渡す
    public static bool FindBehaviour<T>(this Animator t, Action<T> func) where T : StateMachineBehaviour {
        T behaviour = t.GetBehaviour<T>();
        if(behaviour != null){
            func(behaviour);
            return true;
        }else{
            return false;
        }
    }
}
