Beispiel #1
0
 /// <summary>
 /// Releases unmanaged resources and performs other cleanup operations before the application quit.
 /// </summary>
 void OnDestroy()
 {
     StopAllCoroutines();
     skin     = null;
     users    = null;
     scores   = null;
     trophies = null;
     instance = null;
 }
Beispiel #2
0
 /// <summary>
 /// Releases unmanaged resources and performs other cleanup operations before the application quit.
 /// </summary>
 void OnApplicationQuit()
 {
     StopAllCoroutines();
     skin     = null;
     users    = null;
     scores   = null;
     trophies = null;
     instance = null;
 }
Beispiel #3
0
    /// <summary>
    /// Downloads the trophy icon.
    /// </summary>
    /// <param name='trophy'>
    /// The trophy.
    /// </param>
    /// <param name='OnComplete'>
    /// The callback.
    /// </param>
    public void DownloadTrophyIcon(GJTrophy trophy, Action <Texture2D> OnComplete)
    {
        GJAPIHelper.DownloadImage(
            trophy.ImageURL,
            icon =>
        {
            if (icon == null)
            {
                icon = (Texture2D)Resources.Load("Images/TrophyIcon", typeof(Texture2D)) ?? new Texture2D(75, 75);
            }

            if (OnComplete != null)
            {
                OnComplete(icon);
            }
        });
    }
    /// <summary>
    /// Downloads the user avatar.
    /// </summary>
    /// <param name='user'>
    /// The user.
    /// </param>
    /// <param name='OnComplete'>
    /// The callback.
    /// </param>
    public void DownloadUserAvatar(GJUser user, Action <Texture2D> OnComplete)
    {
        GJAPIHelper.DownloadImage(
            user.AvatarURL,
            avatar =>
        {
            if (avatar == null)
            {
                avatar = (Texture2D)Resources.Load("Images/UserAvatar", typeof(Texture2D)) ?? new Texture2D(60, 60);
            }

            if (OnComplete != null)
            {
                OnComplete(avatar);
            }
        });
    }
Beispiel #5
0
 /// <summary>
 /// Releases unmanaged resources and performs other cleanup operations before the application quit.
 /// </summary>
 void OnApplicationQuit()
 {
     StopAllCoroutines ();
     skin = null;
     users = null;
     scores = null;
     trophies = null;
     instance = null;
 }