示例#1
0
    public void OnShow()
    {
        EventDispatcher.Instance.AddEventListener(EquipCellSelect.EVENT_TYPE, OnEquipCellSelect);
        EventDispatcher.Instance.AddEventListener(EquipCellSwap.EVENT_TYPE, OnEquipCellSwap);
        EventDispatcher.Instance.AddEventListener(SmithyCellClickedEvent.EVENT_TYPE, OnClickCastLeftSideBtn);

        EquipDataModel = UIManager.Instance.GetController(UIConfig.EquipUI).GetDataModel("") as EquipUIDataModel;

        isShowing = true;
        if (EquipDataModel != null && EquipDataModel.OperateTypes[5] && mEquipPackController != null)
        {
            mEquipPackController.RefreshData(new EquipPackArguments {
                RefreshForEvoEquip = true
            });
        }
    }
示例#2
0
    public void RefreshData(UIInitArguments data)
    {
        var packArg = new BackPackArguments();

        if (data == null)
        {
            packArg.Tab = 1;
        }
        else
        {
            packArg.Tab = data.Tab;
        }
        PlayerDataManager.Instance.RefreshEquipStatus();
        BackPack.RefreshData(packArg);
        BackPack.CallFromOtherClass("SetPackType", new object[] { BackPackController.BackPackType.Character });
        Attribute.RefreshData(data);
    }
示例#3
0
 public void RefreshData(UIInitArguments data)
 {
     BackPack.RefreshData(data);
     PlayerDataManager.Instance.RefreshEquipBagStatus(eBagType.Depot);
     BackPack.CallFromOtherClass("SetPackType", new object[] { BackPackController.BackPackType.Depot });
 }
示例#4
0
    public void RefreshData(UIInitArguments data)
    {
        var args = data as StoreArguments;

        if (args == null)
        {
            return;
        }
        mServiceType = -1;
        BackPack.RefreshData(null);
        BackPack.CallFromOtherClass("SetPackType", new object[] { BackPackController.BackPackType.Character });
        DataModel.SelectId    = -1;
        DataModel.SelectCount = 1;
        DataModel.MaxCount    = -1;
        var type = args.Tab;

        DataModel.StoreType = type;

        var tbStoreType = Table.GetStoreType(type);

        if (tbStoreType != null)
        {
            DataModel.ResType = tbStoreType.ResType;
            DataModel.ResNum  = 0;
            if (tbStoreType.ResType != -1)
            {
                if (tbStoreType.ResType < (int)eResourcesType.CountRes && tbStoreType.ResType > (int)eResourcesType.InvalidRes)
                {
                    var resNum = PlayerDataManager.Instance.GetRes(tbStoreType.ResType);
                    if (resNum != -1)
                    {
                        DataModel.ResNum = resNum;
                    }
                }
            }
        }

        if (DataModel.StoreType > 100)
        {
            DataModel.ReplaceEquip = emptyBagItemData;
        }
        DataModel.ReplaceList.Clear();
        DataModel.ShowType = args.Tab;

        if (type == 15 || type == 16)
        {
            mVipModifyCache.Clear();
            var table = Table.GetVIP(PlayerDataManager.Instance.GetRes((int)eResourcesType.VipLevel));
            for (var i = 0; i < table.BuyItemId.Length; i++)
            {
                var id = table.BuyItemId[i];
                if (id != -1)
                {
                    mVipModifyCache.Add(id, table.BuyItemCount[i]);
                }
            }
        }
        if (args.Args != null && args.Args.Count > 0)
        {
            mServiceType = args.Args[0];
            NetManager.Instance.StartCoroutine(ApplyStoresCoroutine(type, args.Args[0]));
        }
        else
        {
            NetManager.Instance.StartCoroutine(ApplyStoresCoroutine(type));
        }
//      if (2==type)
//      {
//          if (PlayerDataManager.Instance.GetFlag(522))
//          {
//              var list = new Int32Array();
//              list.Items.Add(523);
//
//              var list1 = new Int32Array();
//              list1.Items.Add(522);
//              PlayerDataManager.Instance.SetFlagNet(list, list1);
//          }
//
//      }
    }
