Hi, i want to create a script which i add to a textmesh pro. The script should load a value from a script which is attached to a dont destroy on load gameObject as value of the text. I have a data script with the function getScore public int getScore() In my script i want to store the function so that i could change the function in inspector. I came over delegates but i dont find anything about Serializable delegates and delegates with return value. How can i do this in c#? Thx
well still not getting your problem (if you are the same person as yesterday) maybe just post all of your code and I'll fix it for you, because the whole design pattern sounds weird
nvm yesterday someone asked a similar question, but you have to provide your code, because like this I cant help you
I want a function selection like this of the button module for my own script. I want to know how to create such a variable and how to use the selected function in code and get the return value of it. I hope it is better to understand what i am looking for now.
Code (CSharp): public class Button : MonoBehaviour, Clickable { public UnityEngine.Events.UnityEvent action; public bool clicked(Vector3 pos) { action.Invoke(); return true; } } you are welcome