I often find myself having to do run code (usually instantiating an object) in a class after setting the values for it. What would the best way to do it? Here’s a list of ways I thought of doing it so far:
Constructor - calling needed methods at the end of the class constructor
Setter Method- calling needed methods after setting the class values
Property setter - running the needed methods from the setter of that field
From the instantiator - after setting the fields, I run the needed methods from the object that instantiates and sets the fields
Why I am asking this as I do not want to fill up the script execution order list (i would know for sure that the fields were instantiated) or loop until the field gets assigned.
The listed ways above all seem kind of clunky to me. I want to know your opinion on this. Thanks
Edit: I forgot to add that the instantiated class is not inheriting MonoBehaviour.
Edit2: Added picture, hopefully it helps you understand better the steps