// Create an instance of this class. Add an AppcoinsStore listener and // get products definitions from ConfigurationBuilder public void Initialize(IAppcoinsStoreListener listener, AppcoinsConfigurationBuilder builder) { try { _listener = listener; _controller = new AppcoinsStoreController(this, builder); CreateAndSetupJavaBind(); } // Catch specific errors and then call OnInitializesFail catch (System.Exception e) { Debug.LogError("Failed with exception " + e); OnInitializeFail(e.ToString()); } }
void Awake() { DontDestroyOnLoad(this.gameObject); onInitializeSuccess = new UnityEvent(); onInitializeFailed = new UnityEvent(); onPurchaseSuccess = new PurchaseEvent(); onPurchaseFailed = new PurchaseEvent(); _builder = new AppcoinsConfigurationBuilder(); _appcoinsPurchasing = gameObject.AddComponent <AppcoinsPurchasing>(); _versionReporter = gameObject.AddComponent <BDSVersionReporter>(); if (_versionReporter == null) { //Debug.LogError("Failed initializing! Plugin prefab is missing BDS VersionReporter. Please use the unmodified version of the prefab."); Debug.LogError("Failed initializing! Plugin prefab is missing BDS VersionReporter. Please use the unmodified version of the prefab."); return; } }
public AppcoinsStoreController(AppcoinsPurchasing appc, AppcoinsConfigurationBuilder builder) { _appcoinsIAB = appc; products = new AppcoinsProductCollection(builder.products); }