Forum rules - please read before posting.

Custom Action 'Awake' Equivalent

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

  • Good question.

    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.
  • Thanks very much Chris, understood.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.