public void OnEnable() { items = new List <GUIPurchasable> (); toRemove = new List <GUIPurchasable> (); InventoryPostProcessor.CreateInventoryIfNecessary(); AndroidManifestGenerator.CreateManifestIfNecessary(); using (TextReader reader = File.OpenText(InventoryPostProcessor.UNIBILL_JSON_INVENTORY_PATH)) { config = new UnibillConfiguration(reader.ReadToEnd(), Application.platform, new Uniject.Impl.UnityLogger()); } for (int t = 0; t < androidBillingPlatforms.Count(); t++) { if (androidBillingPlatforms[t] == config.AndroidBillingPlatform.ToString()) { androidBillingPlatform = t; break; } } foreach (PurchasableItem element in config.inventory) { List <IPlatformEditor> editors = new List <IPlatformEditor>(); editors.Add(new GooglePlayEditor(element)); editors.Add(new DefaultPlatformEditor(element, BillingPlatform.AmazonAppstore)); editors.Add(new AppleAppStoreEditor(element)); editors.Add(new DefaultPlatformEditor(element, BillingPlatform.MacAppStore)); editors.Add(new DefaultPlatformEditor(element, BillingPlatform.WindowsPhone8)); editors.Add(new DefaultPlatformEditor(element, BillingPlatform.Windows8_1)); editors.Add(new DefaultPlatformEditor(element, BillingPlatform.SamsungApps)); items.Add(new GUIPurchasable(element, editors)); } currencyEditor = new UnibillCurrencyEditor(config); }
public UnibillCurrencyEditor(UnibillConfiguration config) { this.config = config; foreach (var currency in config.currencies) { this.currencies.Add(new EditableCurrency(currency)); } }
public Biller(UnibillConfiguration config, TransactionDatabase tDb, IBillingService billingSubsystem, ILogger logger, HelpCentre help, ProductIdRemapper remapper, CurrencyManager currencyManager) { this.InventoryDatabase = config; this.transactionDatabase = tDb; this.billingSubsystem = billingSubsystem; this.logger = logger; logger.prefix = "UnibillBiller"; this.help = help; this.Errors = new List <UnibillError> (); this.remapper = remapper; this.currencyManager = currencyManager; }
public Biller(UnibillConfiguration config, TransactionDatabase tDb, IBillingService billingSubsystem, ILogger logger, HelpCentre help, ProductIdRemapper remapper, CurrencyManager currencyManager) { this.InventoryDatabase = config; this.transactionDatabase = tDb; this.billingSubsystem = billingSubsystem; this.logger = logger; logger.prefix = "UnibillBiller"; this.help = help; this.Errors = new List<UnibillError> (); this.remapper = remapper; this.currencyManager = currencyManager; }
public static void mergeManifest() { if (!Directory.Exists("Assets/Plugins/Android")) { AssetDatabase.CreateFolder("Assets/Plugins", "Android"); } CreateManifestIfNecessary(); string xml = new UnityResourceLoader().openTextFile("unibillInventory.json").ReadToEnd(); UnibillConfiguration config = new UnibillConfiguration(xml, Application.platform, new UnityLogger()); XDocument doc = XDocument.Load(AndroidManifestPath); doc = new AndroidManifestMerger().merge(doc, config.AndroidBillingPlatform, config.AmazonSandboxEnabled); doc.Save(AndroidManifestPath); AssetDatabase.ImportAsset(AndroidManifestPath); }
public AmazonJSONGenerator(UnibillConfiguration config) { this.config = config; }