Exemplo n.º 1
0
        private void OnEnable()
        {
        #if !UNITY_EDITOR
            try
            {
        #endif
            if (removeBinding)
            {
                EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUI);

                controller = UIManager.Instance.GetController(UIConfig.ActivityUI);
                if (controller == null)
                {
                    return;
                }
                dataModel = controller.GetDataModel("") as ActivityDataModel;

                dataModel.PropertyChanged += OnEventPropertyChanged;

                Binding.SetBindDataSource(controller.GetDataModel(""));
            }
            FakeObjectCreate(dataModel.BossDataId);
            removeBinding = true;

        #if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
        #endif
        }
Exemplo n.º 2
0
        private void OnEnable()
        {
        #if !UNITY_EDITOR
            try
            {
        #endif
            controller = UIManager.Instance.GetController(UIConfig.SmithyUI);
            if (controller == null)
            {
                return;
            }
            Binding.SetBindDataSource(controller.GetDataModel(""));
            Binding.SetBindDataSource(controller.GetDataModel("EquipPack"));
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources);
            EventDispatcher.Instance.AddEventListener(UIEvent_SmithyFlyAnim.EVENT_TYPE, BlacksmithFlyAnim);
            Tip.SetActive(false);
        #if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
        #endif
        }
Exemplo n.º 3
0
        private void OnEnable()
        {
#if !UNITY_EDITOR
            try
            {
#endif
            CreateCharacterModel();
            controller = UIManager.Instance.GetController(UIConfig.ShiZhuangUI);
            if (controller == null)
            {
                return;
            }
            Binding.SetBindDataSource(controller.GetDataModel(""));
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel);
            Binding.SetBindDataSource(UIManager.Instance.GetController(UIConfig.WingUI).GetDataModel(""));
            Binding.SetBindDataSource(UIManager.Instance.GetController(UIConfig.BackPackUI).GetDataModel(""));
            EventDispatcher.Instance.AddEventListener(MyEquipChangedEvent.EVENT_TYPE, OnSelfEquipChanged);

#if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
#endif
        }
Exemplo n.º 4
0
        private void OnEnable()
        {
#if !UNITY_EDITOR
            try
            {
#endif

            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel);
            controller = UIManager.Instance.GetController(UIConfig.ExchangeUI);
            if (controller == null)
            {
                return;
            }
            Binding.SetBindDataSource(controller.GetDataModel(""));

            EventDispatcher.Instance.DispatchEvent(new ExChangeInit_Event());


#if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
#endif
        }
Exemplo n.º 5
0
        private void OnEnable()
        {
        #if !UNITY_EDITOR
            try
            {
        #endif

            IControllerBase controllerBase = null;
            controllerBase = UIManager.Instance.GetController(UIConfig.ComposeUI);

            if (controllerBase == null)
            {
                return;
            }
            Binding.SetBindDataSource(controllerBase.GetDataModel(""));
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources);
            Binding.SetBindDataSource(PlayerDataManager.Instance.NoticeData);
        #if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
        #endif
        }
Exemplo n.º 6
0
        private void OnEnable()
        {
#if !UNITY_EDITOR
            try
            {
#endif
            controller = UIManager.Instance.GetController(UIConfig.ClimbingTowerUI);
            if (controller == null)
            {
                return;
            }
            Binding.SetBindDataSource(controller.GetDataModel(""));
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources);
            EventDispatcher.Instance.AddEventListener(TowerRefreshBoss_Event.EVENT_TYPE, CreateFakeObj);

            NetManager.Instance.StartCoroutine(AskCheckTowerInfo());

#if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
#endif
        }
