public BigWorldDayNightSystem(Dictionary <string, Material> allMat) { //this.m_yeWanParticle = GameObject.FindGameObjectWithTag("sceneYeWan"); if (yeWanParticle != null) { yeWanParticle.SetActive(false); } m_LightTex = new Texture[m_LightTexPath.Length + 1]; long second = CommonTools.GetCurrentTimeSecond(); m_daySpeed = 86400f / m_dayTotalSecond; m_curSecond = second / m_daySpeed; //m_curSecond = second % m_dayTotalSecond; this.m_dayHour = this.m_dayTotalSecond / m_LightTex.Length; this.m_allMat = allMat; }
/// <summary> /// 同步网络消息Block /// </summary> /// <param name="messageId"></param> /// <param name="status"></param> private void OnSendingSyncMessageCallback(int messageId, EngineCore.NetworkModule.NetworkStatus status) { DelayHideSync(); switch (status) { case EngineCore.NetworkModule.NetworkStatus.NORMAL: case EngineCore.NetworkModule.NetworkStatus.SYNC_SUCCEED: EngineCore.EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_SYNC_LOADING); break; case EngineCore.NetworkModule.NetworkStatus.RETRY_CACHE_CLEAR: HideRetry(); break; case EngineCore.NetworkModule.NetworkStatus.TIMEOUT: EngineCore.EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_SYNC_LOADING); GameEvents.System_Events.SetLoadingTips.SafeInvoke(LocalizeModule.Instance.GetString("NETWORK_TIMEOUT")); if (m_offline_time < 0) { m_offline_time = CommonTools.GetCurrentTimeSecond(); } TimeModule.Instance.SetTimeout(() => { OfflineTips(); }, 2.5f); break; case NetworkModule.NetworkStatus.EXPIRE: break; case NetworkModule.NetworkStatus.OFFLINE_WARNNING: { TimeModule.Instance.SetTimeout(() => { OfflineTipsNoRetry(); }, 2.5f); } break; } }
private void SendNeedMoreTime() { if (2 == SCENE_ID / 10000) { CSJigsawReconnectRequest req = new CSJigsawReconnectRequest { SceneId = SCENE_ID, StartTime = (long)m_offline_time, EndTime = (long)CommonTools.GetCurrentTimeSecond(), }; #if !NETWORK_SYNC || UNITY_EDITOR GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req); #else GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req); #endif } else if (4 == SCENE_ID / 10000) { } else { CSSceneReconnectRequest req = new CSSceneReconnectRequest { SceneId = SCENE_ID, StartTime = (long)m_offline_time, EndTime = (long)CommonTools.GetCurrentTimeSecond(), }; #if !NETWORK_SYNC || UNITY_EDITOR GameEvents.NetWorkEvents.SendAsyncMsg.SafeInvoke(req); #else GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req); #endif } }
private void Refresh(List <Push_Info> push_gifts) { var not_bought = push_gifts.FindAll((item) => false == item.Buyed); if (null == push_gifts || 0 == push_gifts.Count || null == not_bought || 0 == not_bought.Count) { ShowAll(false); return; } ShowAll(true); if (1 == push_gifts.Count) { m_left_btn.Visible = false; m_right_btn.Visible = false; } else { m_left_btn.Visible = true; m_right_btn.Visible = true; } m_datas = new List <PushGiftData>(); for (int i = 0; i < push_gifts.Count; ++i) { Push_Info info = push_gifts[i]; if (info.Buyed) { continue; } if (0 != info.EndTime && CommonTools.GetCurrentTimeSecond() > info.EndTime) { continue; } Debug.Log(string.Format("cur push id = {0}", info.PushId)); ConfPush push = ConfPush.Get(info.PushId); if (null == push) { Debug.Log(string.Format("confpush {0} is null ", info.PushId)); continue; } PushGiftData data = new PushGiftData() { m_push_gift_id = push.id, m_tex_name = push.background, m_price_txt = GameEvents.IAPEvents.Sys_GetPriceEvent.SafeInvoke(push.chargeid), m_bought = info.Buyed, m_charge_id = push.chargeid, }; m_datas.Add(data); } if (0 == m_datas.Count) { return; } m_cur_idx = 0; this.m_toggle_grid.EnsureSize <PushToggleItem>(m_datas.Count); for (int i = 0; i < m_toggle_grid.ChildCount; ++i) { var item = m_toggle_grid.GetChild <PushToggleItem>(i); item.Visible = true; } EnableIdx(m_cur_idx); }