您最多选择25个主题
主题必须以中文或者字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符
29 行
619 B
29 行
619 B
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
using TMPro;
|
|
|
|
public class LocationTeleporterButton : MonoBehaviour
|
|
{
|
|
[SerializeField] private LocationSO _location;
|
|
[SerializeField] private PathSO _path;
|
|
[SerializeField] private TextMeshProUGUI label;
|
|
|
|
private EditorTeleporter _teleporter;
|
|
|
|
private void Awake()
|
|
{
|
|
_teleporter = GetComponentInParent<EditorTeleporter>();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
label.text = _location.name + " via " + _path.name;
|
|
}
|
|
|
|
//Called by the UI button's UnityEvent
|
|
public void IssueTeleport()
|
|
{
|
|
_teleporter.Teleport(_location, _path);
|
|
}
|
|
}
|