powerfun-unity/Assets/RaceButtonGroupScript.cs

47 lines
1.2 KiB
C#
Raw Normal View History

2021-07-23 10:02:09 +08:00
using Assets.Scripts.Apis.Models;
using System.Collections;
2021-07-20 09:58:01 +08:00
using System.Collections.Generic;
using UnityEngine;
public class RaceButtonGroupScript : MonoBehaviour
{
private Transform BtnEnter, BtnCancel, BtnWatch;
2021-07-23 10:02:09 +08:00
public MapCompetition map { get; set; }
2021-07-20 09:58:01 +08:00
// Start is called before the first frame update
void Start()
{
BtnEnter = transform.Find("BtnEnter");
BtnCancel = transform.Find("BtnCancel");
BtnWatch = transform.Find("BtnWatch");
if (BtnEnter != null)
{
UIManager.AddEvent(BtnEnter.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => GoEnter());
}
if (BtnCancel != null)
{
UIManager.AddEvent(BtnCancel.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => GoCancel());
}
if (BtnWatch != null)
{
UIManager.AddEvent(BtnWatch.gameObject, UnityEngine.EventSystems.EventTriggerType.PointerClick, b => GoWatch());
}
}
void GoEnter()
{
2021-07-23 10:02:09 +08:00
Debug.Log(map);
2021-07-20 09:58:01 +08:00
}
void GoCancel()
{
Debug.Log("Cancel");
}
void GoWatch()
{
Debug.Log("Watch");
}
// Update is called once per frame
void Update()
{
}
}