Programatically set a button

Updated on April 30, 2019 in [A] Unity Scripting
Share on Facebook0Tweet about this on TwitterShare on Google+0Share on Reddit0
2 on April 29, 2019

I’m trying to set up a dialog box when the user is deleting an entry in the database so that they choose yes to delete or no to not delete. The delete script in on a prefab, so instead of creating multiple buttons stacked on top and enabling them, is there a more generic way to do it? The no would just close the canvas.

  • Liked by
Reply
1 on April 29, 2019

I’m not 100% sure what you’re asking for.

What do you mean by:

creating multiple buttons stacked on top and enabling themFrom Gilead

 

If you want to add a function to a button via code, instead of the inspector, then yes you can, and these docs here explain how to.

on April 30, 2019

Thanks!

 

Show more replies
  • Liked by
Reply
Cancel