void Start() { // Handle switch to default input context contextToSwitchTo = activeContext; activeContext.OnEnter(); activeContext.OnFirstUpdate(); }
void HandleContextSwitch() { if (contextToSwitchTo == activeContext) { return; } activeContext.OnLastUpdate(); activeContext = contextToSwitchTo; activeContext.OnFirstUpdate(); }