示例#1
0
            private IAPButtonStoreManager()
            {
                catalog = ProductCatalog.LoadDefaultCatalog();

                StandardPurchasingModule module = StandardPurchasingModule.Instance();

                module.useFakeStoreUIMode = FakeStoreUIMode.StandardUser;

                ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);

                //This seems to be outdated/unneeded, the value should be set in unity services
                //builder.Configure<IGooglePlayConfiguration>().SetPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2O/9/H7jYjOsLFT/uSy3ZEk5KaNg1xx60RN7yWJaoQZ7qMeLy4hsVB3IpgMXgiYFiKELkBaUEkObiPDlCxcHnWVlhnzJBvTfeCPrYNVOOSJFZrXdotp5L0iS2NVHjnllM+HA1M0W2eSNjdYzdLmZl1bxTpXa4th+dVli9lZu7B7C2ly79i/hGTmvaClzPBNyX+Rtj7Bmo336zh2lYbRdpD5glozUq+10u91PMDPH+jqhx10eyZpiapr8dFqXl5diMiobknw9CgcjxqMTVBQHK6hS0qYKPmUDONquJn280fBs1PTeA6NMG03gb9FLESKFclcuEZtvM8ZwMMRxSLA9GwIDAQAB");

                foreach (var product in catalog.allProducts)
                {
                    if (product.allStoreIDs.Count > 0)
                    {
                        var ids = new IDs();
                        foreach (var storeID in product.allStoreIDs)
                        {
                            ids.Add(storeID.id, storeID.store);
                        }
                        builder.AddProduct(product.id, product.type, ids);
                    }
                    else
                    {
                        builder.AddProduct(product.id, product.type);
                    }
                }
                                #if RECEIPT_VALIDATION
                validator = new CrossPlatformValidator(GooglePlayTangle.Data(), AppleTangle.Data(), Application.bundleIdentifier);
                                #endif
                UnityPurchasing.Initialize(this, builder);
            }
示例#2
0
        //初始化内购项目,主要是从catalog中获取商品信息,设置给 UnityPurchasing
        void InitializePurchasing()
        {
            if (IsInitialized())
            {
                Debug.Log("初始化失败");
                return;
            }
            StandardPurchasingModule module = StandardPurchasingModule.Instance();

            module.useFakeStoreUIMode = FakeStoreUIMode.StandardUser;
            ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);
            //通过编辑器中的Catalog添加,方便操作
            ProductCatalog catalog = ProductCatalog.LoadDefaultCatalog();

            // Debug.Log(catalog.allProducts.Count);
            foreach (var product in catalog.allProducts)
            {
                if (product.allStoreIDs.Count > 0)
                {
                    // Debug.Log("product:" + product.id);
                    var ids = new IDs();
                    foreach (var storeID in product.allStoreIDs)
                    {
                        ids.Add(storeID.id, storeID.store);
                        // Debug.Log("stordId:" + storeID.id  + ", " + storeID.store);
                    }
                    builder.AddProduct(product.id, product.type, ids);
                }
                else
                {
                    builder.AddProduct(product.id, product.type);
                }
            }
            UnityPurchasing.Initialize(this, builder);
        }
示例#3
0
    public IAPManager()
    {
        ConfigurationBuilder builder = ConfigurationBuilder.Instance(StandardPurchasingModule.Instance());
        ProductCatalog       catalog = ProductCatalog.LoadDefaultCatalog();

        foreach (ProductCatalogItem item in catalog.allProducts)
        {
            if (item.allStoreIDs.Count > 0)
            {
                IDs ids = new IDs();
                foreach (StoreID storeID in item.allStoreIDs)
                {
                    ids.Add(storeID.id, storeID.store);
                }
                builder.AddProduct(item.id, item.type, ids);
            }
            else
            {
                builder.AddProduct(item.id, item.type);
            }
        }

        if (builder.Configure <IAppleConfiguration> ().canMakePayments)
        {
            UnityPurchasing.Initialize(this, builder);
        }
        else
        {
            Alert.Show("当前设备不允许支付,请启用内购功能");
            Debug.Log("当前设备不允许支付");
        }
    }