示例#5
0
        private void Start()
        {
        #if !UNITY_EDITOR
            try
            {
        #endif
            var controllerBase = UIManager.Instance.GetController(UIConfig.MainUI);
            if (controllerBase == null)
            {
                return;
            }
            Binding.SetBindDataSource(controllerBase.GetDataModel("Radar"));
            Binding.SetBindDataSource(controllerBase.GetDataModel("MainUI"));
            Binding.SetBindDataSource(controllerBase.GetDataModel("SelectTarget"));
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel);
            Binding.SetBindDataSource(PlayerDataManager.Instance.RewardNotice);
            Binding.SetBindDataSource(PlayerDataManager.Instance.PlayerDataModel.SkillData);
            var chatController = UIManager.Instance.GetController(UIConfig.ChatMainFrame);
            Binding.SetBindDataSource(chatController.GetDataModel(""));
            Binding.SetBindDataSource(PlayerDataManager.Instance.NoticeData);
            var missionController = UIManager.Instance.GetController(UIConfig.MissionTrackList);
            Binding.SetBindDataSource(missionController.GetDataModel(""));
            Binding.SetBindDataSource(controllerBase.GetDataModel("DeviceInfo"));
            var teamController = UIManager.Instance.GetController(UIConfig.TeamFrame);
            Binding.SetBindDataSource(teamController.GetDataModel(""));
            var rechargeController = UIManager.Instance.GetController(UIConfig.RechargeFrame);
            Binding.SetBindDataSource(rechargeController.GetDataModel("RechargeDataModel"));
            Binding.SetBindDataSource(PlayerDataManager.Instance.WeakNoticeData);
            var firstChargeController = UIManager.Instance.GetController(UIConfig.FirstChargeFrame);
            if (firstChargeController != null)
            {
                Binding.SetBindDataSource(firstChargeController.GetDataModel(""));
            }

            var activityController = UIManager.Instance.GetController(UIConfig.ActivityUI);
            if (activityController != null)
            {
                Binding.SetBindDataSource(activityController.GetDataModel(""));
            }

            var wingChargeController = UIManager.Instance.GetController(UIConfig.WingChargeFrame);
            if (wingChargeController != null)
            {
                Binding.SetBindDataSource(wingChargeController.GetDataModel(""));
            }

            var rechargeActivityController = UIManager.Instance.GetController(UIConfig.RechargeActivityUI);
            if (rechargeActivityController != null)
            {
                Binding.SetBindDataSource(rechargeActivityController.GetDataModel(""));
            }

            var settingController = UIManager.Instance.GetController(UIConfig.SettingUI);
            if (null != settingController)
            {
                Binding.SetBindDataSource(settingController.GetDataModel(""));
            }

            var operationActivityController = UIManager.Instance.GetController(UIConfig.OperationActivityFrame);
            if (null != operationActivityController)
            {
                Binding.SetBindDataSource(operationActivityController.GetDataModel(""));
            }

            EventDispatcher.Instance.AddEventListener(ShowCountdownEvent.EVENT_TYPE, OnEvent_ShowCountdown);
            EventDispatcher.Instance.AddEventListener(SkillEquipMainUiAnime.EVENT_TYPE, OnEvent_EquipSkillAnim);
            EventDispatcher.Instance.AddEventListener(UIEvent_BuffIncreaseAnimation.EVENT_TYPE, PlayBuffIncreaseAnim);
            EventDispatcher.Instance.AddEventListener(UI_BlockMainUIInputEvent.EVENT_TYPE, OnEvent_BlockMainScreen);
            EventDispatcher.Instance.AddEventListener(SceneTransition_Event.EVENT_TYPE, OnEvent_SceneChange);
            EventDispatcher.Instance.AddEventListener(Event_UpdateMissionData.EVENT_TYPE, OnEvent_UpdateMission);
            EventDispatcher.Instance.AddEventListener(FirstEnterGameEvent.EVENT_TYPE, OnEvent_ShowFirstEnterGame);
            EventDispatcher.Instance.AddEventListener(HiedMieShiIcon_Event.EVENT_TYPE, HiedMieshiIcon);
            EventDispatcher.Instance.AddEventListener(ShowPopTalk_Event.EVENT_TYPE, ShowBossTalk);
            EventDispatcher.Instance.AddEventListener(UIEvent_PlayMainUIBtnAnimEvent.EVENT_TYPE, OnNewFuncionGuideEvent);
            var PkBtnCount0 = PkBtn.Count;
            for (var i = 0; i < PkBtnCount0; i++)
            {
                var btn = PkBtn[i];
                var j   = i;
                btn.onClick.Add(new EventDelegate(() => { ChangePkModel(j); }));
            }

            SetupBufferList();
            //CreateOffineFrame();

            if (null != BlockInputWidget)
            {
                if (BlockInputWidget.gameObject.activeSelf)
                {
                    BlockInputWidget.gameObject.SetActive(false);
                }
            }

            countdownTime = Game.Instance.ServerTime;
            countdownType = eCountdownType.BattleFight;

            //撑大字的纹理
            if (!s_isPretreatString)
            {
                s_isPretreatString = true;
                var txt = ExpLable.GetComponent <UILabel>();
                if (null != txt && null != txt.font && null != txt.font.dynamicFont)
                {
                    txt.font.dynamicFont.RequestCharactersInTexture(GameSetting.Instance.PrepareString);
                }
            }
            IControllerBase monsterController = UIManager.Instance.GetController(UIConfig.MonsterSiegeUI);
            if (monsterController != null)
            {
                MonsterSiegeUIFrameArguments ms = new MonsterSiegeUIFrameArguments();
                ms.Tab = 5;
                monsterController.RefreshData(ms);
                // return;
            }

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

            var scene = GameLogic.Instance.Scene;
            if (null != scene)
            {
                if (null != scene.TableScene)
                {
                    if (1 == scene.TableScene.IsShowMainUI)
                    {
                        ShowMainButton();
                    }
                    else
                    {
                        HideMainButton();
                    }
                }
            }
#if !UNITY_EDITOR
        }

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