I have a script component, but I want to know how I can add things like sliders buttons etc.

I wrote a grid system that generates at the start of my script but I want to run it in editor when I push a button to not to force calculations, lessen load times for my game and even see result of my work in editor. How can I do that?

  • \$\begingroup\$ Hmmm... Sripting \$\endgroup\$ – JDSweetBeat Mar 18 '16 at 15:06
  • \$\begingroup\$ Check out my profile, I wrote a course that includes it, use the free trial. \$\endgroup\$ – MichaelHouse Mar 18 '16 at 15:28

It depends on what you need.

For instance if you need to display a slider in the inspector you need to declare your slider

using UnityEngine.UI;

[Range(0, 100)]
public Slider sldr;

to Add a buttom you could follow this simple tutorial.


As per your edit and Byte32 suggestion would be usefull to you to check also for this basic Custom Editor tutorial.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.