示例#4
0
        private static string FormatMessage(IDs id, params object[] args)
        {
            string message;

            try
            {
                message = ResourceManager.GetString(id.ToString());
                if (message != null)
                {
#if DEBUG
                    if (Regex.Matches(message, @"\{[0-9]\}").Count > args.Length)
                    {
                        //TODO too many placeholders or too few args...
                    }
#endif
                    message = String.Format(message, args);
                }
                else
                {
                    message = "<<<error: message not found>>>";
                }
                return(message);
            }
            catch (Exception ex)
            {
                message = "INTERNAL ERROR while formatting error message: " + ex;
            }
            return(message);
        }
示例#5
0
    public ZIAPManager()
    {
        _initialized    = false;
        _restoreStarted = false;

        catalog = ProductCatalog.LoadDefaultCatalog();

        StandardPurchasingModule module = StandardPurchasingModule.Instance();

        module.useFakeStoreUIMode = FakeStoreUIMode.StandardUser;

        ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);

        foreach (var product in catalog.allProducts)
        {
            if (product.allStoreIDs.Count > 0)
            {
                var ids = new IDs();
                foreach (var storeID in product.allStoreIDs)
                {
                    ids.Add(storeID.id, storeID.store);
                }
                builder.AddProduct(product.id, product.type, ids);
            }
            else
            {
                builder.AddProduct(product.id, product.type);
            }
        }
        UnityPurchasing.Initialize(this, builder);
    }
示例#6
0
    private void InitIAP()
    {
        var module = StandardPurchasingModule.Instance();
        ConfigurationBuilder builder = ConfigurationBuilder.Instance(module);

        var catalog = ProductCatalog.LoadDefaultCatalog();

        foreach (var product in catalog.allValidProducts)
        {
            if (product.allStoreIDs.Count > 0)
            {
                var ids = new IDs();
                foreach (var storeID in product.allStoreIDs)
                {
                    ids.Add(storeID.id, storeID.store);
                }
                builder.AddProduct(product.id, product.type, ids);
            }
            else
            {
                builder.AddProduct(product.id, product.type);
            }
        }


        UnityPurchasing.Initialize(this, builder);
    }
        internal void Initialize()
        {
            shipItems = new Dictionary <int, ShipItem>();
            List <Part> parts          = player.Parts;
            int         activeBoxIndex = 0;
            IDs         id             = IDs.RECTHULLPART;

            shipItems.Add(0, new ShipItem(new Vector2(WindowSize.Width / 2, WindowSize.Height / 2), 0, null, player.Parts[0], id));      //not 100% centered   + hull = null  + linkpos = 0
            RectangularHull currentHull = (RectangularHull)parts[0];

            for (int i = 1; i < parts.Count; i++)
            {
                Part            currentPart = parts[i];
                RectangularHull carrier     = (RectangularHull)currentPart.Carrier;
                if (currentHull != carrier)
                {
                    activeBoxIndex = parts.IndexOf(carrier);
                    currentHull    = carrier;
                    AddEmptyParts(currentHull, shipItems[activeBoxIndex], false);
                }
                Vector2 itemPos = shipItems[activeBoxIndex].Position;
                Vector2 v       = LinkPosition(currentPart.LinkPosition, itemPos);

                ShipItem shipItem = CreateShipItem(currentPart, currentPart.LinkPosition, v, currentHull);
                shipItems.Add(i, shipItem);
            }
            RenewEmptyBoxes();
        }
示例#8
0
文件: RSS.cs 项目: gkama/NetRSSParser
        //Parse
        private void ParseRSS()
        {
            try
            {
                var feed = SyndicationFeed.Load(XmlReader.Create(URL));

                this.Updated  = feed.LastUpdatedTime.ToString();
                this.Title    = feed.Title.ToString();
                this.Link     = feed.Links.First(l => l.RelationshipType.Trim().ToLower() == "alternate").Uri.ToString();
                this.Category = new Entry._Category(feed.Categories.FirstOrDefault(c => c.Name != "").Name, feed.Categories.FirstOrDefault(c => c.Name != "").Label);
                this.ID       = feed.Id;

                //Items
                foreach (var item in feed.Items)
                {
                    //Authors
                    List <Entry._Author> authors = new List <Entry._Author>();
                    foreach (SyndicationPerson author in item.Authors)
                    {
                        authors.Add(new Entry._Author(author.Name, author.Uri));
                    }

                    //Categories
                    List <Entry._Category> categories = new List <Entry._Category>();
                    foreach (SyndicationCategory category in item.Categories)
                    {
                        categories.Add(new Entry._Category(category.Name, category.Label));
                    }

                    //Links
                    List <string> Links = new List <string>();
                    foreach (SyndicationLink link in item.Links)
                    {
                        Links.Add(link.Uri.ToString());
                    }

                    //ID
                    IDs.Add(item.Id.ToString());

                    //Updated
                    Updateds.Add(item.LastUpdatedTime.ToString());

                    //Content
                    Contents.Add(item.Content.ToString());

                    //Titles
                    Titles.Add(item.Title.Text.ToString());
                    //Titles & Links
                    if (!TitlesLinks.ContainsKey(item.Title.ToString().Trim()))
                    {
                        TitlesLinks.Add(item.Title.Text.ToString().Trim(), Links);
                    }

                    //Add entry
                    Entries.Add(new Entry(authors, categories, item.Content.ToString(), item.Id.ToString(), Links, item.LastUpdatedTime.ToString(), item.Title.ToString()));
                }
            }
            catch (Exception e) { throw e; }
        }
