Example #1
0
        public override void SetMenuData(object param)
        {
            base.SetMenuData(param);

            Hashtable ht = param as Hashtable;

            mEventId  = int.Parse(ht["eventId"].ToString());
            mCallBack = ht["cb"] as System.Action;
            Hotfix_LT.Data.NationSpecialEventTemplate tpl = Hotfix_LT.Data.EventTemplateManager.Instance.GetNationSpecialEventTpl(mEventId);
            if (tpl != null)
            {
                LTUIUtil.SetText(TipsLabel, tpl.desc);
            }
        }
Example #2
0
        public void OnYesBtnClick()
        {
            controller.transform.localScale = Vector3.zero;
            NationManager.Instance.SureEvent(delegate(Hashtable result)
            {
                UITweener[] tweeners = controller.transform.GetComponents <UITweener>();
                if (result != null)
                {
                    Hotfix_LT.Data.NationSpecialEventTemplate tpl = Hotfix_LT.Data.EventTemplateManager.Instance.GetNationSpecialEventTpl(mEventId);
                    if (tpl != null)
                    {
                        LTUIUtil.SetText(TipsLabel, tpl.desc);
                    }
                    int eventResult = EB.Dot.Integer("nation.eventResult", result, -1);
                    if (eventResult == 0) //成功
                    {
                        LTUIUtil.SetText(TipsLabel, tpl.result_desc1);
                        TipsLabel.color = LT.Hotfix.Utility.ColorUtility.GreenColor;
                        FusionAudio.PostEvent("UI/New/GuoZhanHao", true);
                        SuccessTick.CustomSetActive(true);
                        FailTick.CustomSetActive(false);
                    }
                    else if (eventResult == 1)
                    {
                        LTUIUtil.SetText(TipsLabel, tpl.result_desc2);
                        TipsLabel.color = LT.Hotfix.Utility.ColorUtility.RedColor;
                        FusionAudio.PostEvent("UI/New/GuoZhanHuai", true);
                        SuccessTick.CustomSetActive(false);
                        FailTick.CustomSetActive(true);
                    }
                    else
                    {
                        EB.Debug.LogError("nation.eventResult error : result={0}", eventResult);
                    }

                    YesBtnGO.CustomSetActive(false);
                    NOBtnGO.CustomSetActive(false);
                    SureBtnGO.CustomSetActive(true);
                }

                for (int j = 0; j < tweeners.Length; ++j)
                {
                    tweeners[j].tweenFactor = 0;
                    tweeners[j].PlayForward();
                }
            });
        }