I have a function thats going to be used a LOT of times within my game, but if I need to add a new or change an object/parameter, I need to manually do it to every instance already present, as the object needs to be in the parameters.
Is there a way to make the function “assume” a parameter and apply it automatically to every instance and without needing a list of parameters at the end for the objects? If so, I could cut off the 8+ parameters off the end of the string.
I have an “ending” system where objects like an overlay, different text objects, and some buttons appear every time its triggered. The only parameters that actually have to be different for each ending are what the text objects say, as everything else is the same across every instance of the function.
As you can see, almost all of the parameters are objects. The only 3 parameters that would be different per ending are EndingID, TopLabel, and BottomLabel. Every other thing is the same, and the only moving objects are the two buttons (and there will be at least two more added in the near future)
I’m not aware of a way to make a parameter optional or set a default value for objects. You can do it with a value like a number but not for objects. It needs a reference to the object’s unless it was hard coded some way. Maybe set the values with 1 function and then update the objects with another. IDK. I’m just thinking outloud.
If it was a custom (prefab) object then the objects wouldn’t need to be parameters.
Otherwise, the easiest solution might be to copy and paste the event.
Behaviors might be another option although, they’d need to communicate with each other.