Hello to all.
My Unity is having trouble getting a function from a class in a code
When I want to give a code to the button component, there is no problem, but when I want to select a function from that code, it does not show me those functions at all.
Please help me ![]()
my code :
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class Rules : MonoBehaviour
{
public Transform player;
public GameObject lose_menu;
public void Restart_Game()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex);
Time.timeScale = 1;
}
public void Exit_Game()
{
Application.Quit();
}
public void Next_level()
{
SceneManager.LoadScene(SceneManager.GetActiveScene().buildIndex + 1);
}
void Update()
{
if(player.position.y < -10)
{
Time.timeScale = 0;
lose_menu.SetActive(true);
}
else
{
Time.timeScale = 1;
}
}
}

thank you . it worked
โ mhmtsze