public static void Init(InitCallBack callback) { Thread thread = new Thread(() => { callback(Init()); }); thread.Start(); }
public void InitializePurchasing(InitCallBack initCallBack, Dictionary <int, string> products) { // If we have already connected to Purchasing ... if (IsInitialized()) { // ... we are done here. initCallBack.Invoke(true); return; } this.initCallBack = initCallBack; // Create a builder, first passing in a suite of Unity provided stores. var builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance()); //添加商品ID和类型 对应定义的商品ID foreach (KeyValuePair <int, string> kv in products) { builder.AddProduct(kv.Key.ToString(), ProductType.Consumable, new IDs { { kv.Value, GooglePlay.Name } }); } //builder.AddProduct(product_1, ProductType.Consumable, new IDs // { // {"s_1", GooglePlay.Name } // }); //builder.AddProduct(product_2, ProductType.Consumable, new IDs // { // {"s_2", GooglePlay.Name } // }); //builder.AddProduct(product_3, ProductType.Consumable, new IDs // { // {"s_3", GooglePlay.Name } // }); //builder.AddProduct(product_6, ProductType.Consumable, new IDs //{ //{"s_6", GooglePlay.Name } //}); // Kick off the remainder of the set-up with an asynchrounous call, passing the configuration // and this class' instance. Expect a response either in OnInitialized or OnInitializeFailed. //WarnDialog.showWarnDialog("Initialize before"); UnityPurchasing.Initialize(this, builder); //UnityPurchasing.I //WarnDialog.showWarnDialog("Initialize end"); }
private StorageUtils() { authDoneCB = RealtimeDBFactory.getAuther().auth().authDoneCB(); }
public void setInitCallBack(InitCallBack initCallBack) { _initCallBack = initCallBack; }
internal static extern int IPInit(string _name, string _pwd, InitCallBack _callback);