Hey guys, I was wondering if there's a version of the Awake or OnEnable function for a custom action? I can't use the AssignValues function, as I need an action to cache a ton of objects when the game starts rather than when the action is run (as there's a noticeable performance hit). So is there any alternative to these functions and if not, could anyone suggest a way around this problem?
Many Thanks
Comments
No, there isn't an Awake function for Actions - however, Actions are generally a way of calling other script functions and waiting until that other script has completed its task.
The best way around this would be to move the actual caching to a separate script that the Action instead refers to. This script, a standard Unity MonoBehaviour, would then be able to use its own Awake function - and the Action would call whatever other purpose it serves when run.