Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.UI;
- public class InitPersistantManager : MonoBehaviour
- {
- public Slider LoadSlider;
- public Text ErrorText;
- [SerializeField] int currentVersion = 1;
- [SerializeField] GameObject repaetButton;
- public void Start ()
- {
- repaetButton.SetActive (false);
- RemoteResouceManager.OnProgressNormalizedChange += (val) =>
- {
- LoadSlider.normalizedValue = val;
- };
- RemoteResouceManager.LoadAll (() =>
- {
- Hide();
- },
- (error) =>
- {
- ErrorText.text = error;
- bool ChacheIsLoaded = RemoteResouceManager.LoadInChache (currentVersion);
- if (ChacheIsLoaded)
- {
- Hide();
- }
- else
- {
- repaetButton.SetActive (true);
- }
- });
- //PersistantManager.LoadVideoList(() =>
- //{
- // PersistantManager.LoadAll();
- // gameObject.SetActive(false);
- //});
- }
- private void Hide()
- {
- gameObject.SetActive(false);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement