// Callback function for Arx SDK static void SDKCallback(int eventType, int eventValue, string eventArg, IntPtr context) { Debug.Log(eventType + " " + eventArg); // If our event is a device connecting: if (eventType == (int)Arx.Event.Arrival) { // Send our applet's index file Arx.AddStreamingAssetAs("/ArxShopApplet/index.html", "index.html"); // Send all its dependencies Arx.AddStreamingAssetAs("/ArxShopApplet/cannon.png", "cannon.png"); Arx.AddStreamingAssetAs("/ArxShopApplet/sword.png", "sword.png"); // Set our index file // This makes the applet show up and become active in Arx Control Arx.SetIndex("index.html"); } // Else, if it's a tap on a tag: else if (eventType == (int)Arx.Event.TagTapped) { // If the argument starts with "buy": if (eventArg.StartsWith("buy")) { Debug.Log(eventArg); // Get the ID of the item the user bought var item = int.Parse(eventArg.Replace("buy_it_", "")); // Buy it BuyItem(item); } } }
public void Show(string homepage = "index.html") { Arx.SetIndex(homepage); }