示例#1
0
    private void GetPlayer()
    {
        //Gets the current player
        var player = Zapic.Player();

        Debug.LogFormat("Current Player, Id:{0}, Name:{1}", player.Id, player.Name);
    }
示例#2
0
    private void HandleInteraction()
    {
        var data = new Dictionary <string, object>()
        {
            { "zapic", "/challenge/00000000-0000-0000-0000-000000000000" }
        };

        Zapic.HandleInteraction(data);
    }
    void Update()
    {
        if (Input.GetMouseButtonDown(0))
        {
            var p = new Dictionary <string, object>()
            {
                { "SCORE", 22 },
                { "PARAM2", "abc" },
                { "PARAM3", true }
            };

            Zapic.SubmitEvent(p);
        }
    }
示例#4
0
    private void SendEvent()
    {
        var eventParams = new Dictionary <string, object>();

        //Add parameter information to the event
        eventParams.Add("Score", 22);
        eventParams.Add("PARAM2", "abc");
        eventParams.Add("PARAM3", true);
        eventParams.Add("PARAM4", "\"blab");
        eventParams.Add("PAR\"AM5", "\"blab");

        //Sumbit the event to the Zapic server
        Zapic.SubmitEvent(eventParams);
    }
示例#5
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();
    }
示例#6
0
 /// <summary>
 /// Shows the default Zapic page
 /// </summary>
 public void ShowZapicDefaultPage()
 {
     Zapic.ShowDefaultPage();
 }
示例#7
0
 private void ShowZapicMenu()
 {
     // Debug.Log("Show Zapic Menu");
     Zapic.ShowMenu();
 }
 void Start()
 {
     Zapic.Start("v0.1");
 }
示例#9
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();
    }
示例#10
0
 private void ShowZapicChallengesMenu()
 {
     Zapic.ShowPage(ZapicPages.Challenges);
 }
示例#11
0
 private void ShowZapicMenu()
 {
     Zapic.ShowDefaultPage();
 }
示例#12
0
 private void ShowZapicMenu()
 {
     Zapic.Show(ZapicSDK.Views.Main);
 }
 // Use this for initialization
 void Awake()
 {
     Zapic.Connect();
 }