Exemplo n.º 7
0
        private void OnEnable()
        {
#if !UNITY_EDITOR
            try
            {
#endif

            controller = UIManager.Instance.GetController(UIConfig.MountUI);
            if (controller == null)
            {
                return;
            }
            Binding.SetBindDataSource(controller.GetDataModel(""));
            Binding.SetBindDataSource(PlayerDataManager.Instance.NoticeData);
            EventDispatcher.Instance.AddEventListener(MountRefreshModel_Event.EVENT_TYPE, CreateFakeObj);
            EventDispatcher.Instance.AddEventListener(MountEffect_Event.EVENT_TYPE, OnEffectEvent);

            EventDispatcher.Instance.DispatchEvent(new OnMountAction_Event(10));

#if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
#endif
        }
Exemplo n.º 8
0
 private void OnEnable()
 {
     mController = UIManager.Instance.GetController(UIConfig.GXRankingUI);
     if (mController == null)
     {
         return;
     }
     Binding.SetBindDataSource(mController.GetDataModel(""));
 }
Exemplo n.º 9
0
        private void OnEnable()
        {
#if !UNITY_EDITOR
            try
            {
#endif
            //EventDispatcher.Instance.AddEventListener(MieShiDisappearModelRoot_Event.EVENT_TYPE, DisappearModelRoot);
            EventDispatcher.Instance.AddEventListener(MieShiRefreshTowers_Event.EVENT_TYPE, RefreshTowers);
            EventDispatcher.Instance.AddEventListener(MieShiUiToggle_Event.EVENT_TYPE, UIToggleClick);
            EventDispatcher.Instance.AddEventListener(MieShiRefreshBoss_Event.EVENT_TYPE, CreateFakeObj);
            if (mRemoveBind)
            {
                EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUiBindRemove);

                mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI);


                if (mController == null)
                {
                    return;
                }

                MonsterModel = mController.GetDataModel("") as MonsterDataModel;
                MonsterModel.PropertyChanged += OnMonsterPropertyChangedEvent;

                Binding.SetBindDataSource(MonsterModel);
                Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel);
            }
            mRemoveBind = true;
            var main = UIManager.Instance.MainUIFrame.GetComponent <MainScreenFrame>();
            RefreshBtnState();

            //报名时间
            //  MonsterDataModel ad = DataModel.CurMonsterFuben.activity;
            if (MonsterModel != null)
            {
                DateTime time = MonsterModel.ActivityTime;
                if (time != null)
                {
                    DateTime tm  = time.AddMinutes(-(double)(Table.GetMieShiPublic(1).CanApplyTime));
                    DateTime tm2 = time;
                    BaoMingTime.text = string.Format("{0}--{1}", string.Format("{0:yyyy/MM/dd HH:mm}", tm), string.Format("{0:yyyy/MM/dd HH:mm}", tm2));// tm + "--" + tm2;
                }
            }


            int FubenId = MonsterModel.MonsterFubens[0].Fuben.FubenId;
#if !UNITY_EDITOR
        }

        catch (Exception ex)
        {
            Logger.Error(ex.ToString());
        }
#endif
        }
Exemplo n.º 10
0
    public void NotifyMieShiActivityState(int activityId, int state)
    {
        IControllerBase mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI);

        if (mController == null)
        {
            return;
        }
        ClientDataModel.MonsterDataModel DataModel = mController.GetDataModel("") as ClientDataModel.MonsterDataModel;
        DataModel.ActivityState = state;
    }
Exemplo n.º 11
0
        private void OnEnable()
        {
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel);
            controller = UIManager.Instance.GetController(UIConfig.ExchangeUI);
            if (controller == null)
            {
                return;
            }
            Binding.SetBindDataSource(controller.GetDataModel(""));

            EventDispatcher.Instance.DispatchEvent(new ExChangeInit_Event());
        }
Exemplo n.º 12
0
    public void NotifyMieShiActivityState(int activityId, int state)
    {
        EventDispatcher.Instance.DispatchEvent(new ApplyMishiPortrait_Event());

        IControllerBase mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI);

        if (mController == null)
        {
            return;
        }
        ClientDataModel.MonsterDataModel DataModel = mController.GetDataModel("") as ClientDataModel.MonsterDataModel;
        DataModel.ActivityState = state;
    }
