Example #1
0
        public NormalEffect CreateNormalEffect(string res, Vector3 position, Vector3 dir)
        {
            if (res.EndsWith("/0"))
            {
                return(null);
            }

            NormalEffect effect = new NormalEffect();

            //加载特效信息
            effect.resPath   = res;
            effect.cehuaTime = 0;


            //创建
            effect.Create();
            if (effect.obj == null)
            {
                return(null);
            }
            effect.obj.transform.position = position;
            effect.obj.transform.rotation = Quaternion.LookRotation(dir);

            AddEffect(effect.projectID, effect);
            return(effect);
        }
Example #2
0
        //6.创建普通引导特效
        public NormalEffect CreateLeadingEffect(UInt64 owner, UInt32 skillModelID, UInt32 projectid)
        {
            SkillLeadingonfig skillconfig = ConfigReader.GetSkillLeadingConfig(skillModelID);

            //判断路径是否有效
            if (skillconfig == null || skillconfig.effect == "0")
            {
                return(null);
            }

            string       resourcePath = GameConstDefine.LoadGameSkillEffectPath + "release/" + skillconfig.effect;
            NormalEffect effect       = new NormalEffect();

            //加载特效信息
            effect.projectID = projectid;
            effect.NEType    = NormalEffect.NormalEffectType.eNE_Leading;
            effect.resPath   = resourcePath;

            IEntity entity = null;

            EntityManager.AllEntitys.TryGetValue(owner, out entity);

            //创建
            if (entity != null)
            {
                effect.Create();
                if (effect.obj == null)
                {
                    return(null);
                }
                if (null != entity.RealEntity.objPoint)
                {
                    effect.obj.transform.parent        = entity.RealEntity.objPoint.transform;
                    effect.obj.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f);
                }
            }

            AddEffect(effect.projectID, effect);
            return(effect);
        }
Example #3
0
        //5.普通特效
        public NormalEffect CreateNormalEffect(string res, GameObject parent)
        {
            if (res.EndsWith("/0"))
            {
                return(null);
            }

            NormalEffect effect = new NormalEffect();

            //加载特效信息
            effect.Target  = parent;
            effect.resPath = res;


            //创建
            effect.Create();

            if (effect.obj == null)
            {
                return(null);
            }
            AddEffect(effect.projectID, effect);
            return(effect);
        }