Z
Z
Zefirot2021-11-23 10:52:20
Unity
Zefirot, 2021-11-23 10:52:20

How to make a method execute button in the editor?

My room is, first of all, an empty prefab into which I then stuff other prefabs and visually arrange them where necessary, I see that the room is visually ready as I need, I need to use a method that will distill it all into a text file, in txt information takes up much less space than the level prefab itself, but not the point, the question is - how to make a button in the editor so that after pressing it, the method that runs the method of processing into a file works?
So far, I only have the option to put a bool field and after changing it, the function worked as an option, but can I somehow do it with a button?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Davilkus Games, 2021-11-23
@Zefirot

What's the problem?
Bind the UI button to the method and click at runtime - everything should work

G
GFX Data, 2021-11-25
@ShockWave2048

ButtonMethod from MyBox library - https://github.com/Deadcows/MyBox/wiki/Attributes#...
619fb9b06a854490194064.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question