public void Use() { if (InventoryScript.MyInstance.CanAddBag == true) { MyBagScript = Instantiate(bagPrefab, InventoryScript.MyInstance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); InventoryScript.MyInstance.AddBag(this); } }
public void Use() { if (InventoryScript.MyInstance.CanAddBag) { Remove(); MyBagScript = Instantiate(bagPrefab, InventoryScript.MyInstance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); InventoryScript.MyInstance.AddBag(this); } //end of if } //end of Use function
public void Use() { if (InventoryScript.MyInstance.CanAddBag) { Remove(); MyBagScript = GameObject.Instantiate(bagPrefab, InventoryScript.MyInstance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); InventoryScript.MyInstance.AddBag(this); } }
public void Use() { if (InventoryScript.MyInstance.CanAddBag) { Remove(); MyBagScript = Instantiate(bagPrefab, InventoryScript.MyInstance.transform).GetComponent <BagScript>(); MyBagScript.AddSlot(slots); if (MyBagButton == null) { InventoryScript.MyInstance.AddBag(this); } else { InventoryScript.MyInstance.AddBag(this, MyBagButton); } } }
public void Use() { if (InventoryScript.Instance.canAddBag) { Remove(); MyBagScript = Instantiate(bagPrefab, InventoryScript.Instance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); if (MyBagButton == null) { InventoryScript.Instance.AddBag(this); } else { InventoryScript.Instance.AddBag(this, MyBagButton); } MyBagScript.GetComponent <RectTransform>().localScale = new Vector3(1, 1, 1); } }
// 아이템 사용 public void Use() { if (InventoryScript.instance.CanAddBag) { Remove(); MyBagScript = Instantiate(bagPrefab, InventoryScript.instance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); // 해당 가방이 등록된 가방퀵슬롯이 없다면 if (MyBagButton == null) { InventoryScript.instance.AddBag(this); } // 해당 가방에 등록된 가방퀵슬롯이 있다면 else { // 인벤토리에 가방을 추가한다. (가방 교체) InventoryScript.instance.AddBag(this, MyBagButton); } MyBagScript.MyBagIndex = MyBagButton.BagIndex; } }
public void Use() { if (InventoryScript.MyInstance.CanAddBag) { Remove(); MyBagScript = Instantiate(bagPrefab, InventoryScript.MyInstance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); if (MyBagButton == null) { InventoryScript.MyInstance.AddBag(this); //omogucava da torba na pocetku bude zatvorena if (this.MyBagScript.IsOpen) { this.MyBagScript.OpenClose(); } } else { InventoryScript.MyInstance.AddBag(this, MyBagButton); } } }
public void SetupScript() { MyBagScript = Instantiate(bagPrefab, InventoryScript.MyInstance.transform).GetComponent <BagScript>(); MyBagScript.AddSlots(slots); }