31 lines
629 B
C#
31 lines
629 B
C#
using System;
|
|
using UnityEngine;
|
|
using UnityEngine.Events;
|
|
using UnityEngine.UI;
|
|
|
|
namespace OCTOPUS_TWIN {
|
|
[RequireComponent(typeof(Button))]
|
|
public class BackHomeCommandMono : MonoBehaviour
|
|
{
|
|
private Button button;
|
|
|
|
[Header("Command Settings")]
|
|
[SerializeField] private UnityEvent onExecuteCommand;
|
|
|
|
private void Awake()
|
|
{
|
|
button = GetComponent<Button>();
|
|
}
|
|
|
|
private void Start()
|
|
{
|
|
button.onClick.AddListener(Execute);
|
|
}
|
|
|
|
public void Execute()
|
|
{
|
|
onExecuteCommand?.Invoke();
|
|
}
|
|
}
|
|
}
|