44 lines
1.3 KiB
C#
44 lines
1.3 KiB
C#
using Assets.Scripts;
|
|
using Assets.Scripts.Apis.Models;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
public class RaceModalScript : RaceScript
|
|
{
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
UIManager.AddEvent(transform.Find("Container/Exit").gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b =>
|
|
{
|
|
//停止计时器
|
|
gameObject.SetActive(false);
|
|
transform.GetComponent<RaceScript>().SetCurrentItem(null);
|
|
_parent.GetComponent<RaceItemScript>().Refresh();
|
|
});
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
public override void Show()
|
|
{
|
|
base.Show();
|
|
}
|
|
Transform _parent;
|
|
public void Initial(Transform parent, MapCompetition mapCompetition)
|
|
{
|
|
_parent = parent;
|
|
var item = transform.Find("Container/Main/ItemSmall-Mobile");
|
|
|
|
item.GetComponent<RaceItemScript>().Initial(mapCompetition, transform,"modal");
|
|
//开始计时器
|
|
transform.GetComponent<RaceScript>().SetCurrentItem(item);
|
|
Utils.DisplayImage(transform.Find("Container/Main/Left").GetComponent<RawImage>(),
|
|
mapCompetition.RouteCover, true);
|
|
}
|
|
}
|