using Assets.Scripts.Apis.Models; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class StartRideModal : PFUIPanel { private Dictionary caches; MapRoute map; // Start is called before the first frame update private void Awake() { caches = new Dictionary(); UIManager.AddEvent(transform.Find("Main/Right/BtnClose").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => { Close(); }); UIManager.AddEvent(transform.Find("Main/Right/BtnRide").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => { if (map != null) { App.RouteIdParam = map.Id; SceneManager.LoadScene("Ride"); } }); } protected override void OnDestroy() { caches = null; Resources.UnloadUnusedAssets(); GC.Collect(); Debug.Log("list empty"); } public void Initial(MapRoute map) { this.map = map; transform.Find("Main/MapItem-Mobile").GetComponent().Initial(map,caches); } }