Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 2
0
    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);
    }