Exemplo n.º 1
0
        public static void OnAction <T>(BaseEntity entity, EventSetData data) where T : I_EntityAction, new()
        {
            I_EntityAction t = Pop <T>();

            t.OnAction(entity, data);
            data.Reset();
        }
Exemplo n.º 2
0
        public override void ReverseEffect(EventSetData data)
        {
            EventSetEffectData attributeData = data as EventSetEffectData;

            EffectLog.Assert(attributeData != null, "属性变更 参数类型不对[{0}]", data);
            if (attributeData == null)
            {
                return;
            }

            // 属性和数值
            EntityAttributeProperty attPro = attributeData._entity.AttributeProp;

            // 1.更新的属性类型
            E_EntityAttributeType attributeType  = _attParam.entity_attribute_type;
            AttributeIntParam     attributeParam = attPro.FindAttribute(attributeType);

            float oldValue = attributeParam.Value;

            attributeParam.SetPlus(_cumulativeData);

            float changeValue = attributeParam.Value - oldValue;

            EffectLog.Log("属性变更回退--->属性:[{0}],before:[{1}],after:[{2}],change:[{3}]", attributeType, oldValue, attributeParam.Value, changeValue);
        }
Exemplo n.º 3
0
 public void RaiseEvent(E_EntityInTrigger key, EventSetData objInfo)
 {
     SkillLog.Assert(_context != null && _context._owner != null, "SequenceLeafNode RaiseEvent:[{0}] Fail", key);
     if (_context == null || _context._owner == null)
     {
         return;
     }
     _context._owner.RaiseEvent(key, objInfo);
     EventDataFactory.Push(objInfo);
 }
Exemplo n.º 4
0
        public void OnAction(BaseEntity entity, EventSetData param)
        {
            PlayEffectEventSkill data = param as PlayEffectEventSkill;

            if (data == null)
            {
                return;
            }

            PoolVfxObject vfx_go = TransformPool.Instance.Pop <PoolVfxObject>(data.effect_name);

            if (vfx_go)
            {
                return;
            }
            vfx_go.SetLifeTime(2f);
            vfx_go.BindGameobject(entity.EntityController.gameObject);
        }
Exemplo n.º 5
0
        public override void ExcuteEffect(EventSetData data)
        {
            // 参数
            EventSetEffectData attributeData = data as EventSetEffectData;

            EffectLog.Assert(attributeData != null, "属性变更 参数类型不对[{0}]", data);
            if (attributeData == null)
            {
                return;
            }

            // 属性和数值
            EntityAttributeProperty attPro = attributeData._entity.AttributeProp;

            // 1.更新的属性类型
            E_EntityAttributeType attributeType  = _attParam.entity_attribute_type;
            AttributeIntParam     attributeParam = attPro.FindAttribute(attributeType);
            float oldValue = attributeParam.Value;

            float newValue = 0;
            int   length   = _attParam.values.Count;

            for (int i = 0; i < length; i++)
            {
                float tmpValue = attributeParam.Value;
                // 2.更新的数据的类型(百分比、固定数值)
                E_DataUpdateType dataUpdateType = _attParam.values[i].data_type;
                // 3.数值
                float dataValue = _attParam.values[i].value;

                // 4.计算
                ValueHelper.Calc(attributeParam, dataUpdateType, (int)dataValue);

                newValue += (attributeParam.Value - tmpValue);
            }

            _cumulativeData += newValue;
            EffectLog.Log("执行计算--->属性:[{0}],before:[{1}],after:[{2}],change:[{3}]", attributeType, oldValue, attributeParam.Value, newValue);
        }
Exemplo n.º 6
0
 public static void Raise(BaseEntity target, E_EntityInTrigger key, EventSetData objInfo)
 {
     target.RaiseEvent(key, objInfo);
     EventDataFactory.Push(objInfo);
 }
Exemplo n.º 7
0
 public void RaiseEvent(E_EntityInTrigger key, EventSetData obj_info)
 {
     _context.RaiseEvent(key, obj_info);
 }