Exemple #1
0
        private bool IsBuffActionType(IBuff buff, BuffActionType type, out int actionId)
        {
            actionId = 0;
            if (buff == null)
            {
                return(false);
            }
            int buffId = buff.GetBuffId();

            return(IsBuffActionType(buffId, type, out actionId));
        }
Exemple #2
0
        private void Trigger(IBuff buff, BuffActionType type, int actionId)
        {
            if (buff.GetIdentifyId() == SkillDefine.NONE)
            {
                var param = buff.GetOwner().CreateBuffParam(this.mContext.GetSelfActor());
                buff.SetIdentifyId(param.IdentifyId);
            }

            // SkillUtil.Log(string.Format("[BUFFMANAGER] [NAME->{0}] [Trigger]->{1} [ActionID]->{2}   ",
            //    this.mContext.GetSelfActor().GetTransform().name, type, actionId));
            SkillActionTrigger.Instance.TriggerBuff(buff.GetOwner(), actionId, buff.GetIdentifyId());
        }
Exemple #3
0
        public void OnBuffEventDispatch(BuffActionType type)
        {
            var buffList = this.buffMap.AsList();

            for (int i = 0; i < buffList.Count; i++)
            {
                var buff = buffList[i];
                if (buff == null)
                {
                    SkillUtil.LogError(string.Format("[BUFFMANAGER] BuffList index->[{0}] 's element is null ", i));
                    continue;
                }

                if (IsBuffActionType(buff, type, out int actionId))
                {
                    Trigger(buff, type, actionId);
                }
            }
        }
Exemple #4
0
        private bool IsBuffActionType(int buffId, BuffActionType type, out int actionId)
        {
            actionId = 0;
            var data = SkillUtil.GetSkillBuffData(buffId);

            if (data == null)
            {
                return(false);
            }

            for (int j = 0; j < data.Action.Count; j++)
            {
                BuffActionType triggerType = (BuffActionType)data.Action[j].Key;
                if (type == triggerType)
                {
                    actionId = data.Action[j].Value;
                    return(true);
                }
            }

            return(false);
        }