Exemplo n.º 1
0
        private void achievementsEventsAndQuestsButtons()
        {
            GUILayout.Label("Achievements");

            if (GUILayout.Button("Show Achievements"))
            {
                PlayGameServices.showAchievements();
            }


            if (GUILayout.Button("Increment Achievement"))
            {
                PlayGameServices.incrementAchievement("CgkI_-mLmdQEEAIQAQ", 2);
            }


            if (GUILayout.Button("Unlock Achievement"))
            {
                PlayGameServices.unlockAchievement("CgkI_-mLmdQEEAIQAw");
            }


            GUILayout.Label("Events and Quests");

            if (GUILayout.Button("Load All Events"))
            {
                PlayGameServices.loadAllEvents();
            }


            if (GUILayout.Button("Increment Event"))
            {
                // you will need to use your own eventId for this to work
                PlayGameServices.incrementEvent("CgkI_-mLmdQEEAIQCg", 1);
            }


            if (GUILayout.Button("Show Quest List"))
            {
                PlayGameServices.showQuestList();
            }


            if (GUILayout.Button("Load All Quests"))
            {
                PlayGameServices.loadAllQuests();
                PlayGameServices.showStateChangedPopup("CgkI_-mLmdQEEAIQDw");
            }


            GUILayout.Label("Snapshots");

            if (GUILayout.Button("Show Snapshot List"))
            {
                PlayGameServices.showSnapshotList(5, "Your Saved Games!", true, true);
            }


            if (GUILayout.Button("Save Snapshot"))
            {
                var data = System.Text.Encoding.UTF8.GetBytes("my saved data");
                PlayGameServices.saveSnapshot("snappy", true, data, "The description of the data");
            }


            if (GUILayout.Button("Load Snapshot"))
            {
                PlayGameServices.loadSnapshot("snappy");
            }


            if (GUILayout.Button("Delete Snapshot"))
            {
                PlayGameServices.deleteSnapshot("snappy");
            }
        }