| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | var mapResConfig = Config.Instance.Get<MapResourcesConfig>(targetMapResId);
|
| | | if (mapResConfig != null && mapResConfig.LoadingBG.Length > 0)
|
| | | var useDefautBackGround = false;
|
| | | if (!AssetSource.uiFromEditor)
|
| | | {
|
| | | var randomIndex = UnityEngine.Random.Range(0, mapResConfig.LoadingBG.Length > 1 ? mapResConfig.LoadingBG.Length + 1 : 1);
|
| | | if (randomIndex == mapResConfig.LoadingBG.Length)
|
| | | var assetValid = AssetVersionUtility.IsAssetValid("ui/sprite/loadingbg");
|
| | | useDefautBackGround = !assetValid;
|
| | | }
|
| | |
|
| | | if (useDefautBackGround)
|
| | | {
|
| | | var sprite = BuiltInLoader.LoadSprite("Launch");
|
| | | m_BackGround.overrideSprite = sprite;
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | | m_ContainerFunctions.gameObject.SetActive(false);
|
| | | }
|
| | | else
|
| | | {
|
| | | var mapResConfig = Config.Instance.Get<MapResourcesConfig>(targetMapResId);
|
| | | if (mapResConfig != null && mapResConfig.LoadingBG.Length > 0)
|
| | | {
|
| | | m_BackGround.SetSprite(GeneralDefine.LoadLV);
|
| | | m_ContainerFunctions.gameObject.SetActive(true);
|
| | | var functions = GetShowFunctions(PlayerDatas.Instance.baseData.LV == 0 ? PlayerDatas.Instance.loginInfo.LV : PlayerDatas.Instance.baseData.LV);
|
| | | for (int i = 0; i < m_FunctionShows.Length; i++)
|
| | | var randomIndex = UnityEngine.Random.Range(0, mapResConfig.LoadingBG.Length > 1 ? mapResConfig.LoadingBG.Length + 1 : 1);
|
| | | if (randomIndex == mapResConfig.LoadingBG.Length)
|
| | | {
|
| | | var show = m_FunctionShows[i];
|
| | | show.Display(functions[i]);
|
| | | m_BackGround.SetSprite(GeneralDefine.LoadLV);
|
| | | m_ContainerFunctions.gameObject.SetActive(true);
|
| | | var functions = GetShowFunctions(PlayerDatas.Instance.baseData.LV == 0 ? PlayerDatas.Instance.loginInfo.LV : PlayerDatas.Instance.baseData.LV);
|
| | | for (int i = 0; i < m_FunctionShows.Length; i++)
|
| | | {
|
| | | var show = m_FunctionShows[i];
|
| | | show.Display(functions[i]);
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BackGround.SetSprite(mapResConfig.LoadingBG[randomIndex]);
|
| | | m_ContainerFunctions.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadName))
|
| | | {
|
| | | m_ContainerMapName.gameObject.SetActive(true);
|
| | | m_MapName.SetSprite(mapResConfig.LoadName);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_BackGround.SetSprite(mapResConfig.LoadingBG[randomIndex]);
|
| | | m_ContainerFunctions.gameObject.SetActive(false);
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadName))
|
| | | {
|
| | | m_ContainerMapName.gameObject.SetActive(true);
|
| | | m_MapName.SetSprite(mapResConfig.LoadName);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerMapName.gameObject.SetActive(false);
|
| | | }
|
| | |
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadDescription))
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(true);
|
| | | m_MapDescription.SetSprite(mapResConfig.LoadDescription);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | | if (mapResConfig != null && !string.IsNullOrEmpty(mapResConfig.LoadDescription))
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(true);
|
| | | m_MapDescription.SetSprite(mapResConfig.LoadDescription);
|
| | | }
|
| | | else
|
| | | {
|
| | | m_ContainerMapDescription.gameObject.SetActive(false);
|
| | | }
|
| | | }
|
| | |
|
| | | m_ProgressSlider.value = refProgress = 0f;
|
| | |
| | | {
|
| | | m_ProgressSlider.value = refProgress = Mathf.Max(_progress, refProgress);
|
| | | }
|
| | |
|
| | |
|
| | | private List<int> GetShowFunctions(int _level)
|
| | | {
|