void Update() { // Call Update() on AccessTokenGetter and on WwwRequestInProgress to trigger execution of pending tasks // if there are any. AccessTokenGetter.Update(); WwwRequestInProgress.Update(); }
/// <summary> /// Invokes an initial action that requires access token to send an HTTP requests, and schedules invocation of /// the post completion action on the WWW instance holding the request for when the /// response to the request is received. Updates access token before making this request if necessary. /// </summary> /// <param name="initialAction">An action that will need an updated access token.</param> /// <param name="postResponseAction">An action to execute when the response to the request has been received.</param> private static void InvokeAccessRestrictedAction( Action <Action <WWW> > initialAction, Action <WWW> postResponseAction) { if (!AccessTokenGetter.AccessToken.IsValid()) { AccessTokenGetter.ValidateAccessToken(() => initialAction(postResponseAction)); } else { initialAction(postResponseAction); } }