//fonction d'utilisation public void Use() { if (Inventory.InventoryScr.AddBag) { Delete_the_Item(); BagScr = Instantiate(bagprefab, Inventory.InventoryScr.transform).GetComponent <Bag>(); BagScr.Initslots(slotnumber); if (BagButton == null) { Inventory.InventoryScr.InitBag(this); } else { Inventory.InventoryScr.InitBag2(this, BagButton); } BagScr.MyBagIndex = BagButton.Index; } }
public void SetUpScript() { BagScr = Instantiate(bagprefab, Inventory.InventoryScr.transform).GetComponent <Bag>(); BagScr.Initslots(slotnumber); }