示例#1
0
        /// <summary>
        /// 移除效果
        /// </summary>
        /// <param name="_eType">效果类型</param>
        /// <param name="_goEffect">效果所处对象</param>
        public bool DestroyEffect(UEffectType _eType, ref UEffectParamBase _nParam)
        {
            switch (_eType)
            {
            case UEffectType.UET_EffectPrefab:
            {
                if (_nParam is UEffectPrefabParam)
                {
                    return(DestroyPrefabEffect(_nParam as UEffectPrefabParam));
                }
                else
                {
                    Trace.LogWarning("移除失败,效果类型是 UET_EffectPrefab,但参数不是 UEffectPrefabParam 这个类型");
                    return(false);
                }
            }

            case UEffectType.UET_EffectImage:
            {
                if (_nParam is UEffectImageParam)
                {
                    return(DestroyImageEffect(_nParam as UEffectImageParam));
                }
                else
                {
                    Trace.LogWarning("创建失败,效果类型是 UET_EffectImage,但参数不是 UEffectImageParam 这个类型");
                    return(false);
                }
            }

            case UEffectType.UET_EffectMaterial:
            {
                if (_nParam is UEffectMaterialParam)
                {
                    return(DestroyMaterialEffect(_nParam as UEffectMaterialParam));
                }
                else
                {
                    Trace.LogWarning("创建失败,效果类型是 UET_EffectMaterial,但参数不是 UEffectMaterialParam 这个类型");
                    return(false);
                }
            }

            case UEffectType.UET_EffectMesh:
            {
                if (_nParam is UEffectMeshParam)
                {
                    return(DestroyMeshEffect(_nParam as UEffectMeshParam));
                }
                else
                {
                    Trace.LogWarning("创建失败,效果类型是 UET_EffectMesh,但参数不是 UEffectMeshParam 这个类型");
                    return(false);
                }
            }

            default:
                return(false);
            }
        }
示例#2
0
        public override void DoRegisterEffectNode()
        {
            if (m_bIsRegister)
            {
                return;
            }

            UEffectParamBase param = m_MaterialParam as UEffectParamBase;

            UEffectManager.Instance.CreateEffect(UEffectType.UET_EffectMaterial, ref param);
            m_bIsRegister = true;
        }
示例#3
0
        public override void DoUnRegisterEffectNode()
        {
            if (!m_bIsRegister)
            {
                return;
            }

            UEffectParamBase param = m_MaterialParam as UEffectParamBase;

            UEffectManager.Instance.DestroyEffect(UEffectType.UET_EffectMaterial, ref param);

            m_bIsRegister = false;
        }
示例#4
0
        /// <summary>
        /// 预加载一些效果,目前只支持预制体效果。
        /// </summary>
        /// <param name="_eType"></param>
        /// <param name="_nParam"></param>
        /// <returns></returns>
        public bool PreLoadEffect(UEffectType _eType, ref UEffectParamBase _nParam)
        {
            switch (_eType)
            {
            case UEffectType.UET_EffectPrefab:
            {
                if (_nParam is UEffectPrefabParam)
                {
                    return(LoadEffectPrefab((_nParam as UEffectPrefabParam)) != null);
                }
                else
                {
                    Trace.LogWarning("创建失败,效果类型是 UET_EffectPrefab,但参数不是 UEffectPrefabParam 这个类型");
                    return(false);
                }
            }
            break;

            default:
                Trace.LogWarning("目前只有预制体特效才会进行预加载");
                return(false);
            }
        }