14 lines
355 B
C#
14 lines
355 B
C#
|
|
using UnityEngine;
|
||
|
|
using UnityEngine.UI;
|
||
|
|
|
||
|
|
public class ButtonTeleport : MonoBehaviour
|
||
|
|
{
|
||
|
|
private Button m_Button;
|
||
|
|
void Awake()
|
||
|
|
{
|
||
|
|
//在开始加载时为按钮注册转换场景事件
|
||
|
|
m_Button = gameObject.GetComponent<Button>();
|
||
|
|
m_Button.onClick.AddListener(gameObject.GetComponent<Teleport>().TeleportToSence);
|
||
|
|
}
|
||
|
|
}
|