| | |
| | | [SerializeField] Text m_DownTime; |
| | | [SerializeField] Button FinishNow; |
| | | [SerializeField] RawImage m_RawRole; |
| | | [SerializeField] RawImage m_NPC; |
| | | [SerializeField] ScrollerController m_Scroller; |
| | | [SerializeField] Button m_Button; |
| | | [SerializeField] Text m_ButtonText; |
| | | [SerializeField] Text FindCountSys; |
| | | [SerializeField] Text NoItem; |
| | | [SerializeField] Text allUseActivity; |
| | | [SerializeField] Text ExpYesterday; |
| | | [SerializeField] Text ExpToday; |
| | | [SerializeField] Text ExpMinute; |
| | | |
| | | int m_itemID = 0; |
| | | int m_Money = 0; |
| | | int OneTimes = 0; |
| | | int maxCnt = 0; |
| | | int useActivity = 0; |
| | | int ButtonModel = 0; //三个状态 0. 开始探索,1.继续探索 2. 领取X次奖励 |
| | | int ButtonModel = 0; //三个状态 0. 开始修炼,1.继续修炼 2. 领取X次奖励 |
| | | DailyQuestModel dailyModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } } |
| | | PackModel playerPack { get { return ModelCenter.Instance.GetModel<PackModel>(); } } |
| | | |
| | | int ExpTime = 1; |
| | | string ExpFormula; |
| | | #region Built-in |
| | | protected override void BindController() |
| | | { |
| | |
| | | var _jsonDataC = LitJson.JsonMapper.ToObject(configNum1); |
| | | m_itemID = int.Parse(_jsonDataC[0].ToString()); |
| | | m_Money = int.Parse(_jsonDataC[1].ToString()); |
| | | |
| | | var cfg = FuncConfigConfig.Get("ActivityPlaceExp"); |
| | | if (cfg != null) |
| | | { |
| | | ExpTime = int.Parse(cfg.Numerical1); |
| | | ExpFormula = cfg.Numerical2; |
| | | } |
| | | } |
| | | |
| | | protected override void AddListeners() |
| | | { |
| | | m_Close.SetListener(CloseClick); |
| | | FinishNow.SetListener(()=> { |
| | | if (playerPack.GetItemCountByID(PackType.Item, m_itemID) == 0 && PlayerDatas.Instance.baseData.bindDiamond < m_Money) |
| | | { |
| | | SysNotifyMgr.Instance.ShowTip("GoldPaperErr"); |
| | | } |
| | | else |
| | | { |
| | | WindowCenter.Instance.Open<FastFinishWin>(); |
| | | } |
| | | }); |
| | | |
| | | //FinishNow.SetListener(()=> { |
| | | // if (playerPack.GetItemCountByID(PackType.Item, m_itemID) == 0 && PlayerDatas.Instance.baseData.bindDiamond < m_Money) |
| | | // { |
| | | // SysNotifyMgr.Instance.ShowTip("GoldPaperErr"); |
| | | // } |
| | | // else |
| | | // { |
| | | // WindowCenter.Instance.Open<FastFinishWin>(); |
| | | // } |
| | | //}); |
| | | |
| | | } |
| | | |
| | | protected override void OnPreOpen() |
| | |
| | | dailyModel.ActivityPlaceInfoEvent += Display; |
| | | m_Scroller.OnRefreshCell += OnRefreshItemCell; |
| | | dailyModel.usableActivePointUpdateEvent += ShowFindCountSys; |
| | | PlayerMainDate.Event_Experience += OnExperience; |
| | | Display(); |
| | | QueryExp(); |
| | | } |
| | | |
| | | |
| | |
| | | // yield return new WaitForSeconds(1); |
| | | // } |
| | | //} |
| | | private void QueryExp() |
| | | { |
| | | var send = new CB029_tagCMActivityPlaceQuery(); |
| | | GameNetSystem.Instance.SendInfo(send); |
| | | } |
| | | |
| | | private void OnExperience(int source, int expPoint, int exp) |
| | | { |
| | | if (source == 9) |
| | | QueryExp(); |
| | | } |
| | | |
| | | private void Display() |
| | | { |
| | | var npcConfig = NPCConfig.Get(20103003); |
| | | UI3DModelExhibition.Instance.ShowNPC(20103003, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawRole); |
| | | UI3DModelExhibition.Instance.ShowNPC(20103003, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_NPC); |
| | | ExpYesterday.text = Language.Get("ActivityPlaceExp1", UIHelper.ReplaceLargeNum((ulong)(dailyModel.ActivityPlaceInfo.YestordayExp + |
| | | dailyModel.ActivityPlaceInfo.YestordayExpPoint * Constants.ExpPointValue))); |
| | | ExpToday.text = Language.Get("ActivityPlaceExp2", UIHelper.ReplaceLargeNum((ulong)(dailyModel.ActivityPlaceInfo.TodayExp + |
| | | dailyModel.ActivityPlaceInfo.TodayExpPoint * Constants.ExpPointValue))); |
| | | |
| | | |
| | | Equation.Instance.Clear(); |
| | | PlayerLVConfig cfg = PlayerLVConfig.Get(PlayerDatas.Instance.baseData.LV); |
| | | if (cfg != null) |
| | | { |
| | | Equation.Instance.AddKeyValue("reExp", cfg.ReExp); |
| | | } |
| | | |
| | | ExpMinute.text = Language.Get("ActivityPlaceExp3", UIHelper.ReplaceLargeNum(60/ ExpTime*Equation.Instance.Eval<int>(ExpFormula))); |
| | | |
| | | //var npcConfig = NPCConfig.Get(20103003); |
| | | //UI3DModelExhibition.Instance.ShowNPC(20103003, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_RawRole); |
| | | //UI3DModelExhibition.Instance.ShowNPC(20103003, npcConfig.UIModeLOffset, npcConfig.UIModelRotation, m_NPC); |
| | | |
| | | |
| | | |
| | | var remindCount = dailyModel.ActivityPlaceInfo.PlaceCount; |
| | | if (remindCount == 0) |
| | | { |
| | |
| | | |
| | | protected override void OnAfterOpen() |
| | | { |
| | | UI3DModelExhibition.Instance.ShowSitDownPlayer(m_RawRole, PlayerDatas.Instance.baseData.Job); |
| | | } |
| | | |
| | | protected override void OnPreClose() |
| | |
| | | dailyModel.ActivityPlaceInfoEvent -= Display; |
| | | m_Scroller.OnRefreshCell -= OnRefreshItemCell; |
| | | dailyModel.usableActivePointUpdateEvent -= ShowFindCountSys; |
| | | PlayerMainDate.Event_Experience -= OnExperience; |
| | | UI3DModelExhibition.Instance.StopShow(); |
| | | } |
| | | |