// Test buttons to SendTags and SendPurchase to test segments on gamethrive.com void OnGUI() { GUIStyle customTextSize = new GUIStyle("button"); customTextSize.fontSize = 30; GUIStyle customBoxSize = new GUIStyle("box"); customBoxSize.fontSize = 30; GUI.Box(new Rect(10, 10, 390, 250), "Test Menu", customBoxSize); if (GUI.Button(new Rect(60, 80, 300, 60), "SendTags", customTextSize)) { GameThrive.SendTag("UnityTestKey", "TestValue"); } if (GUI.Button(new Rect(60, 170, 300, 60), "SendPurchase", customTextSize)) { GameThrive.SendPurchase(2.57d); } if (extraMessage != null) { GUI.Box(new Rect(60, 300, 400, 60), extraMessage, customBoxSize); } }
// Test Menu // Includes SendTag/SendTags and getting the playerID and pushToken void OnGUI() { GUIStyle customTextSize = new GUIStyle("button"); customTextSize.fontSize = 30; GUIStyle guiBoxStyle = new GUIStyle("box"); guiBoxStyle.fontSize = 30; GUI.Box(new Rect(10, 10, 390, 250), "Test Menu", guiBoxStyle); if (GUI.Button(new Rect(60, 80, 300, 60), "SendTags", customTextSize)) { // You can tags users with key value pairs like this: GameThrive.SendTag("UnityTestKey", "TestValue"); // Or use an IDictionary if you need to set more than one tag. GameThrive.SendTags(new Dictionary <string, string>() { { "UnityTestKey2", "value2" }, { "UnityTestKey3", "value3" } }); // You can delete a single tag with it's key. // GameThrive.DeleteTag("UnityTestKey"); // Or delete many with an IList. // GameThrive.DeleteTags(new List<string>() {"UnityTestKey2", "UnityTestKey3" }); } if (GUI.Button(new Rect(60, 170, 300, 60), "GetIds", customTextSize)) { GameThrive.GetIdsAvailable((playerId, pushToken) => { extraMessage = "PlayerID:\n" + playerId + "\n\nPushToken:\n" + pushToken; }); } if (extraMessage != null) { guiBoxStyle.alignment = TextAnchor.UpperLeft; guiBoxStyle.wordWrap = true; GUI.Box(new Rect(10, 300, Screen.width - 20, Screen.height - 310), extraMessage, guiBoxStyle); } }