コード例 #1
0
 // Use this for initialization
 void Start()
 {
     camAdjust           = true;
     instanciatedObjects = new List <GameObject>();
     costText            = GameObject.FindGameObjectWithTag("CostField");
     scrollList          = GameObject.FindGameObjectWithTag("Cart").GetComponent <ShopScrollList>();
 }
コード例 #2
0
ファイル: SampleButton.cs プロジェクト: barteq100/RPGMerchant
 public void Setup(Item currentItem, ShopScrollList currentScrollList)
 {
     item             = currentItem;
     ItemName.text    = item.ItemName;
     ItemImage.sprite = item.Icon;
     PriceText.text   = item.ItemPrice.ToString();
     scrollList       = currentScrollList;
 }
コード例 #3
0
 // Set up Only Field Buy
 public void Setup(DefaultField currentField, ShopScrollList currentScrollList)
 {
     field          = currentField;
     nameLabel.text = "Land";
     priceText.text = currentField.cost.ToString() + " Baht.";
     scrollList     = currentScrollList;
     buttonComponent.onClick.AddListener(HandleClickField);
 }
コード例 #4
0
 public void Setup(Item currentItem, ShopScrollList currScrollList)
 {
     item             = currentItem;
     nameLabel.text   = item.itemName;
     priceText.text   = "£ " + item.price.ToString();
     iconImage.sprite = item.icon;
     scrollList       = currScrollList; //button knows what list it currently belongs to
 }
コード例 #5
0
ファイル: SampleButton.cs プロジェクト: yuheong/HangryOrbital
 public void Setup(Item currentItem, ShopScrollList currentScrollList)
 {
     item             = currentItem;
     nameLabel.text   = item.itemName;
     iconImage.sprite = item.icon;
     priceText.text   = item.price.ToString("###.#") + " Lv" + item.numOwned;
     scrollList       = currentScrollList;
 }
コード例 #6
0
 public void Setup(Items currentItem, ShopScrollList currentList)
 {
     item             = currentItem;
     nameLabel.text   = item.itemName;
     iconImage.sprite = item.icon;
     priceText.text   = item.price.ToString();
     scrollList       = currentList;
 }
コード例 #7
0
ファイル: ListButton.cs プロジェクト: Golddenkk/new-era
 public void Setup(Item currentItem, ShopScrollList currentShopScrollList)
 {
     item            = currentItem;
     nameLabel.text  = item.name;
     icon.sprite     = item.icon;
     priceLabel.text = item.price.ToString();
     scrollList      = currentShopScrollList;
 }
コード例 #8
0
 public void Setup(Piatto currentItem, ShopScrollList currentScrollList)
 {
     item           = currentItem;
     nameLabel.text = item.Nome;
     iconImage      = item.UrlFoto;
     priceText.text = ("€ " + item.Prezzo.ToString());
     scrollList     = currentScrollList;
 }
    public void Setup(Item currentItem, ShopScrollList currentScrollList)
    {
        item             = currentItem;
        nameLabel.text   = item.itemName;
        priceLabel.text  = item.price.ToString();
        iconImage.sprite = item.icon;

        scrollList = currentScrollList; // so that our button knows to what list it currently belongs to. For interactivity
    }
コード例 #10
0
ファイル: SampleButton.cs プロジェクト: chancechen/unity3d
    public void Setup(Item currentItem, ShopScrollList list)
    {
        item       = currentItem;
        scrollList = list;

        itemName.text   = item.itemName;
        itemPrict.text  = item.price.ToString();
        itemIcon.sprite = item.icon;
    }
コード例 #11
0
ファイル: ShopTest.cs プロジェクト: Anemonella/PotionShop
    public void SetUp(SeedPacketItem currentPacket, ShopScrollList currentScrollList)
    {
        packet          = currentPacket;
        ItemName.text   = packet.Packet_Of;
        ItemPrice.text  = packet.PacketPrice.ToString();
        ItemIcon.sprite = packet.PacketGraphic;

        scrollList = currentScrollList;
    }
コード例 #12
0
ファイル: SampleButton.cs プロジェクト: WiensCMW/UnityStuff
    public void Setup(Item currentItem, ShopScrollList currentScrollList)
    {
        _item            = currentItem;
        nameLabel.text   = _item.itemName;
        priceLabel.text  = _item.price.ToString();
        iconImage.sprite = _item.icon;

        _scrollList = currentScrollList;
    }
