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

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

            // SkillUtil.Log(string.Format("[BUFFMANAGER] [NAME->{0}] [Trigger]->{1} [ActionID]->{2}   ",
            //    mContext.GetSelfActor().GetTransform().name, type, actionId));
            SkillActionTrigger.Instance.TriggerBuff(buff.GetOwner(), actionId, buff.GetIdentifyId());
        }
Esempio n. 3
0
        public void OnBuffEventDispatch(EBuffActionType type)
        {
            var buffList = 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);
                }
            }
        }
Esempio n. 4
0
        private bool IsBuffActionType(int buffId, EBuffActionType type, out int actionId)
        {
            actionId = 0;
            var data = SkillUtil.GetSkillBuffData(buffId);

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

            foreach (var t in data.Action)
            {
                EBuffActionType triggerType = (EBuffActionType)t.Key;
                if (type != triggerType)
                {
                    continue;
                }
                actionId = t.Value;
                return(true);
            }

            return(false);
        }