Exemple #1
0
    void PlayClip(object[] args)
    {
        string         strAnimationName = args[0] as string;
        ActionPlayType aType            = (ActionPlayType)args[1];

        if (aType == ActionPlayType.APT_PLAY)
        {
            float fSpeed      = (float)args[2];
            float fNormalized = (float)args[3];

            PlayAnimationClip(strAnimationName, fSpeed, fNormalized);
            if (args.Length > 4)
            {
                OnAnimationPlayCallBack onCallback = args[4] as OnAnimationPlayCallBack;
                if (onCallback != null)
                {
                    onCallback(strAnimationName, this);
                }
            }
        }
        else
        {
            float fFade  = (float)args[2];
            float fSpeed = (float)args[3];
            CrossFadeClip(strAnimationName, fFade, fSpeed);
            if (args.Length > 4)
            {
                OnAnimationPlayCallBack onCallback = args[4] as OnAnimationPlayCallBack;
                if (onCallback != null)
                {
                    onCallback(strAnimationName, this);
                }
            }
        }
    }
Exemple #2
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);
                }
            }
        }
    }
Exemple #3
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);
            }
        }
    }