コード例 #13
0
    public void Setup(Item currentItem, ShopScrollList currentScrollList)
    {
        item            = currentItem;
        nameLabel.text  = item.itemName;
        priceLabel.text = item.price.ToString();
        StartCoroutine(GetTexture(item.url, iconImage));


        scrollList = currentScrollList;
    }
コード例 #14
0
ファイル: ShopScrollList.cs プロジェクト: Golddenkk/new-era
 private void RemoveItem(Item item, ShopScrollList shopList)
 {
     for (int i = shopList.items.Count - 1; i >= 0; --i)
     {
         if (shopList.items[i] == item)
         {
             shopList.items.RemoveAt(i);
         }
     }
 }
コード例 #15
0
ファイル: ShopScrollList.cs プロジェクト: WiensCMW/UnityStuff
    private void RemoveItem(Item itemToRemove, ShopScrollList shopList)
    {
        //for (int i = shopList.itemList.Count - 1; i >= 0 ; i--)
        //{
        //    if (shopList.itemList[i] == itemToRemove)
        //        shopList.itemList.RemoveAt(i);
        //}

        shopList.itemList.RemoveAll(i => i == itemToRemove);
    }
コード例 #16
0
 // Use this for initialization
 // void Awake ()
 // {
 //      buttonComponent.onClick.AddListener (HandleClick);
 // }
 //Set up  Field Buy and seed
 public void Setup(DefaultField currentField, Seed currentItem, ShopScrollList currentScrollList)
 {
     item           = currentItem;
     field          = currentField;
     nameLabel.text = item.name;
     priceText.text = (item.cost + field.cost).ToString() + " Baht.";
     scrollList     = currentScrollList;
     buttonComponent.onClick.AddListener(HandleClickSeed);
     Debug.Log(item);
 }
コード例 #17
0
ファイル: SampleButton.cs プロジェクト: MoongK/KakaoCopy
    public void Setup(Item currentItem, ShopScrollList currentScrollist)
    {
        item             = currentItem;
        nameLabel.text   = item.itemName;
        iconImage.sprite = item.icon;
        priceText.text   = item.price.ToString() + " $ ";
        scrollList       = currentScrollist;

        GetComponent <Button>().onClick.AddListener(HandleClick);
    }
コード例 #18
0
 protected void RemoveItem(Item item, ShopScrollList shopList)
 {
     for (int i = shopList.ItemList.Count - 1; i >= 0; i--)
     {
         if (shopList.ItemList[i] == item)
         {
             shopList.ItemList.RemoveAt(i);
         }
     }
 }
コード例 #19
0
 private void RemoveItem(ShopScrollItem itemToRemove, ShopScrollList shopList)
 {
     for (int i = shopList.itemList.Count - 1; i >= 0; i--)
     {
         if (shopList.itemList[i] == itemToRemove)
         {
             shopList.itemList.RemoveAt(i);
         }
     }
 }
コード例 #20
0
 private void RemoveItem(Building itemToRemove, ShopScrollList shopList)
 {
     for (int i = shopList.buildings.Count - 1; i >= 0; i--)
     {
         if (shopList.buildings[i] == itemToRemove)
         {
             shopList.buildings.RemoveAt(i);
         }
     }
 }
 private void RemoveItem(Item itemToRemove, ShopScrollList shopList)
 {
     // Don't really got why .Remove() is not enough.
     for (int i = shopList.itemList.Count - 1; i >= 0; i--)
     {
         if (shopList.itemList[i] == itemToRemove)
         {
             shopList.itemList.RemoveAt(i);
         }
     }
 }
コード例 #22
0
    public void Setup(ShopScrollItem currentItem, ShopScrollList currentScrollList)
    {
        item       = currentItem;
        scrollList = currentScrollList;

        //ui
        //CGame.Instance.Icon_set_by_item_index(item.item_index, iconImage);
        //nameLabel.text = item.itemName;
        //CGame.Instance.Icon_set_by_price_type(item.price_type, priceImage);
        //priceText.text = item.price_value.ToString();
    }
コード例 #23
0
 void Awake()
 {
     if (Instance != null && Instance != this)
     {
         Destroy(gameObject);
     }
     else
     {
         Instance = this;
     }
 }