Exemplo n.º 13
0
    public void Init()
    {
        IControllerBase mController   = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI);
        MonsterDataModel MonsterModel = mController.GetDataModel("MonsterModel") as MonsterDataModel;


        lIcons.Clear();
        float wight = mLineSprite.localSize.x;

        Table.ForeachMieshiTowerReward(tb =>
        {
            var temp = NGUITools.AddChild(objReward, mItem.gameObject);
            if (tb.ShowValue.Count == 2)
            {
                temp.transform.localPosition = new Vector3(tb.ShowValue[1] / 100.0f * wight, temp.transform.localPosition.y,
                                                           temp.transform.localPosition.z);
                temp.SetActive(true);

                var trigger = temp.GetComponentInChildren <UIEventTrigger>();
                trigger.onPress.Add(new EventDelegate(
                                        () =>
                {
                    OpenTips(tb.Id);
                }));
                trigger.onRelease.Add(new EventDelegate(CloseTips));



                var tbItem = Table.GetItemBase(tb.StepReward);

                var cell = temp.GetComponent <TowerUpRewardCell>();
                if (cell != null)
                {
                    if (MonsterModel != null)
                    {
                        bool bLingqu = (MonsterModel.RewardFlag & (1 << tb.Id)) > 0;
                        cell.SetLingqu(bLingqu);
                        cell.SetEffect((!bLingqu) && MonsterModel.MyUpTimes >= tb.TimesStep[0]);
                        if (tbItem != null)
                        {
                            cell.SetIcon(tbItem);
                        }
                    }
                }
                lIcons.Add(temp.GetComponent <TowerUpRewardCell>());
            }

            return(true);
        });
    }
Exemplo n.º 14
0
    public WingChargeDataModel GetWingChargeDataModle()
    {
        if (mWingChargeController != null)
        {
            var tempModel = mWingChargeController.GetDataModel("");
            if (tempModel != null)
            {
                var wingCahrgeModel = tempModel as WingChargeDataModel;
                if (wingCahrgeModel != null)
                {
                    return(wingCahrgeModel);
                }
            }
        }

        return(null);
    }
Exemplo n.º 15
0
    private void OnEnable()
    {
#if !UNITY_EDITOR
        try
        {
#endif
        mController = UIManager.Instance.GetController(UIConfig.ClimbingTowerRewardUI);
        if (mController == null)
        {
            return;
        }
        Binding.SetBindDataSource(mController.GetDataModel(""));

#if !UNITY_EDITOR
    }

    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }
Exemplo n.º 16
0
    void OnEnable()
    {
        IControllerBase mController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI);
        //ActivityDataModel dataModule = (mController.GetDataModel(string.Empty)) as ActivityDataModel;
        MonsterDataModel MonsterModel = mController.GetDataModel("MonsterModel") as MonsterDataModel;

        if (mController != null)
        {
            // mController.DataModule.CurMonsterFuben.activity.ActivityTime;

            /**BindDataRoot bdr = GetComponent<BindDataRoot>();
             * if (bdr != null)
             * {
             *  if (MonsterModel.CurMonsterFuben.activity == null)
             *  {
             *      MonsterModel.CurMonsterFuben.activity = new MonsterDataModel();
             *      MonsterModel.CurMonsterFuben.MomsterTower=new MonsterTowerDataModel();
             *  }
             *  bdr.SetBindDataSource(MonsterModel.CurMonsterFuben.activity);
             *  bdr.SetBindDataSource(MonsterModel.CurMonsterFuben.MomsterTower);
             * }**/
        }
    }
Exemplo n.º 17
0
    private void OnEnable()
    {
#if !UNITY_EDITOR
        try
        {
#endif
        if (mRemoveBind)
        {
            EventDispatcher.Instance.AddEventListener(CloseUiBindRemove.EVENT_TYPE, OnCloseUiBindRemove);
            EventDispatcher.Instance.AddEventListener(MieShiRefreshTowers_Event.EVENT_TYPE, RefreshTowers);
            mController = UIManager.Instance.GetController(UIConfig.BattryLevelUpUI);
            if (mController == null)
            {
                return;
            }
            MonsterModel = mController.GetDataModel("") as MonsterDataModel;
            MonsterModel.PropertyChanged += OnMonsterPropertyChangedEvent;
            OnPaotaiBtn();
            ShowPaotaiInfo(0);
            Binding.SetBindDataSource(MonsterModel);
            EventDispatcher.Instance.DispatchEvent(new MieShiOnGXRankingBtn_Event());
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.Bags.Resources);
        }
        // CreateFakeObj(DataModel.BossDataId);
        mRemoveBind = true;
        //  MonsterModel.UseDiamond = Table.GetMieShiPublic(1).CostNum;
        //  MonsterModel.UseProp = Table.GetMieShiPublic(1).ItemNum;
#if !UNITY_EDITOR
    }

    catch (Exception ex)
    {
        Logger.Error(ex.ToString());
    }
#endif
    }