示例#9
0
 public Show(string title, int trakt)
 {
     this.title = title;
     this.ids   = new IDs()
     {
         trakt = trakt
     };
 }
        public ClickableItem(Vector2 position, IDs id = IDs.DEFAULT) : base(position, id)
        {
            Sprite.Scale *= SCALEFACTOR;
            Position      = position;
            this.id       = id;

            BoundBox = new Rectangle((int)(position.X - Sprite.Origin.X * SCALEFACTOR), (int)(position.Y - Sprite.Origin.Y * SCALEFACTOR), (int)Width, (int)Height);
        }
示例#11
0
 public GunPart(IDs id = IDs.DEFAULT, IDs bulletID = IDs.DEFAULT_BULLET) : base(id)
 {
     reloadTimer = new Timer(RELOADTIME);
     reloadTimer.Finish();
     this.bulletID = bulletID;
     projectiles.AddExtraBullets((int)bulletID, bulletCap);
     bullet = (Projectile)projectiles.GetEntity((int)bulletID);
 }
示例#12
0
        static void Main(string[] args)
        {
            IDs ids = new IDs();

            ids.idList = InputData();

            ids.IdCheck(Console.ReadLine());
        }
 public override IReadOnlyCollection <ErrorInfo> GetErrors()
 {
     if (ids != null)
     {
         Errors.UnionWith(IDs.Select(id => new ErrorInfo(methodName, id.Value, ErrorType.Leak, id.Key)));
     }
     return(Errors);
 }
示例#14
0
 public SprayGunPart(IDs id = IDs.DEFAULT) : base(id, IDs.SPRAYBULLET)
 {
     RELOADTIME      = 0.02f;
     reloadTimer     = new Timer(RELOADTIME);
     BulletSpeed     = 30;
     EvilBulletSpeed = 20;
     projectiles.AddExtraBullets((int)bulletID, bulletCap); //Extra 5 bullets for this gun
 }
示例#15
0
    void ParserCommand(Hashtable has)
    {
        IDs _currentId = (IDs)has["id"].GetHashCode();

//#if UNITY_EDITOR
//        Debug.Log(Time.frameCount + " <Color=#fff000> TournamentsUI::ParserCommand - " + _currentId.ToString() + " </Color>");
//#endif
        switch (_currentId)
        {
        case IDs.RQNowConfig:
            NET.I.AddMessage(PKID.TournamentNowConfig, "tmtid", _tmt_id, "gameid", _GameId);
            break;

        case IDs.RQNowRank:
            NET.I.AddMessage(PKID.TournamentNowRank, "tmtid", _tmt_id, "gameid", _GameId);
            return;

        case IDs.RQUserRank:
            NET.I.AddMessage(PKID.TournamentUserRank, "tmtid", _tmt_id, "gameid", _GameId);
            return;

        case IDs.StandyTimer:
            ActiveViews(eViewIDs.Standby);
            _Standby.StartCountdownTimer(_LimitSecTime);
            break;

        case IDs.GameTimer:
            ActiveViews(eViewIDs.Play);
            _Play.SetRQNowRank(_PKTmtNowRank);
            _Play.StartCountdownTimer(_LimitSecTime);
            break;

        case IDs.UpdateNowRank:
            _Play.SetRQNowRank(_PKTmtNowRank);
            break;

        case IDs.Final:
            ActiveViews(eViewIDs.Final);
            _Final.ActiveShow();
            break;

        case IDs.UpdateUserRank:
            _Final.SetRQUserRank(_PKTmtUserRank);
            break;

        case IDs.XBtnClick:
            click_Active();
            break;

        case IDs.DefaultTabLayer:
            _btnX.transform.SetSiblingIndex(0);
            _TabMyResults.transform.SetSiblingIndex(1);
            _TabMyInfo.transform.SetSiblingIndex(2);
            _TabMyRank.transform.SetSiblingIndex(3);
            break;
        }
        remove(_currentId);
    }
