Example #1
0
        public override void Awake()
        {
            base.Awake();

            var t = controller.transform;

            ButtonGrid            = t.GetComponent <UIGrid>("Content/ScrollView/Placeholder/ButtonList");
            TitleTemplate         = t.GetMonoILRComponent <LTActivityTitleItem>("Content/ScrollView/Placeholder/ButtonList/template");
            InsPartnerTransform   = t.FindEx("Content/ViewList");
            Template3             = t.GetMonoILRComponent <LTActivityBodyItem_Gift>("Content/ViewList/template3");
            Template4             = t.GetMonoILRComponent <LTActivityBodyItem>("Content/ViewList/template4");
            Template5             = t.GetMonoILRComponent <LTActivityBodyItem_ScoreRepeat>("Content/ViewList/template5");
            Template6             = t.GetMonoILRComponent <LTActivityBodyItem_ScoreOnce>("Content/ViewList/template6");
            Template7             = t.GetMonoILRComponent <LTActivityBodyItem_SevenDay>("Content/ViewList/template7");
            Template8             = t.GetMonoILRComponent <LTActivityBodyItem_Draw>("Content/ViewList/template8");
            Template9             = t.GetMonoILRComponent <LTActivityBodyItem_Turntable>("Content/ViewList/template9");
            Template10            = t.GetMonoILRComponent <LTActivityBodyItem_LuckyCat>("Content/ViewList/template10");
            Template11            = t.GetMonoILRComponent <LTActivityBodyItem_URPartner>("Content/ViewList/template11");
            Template12            = t.GetMonoILRComponent <LTActivityBodyItem_EquipmentWish>("Content/ViewList/template12");
            Template13            = t.GetMonoILRComponent <LTActivityBodyItem_BossChallenge>("Content/ViewList/template13");
            Template14            = t.GetMonoILRComponent <LTActivityBodyItem_SSRWish>("Content/ViewList/template14");
            Template15            = t.GetMonoILRComponent <LTActivityBodyItem_Monopoly>("Content/ViewList/template15");
            Template16            = t.GetMonoILRComponent <LTActivityBodyItem_Racing>("Content/ViewList/template16");
            controller.backButton = t.GetComponent <UIButton>("UINormalFrameBG/CancelBtn");

            progresBar = t.GetComponent <UIProgressBar>("Content/ScrollView/UIScrollBar");
            ArrowObj   = t.FindEx("Content/Arrow").gameObject;
            progresBar.onChange.Add(new EventDelegate(OnChange));
            TitleTemplate.mDMono.gameObject.CustomSetActive(false);
            Template3.mDMono.gameObject.CustomSetActive(false);
            Template4.mDMono.gameObject.CustomSetActive(false);
            Template5.mDMono.gameObject.CustomSetActive(false);
            Template6.mDMono.gameObject.CustomSetActive(false);
            Template7.mDMono.gameObject.CustomSetActive(false);
            Template8.mDMono.gameObject.CustomSetActive(false);
            Template9.mDMono.gameObject.CustomSetActive(false);
            Template10.mDMono.gameObject.CustomSetActive(false);
            Template11.mDMono.gameObject.CustomSetActive(false);
            Template12.mDMono.gameObject.CustomSetActive(false);
            Template13.mDMono.gameObject.CustomSetActive(false);
            Template14.mDMono.gameObject.CustomSetActive(false);
            Template15.mDMono.gameObject.CustomSetActive(false);
            Template16.mDMono.gameObject.CustomSetActive(false);
        }
Example #2
0
        public bool CheckEventRedPoint(object ActivityData)
        {
            int aid       = EB.Dot.Integer("activity_id", ActivityData, 0);
            int disappear = EB.Dot.Integer("displayuntil", ActivityData, 0);
            int endTime   = EB.Dot.Integer("end", ActivityData, 0);

            if (EB.Time.Now >= disappear)
            {
                return(false);
            }

            string state = EB.Dot.String("state", ActivityData, "");

            if (state.Equals("pending"))
            {
                return(false);
            }

            var       stages = EventTemplateManager.Instance.GetTimeLimitActivityStages(aid);
            Hashtable activityData;

            DataLookupsCache.Instance.SearchDataByID("tl_acs." + aid, out activityData);
            int score = 0;

            switch (aid)
            {
            case 6507:
                score = BalanceResourceUtil.GetUserDiamond();    //招财猫没分数,取钻石数
                break;

            case 6518:
                if (EB.Time.Now >= endTime)
                {
                    return(false);
                }
                var equipId = EB.Dot.Integer("current", activityData, 0);
                return(equipId <= 0);

            case 6519:
            case 6520:
            case 6521:
                int      timeTemp = Mathf.Max(endTime - EB.Time.Now, 0);
                TimeSpan ts       = new TimeSpan(0, 0, timeTemp);
                return(PlayerPrefs.GetInt(LTActivityBodyItem_BossChallenge.HasEnterActivityKey, 0) != ts.Days ||
                       LTActivityBodyItem_BossChallenge.IsShowRedPointInShop() ||
                       LTActivityBodyItem_BossChallenge.IsShowRedPointOnReward(aid));

            case 6701:
                if (EB.Time.Now >= endTime)
                {
                    return(false);
                }
                return(LTInstanceMapModel.Instance.GetFreeDice() || LTInstanceMapModel.Instance.GetMonopolyDiceTotleCount() > 0);

            case 6801:
                return(LTActivityRacingManager.Instance.AnyGroupWithinBetDuring());

            default:
                score = EB.Dot.Integer("current", activityData, 0);
                break;
            }

            for (var i = 0; i < stages.Count; ++i)
            {
                var stage = stages[i];

                if (score < stage.stage)
                {
                    continue;
                }

                int rewardgot = EB.Dot.Integer(string.Format("stages.{0}", stage.id), activityData, 0);

                if (stage.realm_num > 0)
                {
                    int realmgot = EB.Dot.Integer(string.Format("realm_num.{0}", stage.id), activityData, 0);

                    if (realmgot < stage.realm_num && rewardgot <= 0)
                    {
                        return(true);
                    }
                }
                else
                {
                    if (rewardgot < stage.num)
                    {
                        return(true);
                    }
                }
            }
            switch (aid)//活动结束后红点立即消失,积分奖励需要存在
            {
            case 6511:
            case 6512:
            case 6513:
                if (EB.Time.Now >= endTime)
                {
                    return(false);
                }
                bool isfree = false;
                if (!DataLookupsCache.Instance.SearchDataByID <bool>(string.Format("lottery.urbuddy.{0}.isFree", aid), out isfree))
                {
                    isfree = true;
                }
                if (isfree)
                {
                    return(isfree);
                }
                int tenUrDrawCard = (int)NewGameConfigTemplateManager.Instance.GetGameConfigValue("hcLotteryTenTimes");
                if (BalanceResourceUtil.GetUserDiamond() >= tenUrDrawCard)
                {
                    return(true);
                }
                break;

            default:
                break;
            }
            return(false);
        }
Example #3
0
        public override IEnumerator OnRemoveFromStack()
        {
            TweenPosition tweener = controller.GObjects["mAniamtionTarget"].GetComponent <TweenPosition>();

            tweener.transform.localPosition = tweener.from;
            isPlayedAnimation = false;
            StopAllCoroutines();
            DestroySelf();

            // 离开首领兑换商店时保存可购买的商品数量
            PlayerPrefs.SetInt(LTActivityBodyItem_BossChallenge.CanBuyCountFromShopKey, LTActivityBodyItem_BossChallenge.GetCanBuyCount(_shopType));
            PlayerPrefs.Save();
            yield break;
        }