Exemple #1
0
 public void setNewItemSlot(int actualItemID)
 {
     listItemScript    = GameObject.Find("ListItem").GetComponent <listItemScript>();
     player            = GameObject.Find("Player").GetComponent <Player>();
     this.actualItemID = actualItemID;
     transform.GetChild(0).GetComponent <Image>().sprite = listItemScript.getListSortedItem()[actualItemID].GetComponent <SpriteRenderer>().sprite;
 }
Exemple #2
0
 public void setNewSlotShop(int itemID)
 {
     this.itemID    = itemID;
     player         = GameObject.Find("Player").GetComponent <Player>();
     listItemScript = GameObject.Find("ListItem").GetComponent <listItemScript>();
     transform.GetChild(0).GetComponent <Image>().sprite = listItemScript.getListSortedItem()[itemID].GetComponent <SpriteRenderer>().sprite;
 }
Exemple #3
0
 public void chooseItemShop()
 {
     listItemScript = GameObject.Find("ListItem").GetComponent <listItemScript>();
     player         = GameObject.Find("Player").GetComponent <Player>();
     if (GameObject.Find("Canvas").GetComponent <ControlMenu>().getShopOpen())
     {
         //If the slot who we click have an item
         if (player.listSlotItem.Contains(transform.GetSiblingIndex()))
         {
             GameObject.Find("Canvas").GetComponent <ControlMenu>().getActualSlotShop().GetComponent <slotShopScript>().setNewSlotShop(actualItemID);
             //Active the amount menu
             transform.parent.parent.parent.parent.GetChild(1).gameObject.SetActive(true);
             GameObject.Find("AmountText").GetComponent <amountShopScript>().amoutNumber = 1;
             GameObject.Find("AmountText").GetComponent <amountShopScript>().setTextAmount();
         }
         else
         {
             transform.parent.parent.parent.parent.GetChild(1).gameObject.SetActive(false);
         }
         //transform.parent.parent.parent.parent.GetChild(1).gameObject.SetActive(false);
         //transform.parent.parent.parent.gameObject.SetActive(false);
     }
 }
Exemple #4
0
 void Start()
 {
     player   = GameObject.Find("Player").GetComponent <Player>();
     listItem = GameObject.Find("ListItem").GetComponent <listItemScript>();
     SetSlot();
 }
Exemple #5
0
 void Start()
 {
     listItemScript = GameObject.Find("ListItem").GetComponent <listItemScript>();
     player         = GameObject.Find("Player").GetComponent <Player>();
 }