Answer the question
In order to leave comments, you need to log in
How to put a script on a button?
It seems like a simple thing - to hang a script (function) on a button, I do it as described in the example, but the function does not appear
the script itself
using UnityEngine;
namespace Menu{
public class UrlOpen : MonoBehaviour{
public void OpenUrl(string url){
Application.OpenURL(url);
}
}
}
Answer the question
In order to leave comments, you need to log in
Hang the script on the object, throw this object into the cell under Runtime only
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question