42 lines
1.2 KiB
C#
42 lines
1.2 KiB
C#
|
|
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<string, Texture> caches;
|
|||
|
|
MapRoute map;
|
|||
|
|
// Start is called before the first frame update
|
|||
|
|
private void Awake()
|
|||
|
|
{
|
|||
|
|
caches = new Dictionary<string, Texture>();
|
|||
|
|
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<MapItem>().Initial(map,caches);
|
|||
|
|
}
|
|||
|
|
}
|