Exemplo n.º 1
0
        private LimitedTimeGiftTemplate ParseLimitedTimeGift(GM.DataCache.LimitedTimeGift obj)
        {
            LimitedTimeGiftTemplate tpl = new LimitedTimeGiftTemplate();

            tpl.ID              = obj.Id;
            tpl.TriggerType     = (LTGTriggerType)obj.TriggerType;
            tpl.TargetParameter = obj.TargetParameter;
            tpl.TriggerOpenTime = obj.TriggerOpenTime;
            tpl.Duration        = obj.Duration;
            tpl.GiftList        = ParseGiftList(obj.Gift);
            return(tpl);
        }
Exemplo n.º 2
0
        private bool InitLimitedTimeGift(GM.DataCache.ConditionTask tasks)
        {
            if (tasks == null)
            {
                EB.Debug.LogError("InitLimitedTimeGift: LimitedTimeGift is null");
                return(false);
            }

            mLimitedTimeGiftList = new List <LimitedTimeGiftTemplate>();
            for (int i = 0; i < tasks.LimitedTimeGiftLength; ++i)
            {
                LimitedTimeGiftTemplate data = ParseLimitedTimeGift(tasks.GetLimitedTimeGift(i));
                if (data != null && !string.IsNullOrEmpty(data.ID))
                {
                    mLimitedTimeGiftList.Add(data);
                }
            }

            return(true);
        }