private object PlayClip(SPLegacyAnimController controller, UnityEngine.Object clip)
        {
            if (controller == null || !controller.isActiveAndEnabled || clip == null)
            {
                return(null);
            }

            if (clip is AnimationClip)
            {
                if (_crossFadeDur > 0f)
                {
                    return(controller.CrossFadeAuxiliary(clip as AnimationClip,
                                                         (_settingsMask != 0) ? AnimSettings.Intersect(AnimSettings.Default, _settings, _settingsMask) : AnimSettings.Default,
                                                         _crossFadeDur, _queueMode, _playMode));
                }
                else
                {
                    return(controller.PlayAuxiliary(clip as AnimationClip,
                                                    (_settingsMask != 0) ? AnimSettings.Intersect(AnimSettings.Default, _settings, _settingsMask) : AnimSettings.Default,
                                                    _queueMode, _playMode));
                }
            }
            else if (clip is IScriptableAnimationClip)
            {
                return(controller.Play(clip as IScriptableAnimationClip));
            }

            return(null);
        }
        private object PlayClip(SPLegacyAnimController controller, UnityEngine.Object clip, PlayAnimInfo info)
        {
            if (clip is AnimationClip)
            {
                if (info.CrossFadeDur > 0f)
                {
                    return(controller.CrossFadeAuxiliary(clip as AnimationClip,
                                                         (info.SettingsMask != 0) ? AnimSettings.Intersect(AnimSettings.Default, info.Settings, info.SettingsMask) : AnimSettings.Default,
                                                         info.CrossFadeDur, info.QueueMode, info.PlayMode));
                }
                else
                {
                    return(controller.PlayAuxiliary(clip as AnimationClip,
                                                    (info.SettingsMask != 0) ? AnimSettings.Intersect(AnimSettings.Default, info.Settings, info.SettingsMask) : AnimSettings.Default,
                                                    info.QueueMode, info.PlayMode));
                }
            }
            else if (clip is IScriptableAnimationClip)
            {
                return(controller.Play(clip as IScriptableAnimationClip));
            }

            return(null);
        }