The function this function pointer is pointing to is supposed to be called by another function inside the structure. So it is important to keep this functionpointer inside the structure.
Now, the problem is I am assigning this pointer in the class of the function like this.
Could you elaborate a bit more on why you want function pointers in the first place? What goal are you trying to achieve? Perhaps you can just use delegates?
basically, when the value of the float is changed, it calls the function pointer with the new value. In future, I will replace the function pointer with an array of function pointers which all point to different functions.
Instead of using a Get-er and Set-er, I am trying to use something like this.
I tried declaring a delegate inside the structure but it didn’t work I trying this.