public void OnDestroy() { PlayFabSettings.UnregisterInstance(this); // Automatically unregisters all callbacks bound to this instance - No delegate casting or local variables needed for a full un-register // Un-registering for static methods, using the static delegate variables defined by each function - No simple way to identify/clear these together the instance PlayFabSettings.UnregisterForRequests(null, _onApiRequestStGl); PlayFabSettings.UnregisterForResponses(null, _onApiResponseStGl); PlayFabSettings.UnregisterForRequests("/Client/LoginWithEmailAddress", _onApiRequestStLogin); PlayFabSettings.UnregisterForResponses("/Client/LoginWithEmailAddress", _onApiResponseStLogin); PlayFabSettings.UnregisterForRequests("/Client/LoginWithAndroidDeviceID", _onApiRequestStLogin2); PlayFabSettings.UnregisterForResponses("/Client/LoginWithAndroidDeviceID", _onApiResponseStLogin2); PlayFabSettings.UnregisterForRequests("/Client/LoginWithIOSDeviceID", _onApiRequestStLogin2); PlayFabSettings.UnregisterForResponses("/Client/LoginWithIOSDeviceID", _onApiResponseStLogin2); }
public void Unregister() { // Automatically unregisters all callbacks bound to this instance - No delegate casting or local variables needed for a full un-register PlayFabSettings.UnregisterInstance(this); PlayFabSettings.GlobalErrorHandler = null; }