2021-04-01 11:01:05 +08:00
|
|
|
|
using Assets.Scripts;
|
|
|
|
|
|
using Assets.Scripts.Apis.Models;
|
|
|
|
|
|
using System;
|
|
|
|
|
|
using System.Collections;
|
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
|
using UnityEngine;
|
2021-04-01 14:09:23 +08:00
|
|
|
|
using UnityEngine.SceneManagement;
|
2021-04-01 11:01:05 +08:00
|
|
|
|
using UnityEngine.UI;
|
|
|
|
|
|
|
2021-04-09 09:44:06 +08:00
|
|
|
|
public class MapDetailController : PFUIPanel
|
2021-04-01 11:01:05 +08:00
|
|
|
|
{
|
|
|
|
|
|
// Start is called before the first frame update
|
|
|
|
|
|
[HideInInspector] public int id = 0;
|
|
|
|
|
|
[HideInInspector] public MapRoute map;
|
|
|
|
|
|
void Start()
|
|
|
|
|
|
{
|
|
|
|
|
|
if (id != 0)
|
|
|
|
|
|
{
|
|
|
|
|
|
var r = ConfigHelper.mapApi.GetById(id);
|
|
|
|
|
|
if (r.result)
|
|
|
|
|
|
{
|
|
|
|
|
|
map = r.data;
|
|
|
|
|
|
}
|
|
|
|
|
|
else
|
|
|
|
|
|
{
|
2021-04-29 11:36:30 +08:00
|
|
|
|
Utils.showToast(gameObject, r.errMsg);
|
2021-04-01 11:01:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
if (transform.Find("BtnGoRide") != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
transform.Find("BtnGoRide").GetComponent<Button>().onClick.AddListener(GoRide);
|
|
|
|
|
|
}
|
|
|
|
|
|
if (transform.Find("Name") != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
transform.Find("Name").GetComponent<Text>().text = map.Name;
|
|
|
|
|
|
}
|
|
|
|
|
|
if (transform.Find("BtnReturn") != null)
|
|
|
|
|
|
{
|
|
|
|
|
|
transform.Find("BtnReturn").GetComponent<Button>().onClick.AddListener(() =>
|
|
|
|
|
|
{
|
2021-04-23 15:36:18 +08:00
|
|
|
|
UIManager.ShowPrePanel();
|
2021-04-01 11:01:05 +08:00
|
|
|
|
});
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private void GoRide()
|
|
|
|
|
|
{
|
2021-04-01 14:09:23 +08:00
|
|
|
|
//Utils.showToast(gameObject, "去骑行", 1);
|
|
|
|
|
|
App.RouteIdParam = id;
|
|
|
|
|
|
SceneManager.LoadScene("Ride");
|
2021-04-01 11:01:05 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Update is called once per frame
|
|
|
|
|
|
void Update()
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|