Beispiel #1
0
    private void PlayClip(object[] args)
    {
        string text = args[0] as string;

        if ((int)args[1] == 0)
        {
            float  fSpeed           = (float)args[2];
            float  fNormalized      = (float)args[3];
            string strNextAnimation = args[4] as string;
            OnWatchAnimationPlayed onWatchAnimationPlayed = args[5] as OnWatchAnimationPlayed;
            if (onWatchAnimationPlayed != null)
            {
                onWatchAnimationPlayed(this, text, strNextAnimation);
            }
            this.PlayAnimationClip(text, fSpeed, fNormalized);
            this.currentClipName = text;
            if (args.Length > 6)
            {
                OnAnimationPlayCallBack onAnimationPlayCallBack = args[6] as OnAnimationPlayCallBack;
                if (onAnimationPlayCallBack != null)
                {
                    onAnimationPlayCallBack(text, this);
                }
            }
        }
        else
        {
            float  fFade             = (float)args[2];
            float  fSpeed2           = (float)args[3];
            string strNextAnimation2 = args[4] as string;
            OnWatchAnimationPlayed onWatchAnimationPlayed2 = args[5] as OnWatchAnimationPlayed;
            if (onWatchAnimationPlayed2 != null)
            {
                onWatchAnimationPlayed2(this, text, strNextAnimation2);
            }
            this.CrossFadeClip(text, fFade, fSpeed2);
            this.currentClipName = text;
            if (args.Length > 6)
            {
                OnAnimationPlayCallBack onAnimationPlayCallBack2 = args[6] as OnAnimationPlayCallBack;
                if (onAnimationPlayCallBack2 != null)
                {
                    onAnimationPlayCallBack2(text, this);
                }
            }
        }
    }
Beispiel #2
0
    private void PlayClipFail(object[] args)
    {
        string strAnimationName = args[0] as string;

        if (args.Length > 6)
        {
            string strNextAnimation = args[4] as string;
            OnWatchAnimationPlayed  onWatchAnimationPlayed  = args[5] as OnWatchAnimationPlayed;
            OnAnimationPlayCallBack onAnimationPlayCallBack = args[6] as OnAnimationPlayCallBack;
            if (onWatchAnimationPlayed != null)
            {
                onWatchAnimationPlayed(this, strAnimationName, strNextAnimation);
            }
            if (onAnimationPlayCallBack != null)
            {
                onAnimationPlayCallBack(strAnimationName, this);
            }
        }
    }