示例#16
0
 /// <summary>
 /// ダミーメソッドの引数
 /// </summary>
 /// <param name="count"></param>
 /// <returns></returns>
 public string GetDummyParameters(int count)
 {
     return(string.Join(
                ", ",
                IDs
                .Take(count)
                .Select(p => p.ParameterDeclare)
                ));
 }
示例#17
0
 /// <summary>
 /// Adds a store-specific product id to link with this object.
 /// Returns this instance.
 /// </summary>
 public IAPProduct AddStoreID(string storeProductId, params AppStore[] stores)
 {
     if (StoreIDs == null)
     {
         StoreIDs = new IDs();
     }
     StoreIDs.Add(storeProductId, stores);
     return(this);
 }
示例#18
0
 /// <summary>
 /// Returns a new IAPProduct instance with specified parameters.
 /// </summary>
 public static IAPProduct Create(string productID, ProductType productType, IDs storeIDs = null)
 {
     return(new IAPProduct()
     {
         ProductID = productID,
         ProductType = productType,
         StoreIDs = storeIDs
     });
 }
示例#19
0
 public virtual void SetStats(IDs id)
 {
     Sprite = SpriteHandler.GetSprite((int)id);
     Team   = EntityConstants.GetStatsFromID(EntityConstants.TEAM, id);
     if (Sprite is Sprite)
     {
         Sprite.Origin = new Vector2(Sprite.SpriteRect.Width / 2, Sprite.SpriteRect.Height / 2);
     }
 }
示例#20
0
 public Drawable(Vector2 position, IDs id = IDs.DEFAULT) // : base(sprite.spriteRect.Width, sprite.spriteRect.Height)
 {
     if (id == IDs.DEFAULT)
     {
         id = EntityConstants.TypeToID(GetType());
     }
     this.id = id;
     SetStats(id);
 }
示例#21
0
 void Start()
 {
     Clickzin = GameObject.Find("Canvas").GetComponent <IDs>();
     MyImage  = gameObject.GetComponent <Image>().sprite;
     for (int i = 0; i < 6; i++)
     {
         IdImage[i] = Resources.Load("Sprites/" + i, typeof(Sprite)) as Sprite;
     }
 }
示例#22
0
 private void IDchangedEvent(object sender, StringChangedEventArgs e)
 {
     if (IDs.Contains(e.ApplyString))
     {
     }
     else
     {
     }
 }
示例#23
0
 public TileModel this[IDs id]
 {
     get { return(this[(int)id]); }
     set
     {
         m_Models[(int)id]    = value;
         m_Models[(int)id].ID = (int)id;
     }
 }
        void RemoveID(IdentifierNameSyntax identifierExpression)
        {
            string id = identifierExpression.Identifier.ValueText;

            if (IDs.ContainsKey(id))
            {
                IDs.Remove(id);
            }
        }
示例#25
0
    void otherMineAI()
    {
        //占分矿ai,只选择下面的道路
        if (forkFlag[1] == 0 && forkFlag[2] == 1)
        {
            roadIsOK = 1;
        }
        else
        {
            roadIsOK = 0;
        }

        if (forkFlag[1] != 0 && forkWorker[1] == 0)
        {
            //道闸c方向不对,派遣道闸工人
            gameID = IDs.getIDByName(Tags.Character.GATEWORKER);
            if (cdAndGoldIsOK(gameID))
            {
                UnityEvent.UnityEventCenter.SendMessage <CreateUnitEvent>(new CreateUnitEvent(gameID, forkPosList[1] + subPos, owner, mineList[0]));
                forkWorker[1] = 1;
                canReach(mineMountain2Pos, cForkPos + subPos);//为了得到距离
                speed = getSpeedById(gameID);
                TimerController.getInstance().NewTimer(3f, false, delegate(float time) { }, delegate() {
                    forkWorker[1] = 0;
                }).Start();
                print("距离: " + distance + " 速度: " + speed + "时间: " + distance / speed);
                return;
            }
        }
        if (forkFlag[2] != 1 && forkWorker[2] == 0)
        {
            //道闸e方向不对,派遣道闸工人
            gameID = IDs.getIDByName(Tags.Character.GATEWORKER);
            if (cdAndGoldIsOK(gameID))
            {
                UnityEvent.UnityEventCenter.SendMessage <CreateUnitEvent>(new CreateUnitEvent(gameID, forkPosList[2] + subPos, owner, mineList[0]));
                forkWorker[2] = 1;
                canReach(mineMountain2Pos, eForkPos + subPos);
                speed = getSpeedById(gameID);
                TimerController.getInstance().NewTimer(7f, false, delegate(float time) { }, delegate() {
                    forkWorker[2] = 0;
                }).Start();
                return;
            }
        }

        //下方道路通畅,派遣占矿车
        if (roadIsOK == 1)
        {
            gameID = IDs.getIDByName(Tags.Vehicle.EXPLORATIONTRAMCAR);
            if (cdAndGoldIsOK(gameID))
            {
                UnityEvent.UnityEventCenter.SendMessage <CreateUnitEvent>(new CreateUnitEvent(gameID, cForkPos + subPos, owner, mineList[0]));
                return;
            }
        }
    }
