using System; using System.Collections; using System.Collections.Generic; using System.IO; using UnityEngine; using UnityEngine.Networking; using UnityEngine.UI; using DG.Tweening; using UnityEngine.SceneManagement; using UnityEngine.EventSystems; using Assets.Scenes.Ride.Scripts; using Assets.Scripts.Apis.Models; using System.Linq; using Assets.Scenes.Ride.Scripts.Model; namespace Assets.Scripts.Scenes.VideoRide { public class VideoLoading : MonoBehaviour { UnityWebRequest request { get; set; } VideoGameManager manager { get; set; } protected Text mapName; protected RawImage mapRouteImage; protected CanvasGroup canvasGroup; protected Slider slider; protected Text processText; protected Text rideNowText; protected Button rideNow; protected Button cancel; protected Text mapDescText; protected Text distance; protected Text elevaction; protected Text slope; protected GameObject panel; protected GameObject download; protected GameObject watch; protected GameObject loadingPanel { get; set; } protected Text level; protected Text rideNum; protected Text uploadByUserName; protected RawImage head; protected RawImage country; protected RawImage mapCountry; protected RawImage altitudeGraph; protected Transform mapRanking; protected Text mapId; protected float process = 0;//0-100 % public float targetAlpha = 0f; public float alphaSpeed = 2.0f; protected Transform ui; protected MapRoute route; private void Awake() { if(App.gameRoomDetail != null) ShowGameRoomLoading(); } void Start() { manager = FindObjectOfType(); ui = manager.GetCanvasTransform(); route = manager.GetMapRoute(); } public void Init() { InitGameObject(); InitGameObjectData(); } private void ShowGameRoomLoading() { UIManager.SetModalPanel(transform.Find("ModalPanel").GetComponent()); UIManager.ShowGameRoomLoadingPanel(); } private void InitGameObject() { panel = transform.Find("Panel").gameObject; mapName = panel.transform.Find("MapName").GetComponent(); distance = panel.transform.Find("Distance").GetComponent(); elevaction = panel.transform.Find("Elevaction").GetComponent(); slope = panel.transform.Find("Slope").GetComponent(); mapRouteImage = panel.transform.Find("MapRouteImage").GetComponent(); slider = panel.transform.Find("Process").GetComponent(); slider.gameObject.SetActive(true); processText = panel.transform.Find("ProcessText").GetComponent(); processText.gameObject.SetActive(false); mapDescText = panel.transform.Find("MapDesc").GetComponent(); rideNow = panel.transform.Find("RideNow").GetComponent