void OnGUI() { if (GUILayout.Button(_texture)) { if (null != _responseData && !string.IsNullOrEmpty(_responseData.TargetUrl)) { Application.OpenURL(_responseData.TargetUrl); ServerGateway.ReportClick(_responseData.MessageType); //Make sure to never show the message again if clicked on it MessageDisplayLogic.SetTimesMessageWasShown(_responseData.MessageName, 100000); } this.Close(); } }
public static void ResetIfShould(ServerResponseData response) { if (response.ResetToken < 0) { return; } var resetTokenKey = GetResetTokenKeyName(response); bool shouldReset = !EditorPrefs.HasKey(resetTokenKey) || (EditorPrefs.GetInt(resetTokenKey) != response.ResetToken); if (shouldReset) { #if DEBUG_INFO_MESSAGE Debug.Log("Reset"); #endif //Reset mesage info MessageDisplayLogic.SetTimesMessageWasShown(response.MessageName, 0); MessageDisplayLogic.SetLastMessageShownDate(response.MessageName); } //Update reset token EditorPrefs.SetInt(resetTokenKey, response.ResetToken); }