| | |
| | | //<寻宝类型,<物品id,格子背景编号>>
|
| | | public Dictionary<int, Dictionary<int, int>> itemIdBgDict = new Dictionary<int, Dictionary<int, int>>();
|
| | |
|
| | | //<寻宝类型,功能ID>
|
| | | public Dictionary<int, int> funcIDDict = new Dictionary<int, int>();
|
| | | public int actNum = 10; //对应界面
|
| | | public event Action<bool> UpdateMissionEvent;
|
| | | public readonly int AwardCellCount = 5;
|
| | |
| | | public bool isSkipXB { get; set; }
|
| | |
|
| | | HappyXBModel happyXBModel { get { return ModelCenter.Instance.GetModelEx<HappyXBModel>(); } }
|
| | | PackModel packModel { get { return ModelCenter.Instance.GetModel<PackModel>(); } }
|
| | |
|
| | | public override void Init()
|
| | | {
|
| | |
| | | OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
|
| | | happyXBModel.RefreshXBTypeInfoAct += OnRefreshXBTypeInfoAct;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent += OnOperationTimeUpdateEvent;
|
| | | packModel.refreshItemCountEvent += OnRefreshItemCountEvent;
|
| | | OpenServerActivityCenter.Instance.Register(activityID, this, activityType);
|
| | |
|
| | | var jsonData = JsonMapper.ToObject(FuncConfigConfig.Get("YunShi").Numerical1);
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | jsonData = JsonMapper.ToObject(FuncConfigConfig.Get("YunShi").Numerical2);
|
| | | keyList = jsonData.Keys.ToList();
|
| | | for (int i = 0; i < keyList.Count; i++)
|
| | | {
|
| | | int type = int.Parse(keyList[i]);
|
| | | int funcId = int.Parse(jsonData[keyList[i]].ToJson());
|
| | | funcIDDict[type] = funcId;
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | |
| | | {
|
| | | happyXBModel.RefreshXBTypeInfoAct -= OnRefreshXBTypeInfoAct;
|
| | | OperationTimeHepler.Instance.operationTimeUpdateEvent -= OnOperationTimeUpdateEvent;
|
| | | packModel.refreshItemCountEvent -= OnRefreshItemCountEvent;
|
| | | }
|
| | |
|
| | | private void OnRefreshItemCountEvent(PackType type, int arg2, int arg3)
|
| | | {
|
| | | UpdateRedPoint();
|
| | | }
|
| | |
|
| | | private void OnOperationTimeUpdateEvent(Operation operation)
|
| | |
| | | list.Sort();
|
| | | if (list == null)
|
| | | return;
|
| | |
|
| | | if (happyXBModel.IsHaveOneXBTool(type) || (happyXBModel.IsHaveManyXBTool(type, out int toolCnt, out int needToolCnt) && toolCnt >= needToolCnt))
|
| | | redPointTab.state = RedPointState.Simple;
|
| | |
|
| | | //有奖励未领取
|
| | | for (int i = 0; i < AwardCellCount; i++)
|
| | | {
|
| | |
| | | return ((int)Math.Pow(2, index) & treasureCntAward) == 0 ? 1 : 2;
|
| | | }
|
| | |
|
| | | public bool IsFuncOpen()
|
| | | {
|
| | | OperationYunShi act;
|
| | | OperationTimeHepler.Instance.TryGetOperation(YunShiXBActModel.operaType, out act);
|
| | | if (act == null)
|
| | | return false;
|
| | |
|
| | | int type = act.treasureType;
|
| | | var xbInfo = happyXBModel.GetXBInfoByType(type);
|
| | | if (xbInfo == null)
|
| | | return false;
|
| | |
|
| | | if (!funcIDDict.TryGetValue(type, out var funcId))
|
| | | return false;
|
| | | return FuncOpen.Instance.IsFuncOpen(funcId);
|
| | | }
|
| | |
|
| | | public void SendGetAward(int type, int count)
|
| | | {
|
| | | CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
|