Пример #1
0
    /// <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);
	}
Пример #3
0
    /// <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);
            });
        }
    }
Пример #4
0
    /// <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;
            }
        }
    }
Пример #5
0
 /// <summary>
 /// Releases unmanaged resources and performs other cleanup operations before the application quit.
 /// </summary>
 void OnApplicationQuit()
 {
     queue = null;
     currentNotification = null;
     instance = null;
 }
Пример #6
0
 /// <summary>
 /// Queues the notification.
 /// </summary>
 /// <param name='notification'>
 /// The notification.
 /// </param>
 public static void QueueNotification(GJHNotification notification)
 {
     Instance.queue.Enqueue (notification);
 }
Пример #7
0
 /// <summary>
 /// Queues the notification.
 /// </summary>
 /// <param name='notification'>
 /// The notification.
 /// </param>
 public static void QueueNotification(GJHNotification notification)
 {
     Instance.queue.Enqueue(notification);
 }
Пример #8
0
    /// <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);
    }
Пример #9
0
    /// <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);
            });
        }
    }