示例#26
0
 public Achievement(IDs id, string name, string teaseName, string[] text, string musicID, int scoreValue)
 {
     ID         = id;
     Name       = name;
     TeaseName  = teaseName;
     Text       = text;
     MusicID    = musicID;
     ScoreValue = scoreValue;
 }
示例#27
0
 void Start()
 {
     Clickzin = GameObject.Find("Canvas").GetComponent<IDs>();
     MyImage = gameObject.GetComponent<Image>().sprite;
     for(int i = 0; i < 6; i++)
     {
         IdImage[i] = Resources.Load("Sprites/"+i,typeof(Sprite)) as Sprite;
     }
 }
示例#28
0
        public void GetNewPacklist()
        {
            Packlist packlist = new Packlist(m_uow as XpoUnitOfWork);

            packlist.PacklistId    = IDs.Generate(char.Parse("P"));
            packlist.ShipDate      = DateTime.Now;
            packlist.ShipToAddress = CurrentConfiguration.ShipToAddress;
            ChangePacklist(packlist);
        }
示例#29
0
        public PlayerPositionAndLook()
        {
            IDs.Add(-1);
            IDs.Add(-1);
            IDs.Add(0x0C);

            ID   = 0x2E;
            Send = true;
        }
示例#30
0
    private List <MineMountain> mineList = new List <MineMountain>();//矿山列表,期望首位储存的是 起始矿山。

    // Update is called once per frame
    void Update()
    {
        gameID = IDs.getIDByName(Tags.Vehicle.BASETRAMCAR);
        if (cdAndGoldIsOK(gameID))
        {
            UnityEvent.UnityEventCenter.SendMessage <CreateUnitEvent>(new CreateUnitEvent(gameID, new Vector3(261.7f, 0, 101.4f), owner, mineList[0]));
            return;
        }
    }
示例#31
0
 public Faction this[IDs id]
 {
     get { return(this[(int)id]); }
     private set
     {
         m_Factions[(int)id]    = value;
         m_Factions[(int)id].ID = (int)id;
     }
 }
示例#32
0
文件: FactoryTest.cs 项目: smitbmx/DS
 public void TestFactory(string fname, IDs ds)
 {
     Assert.AreEqual(DsFactory.getInstance(fname), ds);
 }
示例#33
0
        public IDs GetIDs()
        {
			IDs productIDs = new IDs();
			
			for(int i = 0; i < localIDs.Count; i++)
			{
				string localId = localIDs[i].GetIdentifier();
				if(string.IsNullOrEmpty(localId))
					localId = id;
						
				productIDs.Add(localId, ((IAPPlatform)i).ToString());
			}
			
			return productIDs;
        }
示例#34
0
 private static string FormatMessage(IDs id, params object[] args)
 {
     string message;
       try
       {
     message = ResourceManager.GetString(id.ToString());
     if (message != null)
     {
     #if DEBUG
       if (Regex.Matches(message, @"\{[0-9]\}").Count > args.Length)
       {
     //TODO too many placeholders or too few args...
       }
     #endif
       message = String.Format(message, args);
     }
     else
       message = "<<<error: message not found>>>";
     return message;
       }
       catch (Exception ex)
       {
     message = "INTERNAL ERROR while formatting error message: " + ex.ToString();
       }
       return message;
 }