コード例 #24
0
    public void Setup(Music currentItem, ShopScrollList currentScrollList)
    {
        //Set song
        song = currentItem;

        //Set song name to Text object
        nameLabel.text = song.songName;

        //Set Scroll List
        scrollList = currentScrollList;
    }
コード例 #25
0
ファイル: ShopScrollList.cs プロジェクト: Herooik/Hop-Ball
 private void Awake()
 {
     if (Instance == null)
     {
         Instance = this;
     }
     else
     {
         Destroy(gameObject);
     }
 }
コード例 #26
0
 public void SetupPanelShopSkillPrefab(ShopSkill currentItem, ShopScrollList shopScrollList)
 {
     _shopSkill                = currentItem;
     _shopScrollList           = shopScrollList;
     ShopSkillID               = _shopSkill.ShopSkillID;
     SkillImg.sprite           = _shopSkill.SkillImg;
     BgPriceImg.sprite         = _shopSkill.BgPriceImg;
     SkillDescriptionText.text = _shopSkill.ItemDescription;
     PriceText.text            = $"{_shopSkill.Price}";
     AvailableOrNotText.text   = _shopSkill.AvailableOrNotText;
 }
コード例 #27
0
    public void Setup(Item item, ShopScrollList scrollList)
    {
        uiMgr           = UIManager.instance;
        this.scrollList = scrollList;

        this.item       = item;
        nameLabel.text  = item.name;
        priceLabel.text = "$ " + item.value.ToString();
        //iconImage.sprite = item.icon;

        button.onClick.AddListener(OnClick);
    }
コード例 #28
0
    //------------------------------------------------------
    public void Setup(Item currentItem, ShopScrollList currentScrollList, GameObject tempPainel, int slotIdTemp, ItemOnShop shopTemp)
    {
        slotId           = slotIdTemp;
        item             = currentItem;
        nameLabel.text   = item.itemName;
        iconImage.sprite = item.artwork;
        tempShopPrices   = shopTemp;

        season = currentScrollList.tempData.season;
        switch (season)
        {
        case 0: buyValue = shopTemp.SpringBuy;
            sellValue    = shopTemp.SpringSell;
            break;

        case 1:
            buyValue  = shopTemp.SummerBuy;
            sellValue = shopTemp.SummerSell;
            break;

        case 2:
            buyValue  = shopTemp.AutumBuy;
            sellValue = shopTemp.AutumSell;
            break;

        case 3:
            buyValue  = shopTemp.WinterBuy;
            sellValue = shopTemp.WinterSell;
            break;

        default:
            break;
        }
        if (tempPainel.name == "PlayerContentPainel" || tempPainel.name == "SellContent")
        {
            priceText.text = "<color=green>" + sellValue.ToString() + "G</color>";
        }
        else
        {
            priceText.text = "<color=red>-" + buyValue.ToString() + "G</color>";
        }
        if (tempPainel.name == "ShopContent")
        {
            amount.text = "";
        }
        if (tempPainel.name == "CartContent")
        {
            nameLabel.text = "x1";
        }

        scrollList           = currentScrollList;
        tempPainelGameObject = tempPainel;
    }
コード例 #29
0
ファイル: SampleButton.cs プロジェクト: drincast/EntrenoUnity
    public void Setup(Item currentItem, ShopScrollList currentScrollList)
    {
//        Debug.Log(string.Format("currentItem.itemName: {0}", currentItem.itemName));

        item = currentItem;
        //Debug.Log(string.Format("currentItem.itemName: {0}", item.itemName));
        nameLabel.text   = currentItem.itemName;
        priceLabel.text  = currentItem.price.ToString();
        iconImage.sprite = currentItem.icon;

        scrollList = currentScrollList;
    }
コード例 #30
0
    public void SetupShopItem(Weapon currentItem, ShopScrollList currentScrollList)
    {
        _weapon = currentItem;

        nameText.text         = _weapon.name;
        dmgText.text          = "DMG: " + _weapon.damage;
        firerateText.text     = "FIRERATE: " + _weapon.fireRate;
        energyConsumText.text = "ENERGY CONSUM.: " + _weapon.energyConsumption;
        priceLabel.text       = _weapon.priceInShop.ToString();
        iconImage.sprite      = _weapon.icon;

        _scrollList = currentScrollList;
    }