Beispiel #1
0
    public static GetPlayingAnim Create(GameObject attachObj)
    {
        if (attachObj == null)
        {
            return(null);
        }
        if (attachObj.GetComponent <Animator>() == null)
        {
            Debug.LogErrorFormat("{0} 没有Animator组件!!!", attachObj.name);
            return(null);
        }
        GetPlayingAnim component = attachObj.GetComponent <GetPlayingAnim>() ?? attachObj.AddComponent <GetPlayingAnim>();

        component.GetAllState();
        return(component);
    }
Beispiel #2
0
    public GetPlayingAnim DoInit()
    {
        var attachObj = this.gameObject;

        if (attachObj == null)
        {
            return(null);
        }
        if (attachObj.GetComponent <Animator>() == null)
        {
            Debug.LogErrorFormat("{0} 没有Animator组件!!!", attachObj.name);
            return(null);
        }
        GetPlayingAnim component = attachObj.GetComponent <GetPlayingAnim>() ?? attachObj.AddComponent <GetPlayingAnim>();

        component.GetAllState();
        return(component);
    }