Esempio n. 1
0
    void Start()
    {
        //Uncomment these lines if you want to be notified
        //when the player logs in/out

        // Zapic.OnLogin = ((player) =>
        // {
        //  //Do stuff here
        // });

        // Zapic.OnLogout = ((player) =>
        // {
        //     //Do stuff here
        // });

        Zapic.Start();
    }
Esempio n. 2
0
 void Start()
 {
     Zapic.Start("v0.1");
 }
Esempio n. 3
0
    void Start()
    {
        Zapic.OnLogin = ((player) =>
        {
            Debug.LogFormat("Player logged in. Id:{0}, Name: {1}, Icon:{2}, Notification:{3}", player.Id, player.Name, player.IconUrl, player.NotificationToken);

            Zapic.GetCompetitions((competitions, error) =>
            {
                if (error != null)
                {
                    Debug.LogError("Error getting competitions: " + error.Message);
                }
                else
                {
                    Debug.LogFormat("Received {0} competitions!", competitions.Length);
                }
            });

            Zapic.GetChallenges((challenges, error) =>
            {
                if (error != null)
                {
                    Debug.LogError("Error getting challenges: " + error.Message);
                }
                else
                {
                    Debug.LogFormat("Received {0} challenges!", challenges.Length);
                }
            });

            Zapic.GetStatistics((stats, error) =>
            {
                if (error != null)
                {
                    Debug.LogError("Error getting statistics: " + error.Message);
                }
                else
                {
                    Debug.LogFormat("Received {0} statistics!", stats.Length);
                }
            });

            Zapic.GetPlayer((p, error) =>
            {
                if (error != null)
                {
                    Debug.LogError("Error getting player: " + error.Message);
                }
                else
                {
                    Debug.LogFormat("Received the player");
                }
            });
        });

        Zapic.OnLogout = ((player) =>
        {
            Debug.LogFormat("Player logged in. Id:{0}, Name: {1}", player.Id, player.Name);
        });

        Zapic.Start();
    }