_xiaofang/xiaofang/Assets/Script/hylScripts/TestButton.cs
2024-12-12 17:18:12 +08:00

40 lines
755 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class TestButton : MonoBehaviour
{
public test test;
public Button chooseroadBtn;
public Button joinroomBtn;
// Start is called before the first frame update
void Start()
{
joinroomBtn.onClick.AddListener(JoinRoom);
chooseroadBtn.onClick.AddListener(ChooseRoad);
}
public void JoinRoom()
{
test.JoinRoom();
joinroomBtn.gameObject.SetActive(false);
}
public void ChooseRoad()
{
test.NpcMove();
chooseroadBtn.gameObject.SetActive(false);
}
// Update is called once per frame
void Update()
{
}
}