Unity-C#

 2024.07.07 unityC#  
 2024.05.15 unityC#  
 2024.05.15 unityC#  
 2022.11.06 unityC#  
 2022.11.06 unityC#  
 2022.11.06 unityC#  
 2022.11.06 unityC#  
 2022.11.06 unityC#  
 2022.08.16 spritekit  

Button


using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

[RequireComponent(typeof(Button))]
public class ButtonResponse : MonoBehaviour
{
 void Awake()
 {
 var button = GetComponent<Button>();
 // button.onClick.AddListener(OnClickButton2);
   button.onClick.AddListener(() => SceneManager.LoadScene("MainScene"));
 }
public void OnClickButton2()
  {
// Debug.Log("Click Button");
  SceneManager.LoadScene("MainScene");
 }
 void Start()
    {
    }
 void Update()
    {
    }
}