Example #1
0
 public RTShopGridData(EShopType shopType, ShopItemData data, RTShopGridData.ShopItemCallback buyCallback, RTShopGridData.ShopItemCallback showCallback)
 {
     this.ShopType = shopType;
     this.shopData = data;
     this.AVData = Globals.Instance.Player.ActivitySystem.GetValueMod(7);
     if (this.shopData.InfoType == 1)
     {
         this.itemInfo = Globals.Instance.AttDB.ItemDict.GetInfo(this.shopData.InfoID);
         if (this.itemInfo.Type == 3 && this.itemInfo.SubType == 0)
         {
             this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.itemInfo.Value2);
         }
         else if (this.itemInfo.Type == 3 && this.itemInfo.SubType == 3)
         {
             this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.itemInfo.Value2);
         }
     }
     else if (this.shopData.InfoType == 2)
     {
         this.petInfo = Globals.Instance.AttDB.PetDict.GetInfo(this.shopData.InfoID);
     }
     else if (this.shopData.InfoType == 3)
     {
         this.lopetInfo = Globals.Instance.AttDB.LopetDict.GetInfo(this.shopData.InfoID);
     }
     this.BuyShopItemEvent = buyCallback;
     this.ShowShopItemEvent = showCallback;
 }
	private void InitComponentsByLockLevel(ShopItemData shopItemData){
		if (shopItemData.UnlockLevel == ShopItemData.UNLOCK_LEVEL_LOCKED) {
			descriptionLabel.text = shopItemData.Description;
			lockObject.SetActive(true);
		} else if (shopItemData.UnlockLevel == ShopItemData.UNLOCK_LEVEL_UNLOCKED) {
			descriptionLabel.text = "ddddddddddddddd";
		}
	}
    // アイテム詳細画面の内容を更新するメソッド
    public void UpdateContent(ShopItemData itemData)
    {
        // アイテムのデータを保持しておく
        this.itemData = itemData;

        iconImage.sprite =
            SpriteSheetManager.GetSpriteByName("IconAtlas", itemData.iconName);
        nameLabel.text = itemData.name;
        priceLabel.text = itemData.price.ToString();
        descriptionLabel.text = itemData.description;
    }
Example #4
0
	public List<ShopItemData> GetShopItemDataList () {
		SQLiteDB sqliteDB = OpenDatabase ();
		string sql = "select * from " + SHOP_ITEM_DATA_LIST_TABLE + ";";
		Debug.Log("sql = "+ sql);
		SQLiteQuery sqliteQuery = new SQLiteQuery (sqliteDB, sql);
		List<ShopItemData> shopItemDataList = new List<ShopItemData> ();
		while(sqliteQuery.Step()){
			ShopItemData shopItemData = new ShopItemData();
			shopItemData.Id = sqliteQuery.GetInteger(ShopItemDataField.ID);
			shopItemData.Name = sqliteQuery.GetString(ShopItemDataField.NAME);
			shopItemData.Description = sqliteQuery.GetString(ShopItemDataField.DESCRIPTION);
			shopItemData.Tag = sqliteQuery.GetString(ShopItemDataField.TAG);
			shopItemData.Price = sqliteQuery.GetInteger(ShopItemDataField.PRICE);
			shopItemData.UnlockLevel = sqliteQuery.GetInteger(ShopItemDataField.UNLOCK_LEVEL);
			shopItemData.UnLockCondition = sqliteQuery.GetInteger(ShopItemDataField.UNLOCK_CONDITION);
			shopItemData.TargetRoomId = sqliteQuery.GetInteger(ShopItemDataField.TARGET_ROOM_ID);
			shopItemData.Effect = sqliteQuery.GetInteger(ShopItemDataField.EFFECT);
			shopItemDataList.Add(shopItemData);
		}
		CloseDatabase (sqliteDB, sqliteQuery);
		return shopItemDataList;
	}
Example #5
0
 List<ShopItemData> MoNiData(int nums)
 {
     List<ShopItemData> list = new List<ShopItemData>();
     for (int i = 0; i < nums; i++)
     {
         ShopItemData data = new ShopItemData();
         data.id = Random.Range(100, 199);
         if (data.id >= 100 && data.id < 120)
         {
             data.type = 0;
         }
         else if (data.id >= 120 && data.id < 140)
         {
             data.type = 1;
         }
         else if (data.id >= 140 && data.id < 160)
         {
             data.type = 2;
         }
         else if (data.id >= 160 && data.id < 180)
         {
             data.type = 3;
         }
         else if (data.id >= 180 && data.id < 200)
         {
             data.type = 4;
         }
         data.num = Random.Range(1, 99);
         data.name = "商品" + data.id.ToString();
         data.price = data.id + 666;
         list.Add(data);
     }
         return list;
 }
 // 確認画面の内容を更新するメソッド
 public void UpdateContent(ShopItemData itemData)
 {
     messageLabel.text = string.Format("Buy {0} for {1} coins?",
         itemData.name, itemData.price.ToString());
 }
	void Init (ShopItemData shopItemData) {
		nameLabel.text = shopItemData.Name;
		priceLabel.text = shopItemData.Price + "\u5186";
		itemSprite.spriteName = "shop_item_"+ shopItemData.Id;
		InitComponentsByLockLevel(shopItemData);
	}
	void Init (ShopItemData shopItemData) {
		mShopItemData = shopItemData;
		InitComponentsByLockLevel();
	}
Example #9
0
 public static void ShopBuyItemEvent(ShopItemData data)
 {
     if (!GameAnalytics.IsValide())
     {
         return;
     }
     if (data.Type == 1)
     {
         GameAnalytics.OnPurchase(GameAnalytics.PurchaseType.ShopBuyItem, data.Price);
     }
 }