Z
Z
Zimaell2020-05-29 12:35:58
Unity
Zimaell, 2020-05-29 12:35:58

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
5ed0d7289875c271884826.jpeg
the script itself

using UnityEngine;
namespace Menu{
  public class UrlOpen : MonoBehaviour{
    public void OpenUrl(string url){
      Application.OpenURL(url);
      }
    }
  }

That is, in theory, I should have had a list of functions there from the script that I attached, but it's not there ...
Tell me what I'm doing wrong?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
DanielMcRon, 2020-05-29
@Zimaell

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 question

Ask a Question

731 491 924 answers to any question