/// <summary> /// Draw the nofications. /// </summary> void OnGUI() { if (currentNotification != null) { if (Time.time > currentNotificationAppearTime + currentNotification.DisplayTime) { currentNotification = null; } else { if (GJAPIHelper.Skin != null) { GUI.skin = GJAPIHelper.Skin; } currentNotification.OnGUI(); } } else { if (queue.Count > 0) { currentNotification = queue.Dequeue(); currentNotificationAppearTime = Time.time; } } }
/// <summary> /// Show some love to the user. /// </summary> public void ShowGreetingNotification () { if (GJAPI.User == null) { Debug.LogWarning ("GJAPIHelper: There is no verified user to show greetings to ;-("); return; } GJHNotification notification = new GJHNotification (string.Format ("Welcome back {0}!", GJAPI.User.Name)); GJHNotificationsManager.QueueNotification (notification); }
/// <summary> /// OnGetTrophy callback. /// </summary> /// <param name='trophy'> /// The trophy. /// </param> void OnGetTrophy(GJTrophy trophy) { GJAPI.Trophies.GetOneCallback -= OnGetTrophy; if (trophy != null) { DownloadTrophyIcon(trophy, tex => { GJHNotification nofitication = new GJHNotification(trophy.Title, trophy.Description, tex); GJHNotificationsManager.QueueNotification(nofitication); }); } }
/// <summary> /// Draw the nofications. /// </summary> void OnGUI() { if (currentNotification != null) { if (Time.time > currentNotificationAppearTime + currentNotification.DisplayTime) { currentNotification = null; } else { if (GJAPIHelper.Skin != null) GUI.skin = GJAPIHelper.Skin; currentNotification.OnGUI (); } } else { if (queue.Count > 0) { currentNotification = queue.Dequeue (); currentNotificationAppearTime = Time.time; } } }
/// <summary> /// Releases unmanaged resources and performs other cleanup operations before the application quit. /// </summary> void OnApplicationQuit() { queue = null; currentNotification = null; instance = null; }
/// <summary> /// Queues the notification. /// </summary> /// <param name='notification'> /// The notification. /// </param> public static void QueueNotification(GJHNotification notification) { Instance.queue.Enqueue (notification); }
/// <summary> /// Queues the notification. /// </summary> /// <param name='notification'> /// The notification. /// </param> public static void QueueNotification(GJHNotification notification) { Instance.queue.Enqueue(notification); }
/// <summary> /// Show some love to the user. /// </summary> public void ShowGreetingNotification() { if (GJAPI.User == null) { Debug.LogWarning ("GJAPIHelper: There is no verified user to show greetings to ;-("); return; } GJHNotification notification = new GJHNotification (string.Format ("Welcome back {0}!", GJAPI.User.Name)); GJHNotificationsManager.QueueNotification (notification); }
/// <summary> /// OnGetTrophy callback. /// </summary> /// <param name='trophy'> /// The trophy. /// </param> void OnGetTrophy(GJTrophy trophy) { GJAPI.Trophies.GetOneCallback -= OnGetTrophy; if (trophy != null) { DownloadTrophyIcon (trophy, tex => { GJHNotification nofitication = new GJHNotification ( trophy.Title, trophy.Description, tex ); GJHNotificationsManager.QueueNotification (nofitication); }); } }