加链接,文件位置

This commit is contained in:
Caiyanpeng committed 2021-07-23 17:59:38 +08:00
1 parent ae3f9d2101
commit b93fbd2f2e
14 files changed
+7 -1

No files matched your search

@@ -0,0 +1,54 @@
using Assets.Scripts.Apis.Models;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class RaceButtonGroupScript : MonoBehaviour
{
private Transform BtnEnter, BtnCancel, BtnWatch;
public MapCompetition map { get; set; }
public Transform parent { get; set; }
// 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()
{
if (!map.HasJoin)
{
parent.GetComponent<RaceItemScript>().Join();
}
Debug.Log(map);
}
void GoCancel()
{
if (map.HasJoin)
{
parent.GetComponent<RaceItemScript>().CancelJoin();
}
}
void GoWatch()
{
Debug.Log("Watch");
}
// Update is called once per frame
void Update()
{
}
}