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.
Not sure if this is what you need, but you add listeners to buttons using the format
myButton.onClick.AddListener(delegate { MyActionFunction(myArgument1); });
Arguments are optional. Make sure if you are providing a constant argument that you pass in a variable which isn’t changed later.