public void AddBag(Bag bag, int bagIndex) { bag.SetupScript(); MyBags.Add(bag); bag.MyBagButton = bagButtons[bagIndex]; bagButtons[bagIndex].MyBag = bag; }
public void AddBag(Bag bag) { foreach (BagButton bagButton in bagButtons) { if (bagButton.MyBag == null) { bagButton.MyBag = bag; MyBags.Add(bag); bag.MyBagButton = bagButton; bag.MyBagScript.transform.SetSiblingIndex(bagButton.MyBagIndex); break; } } }
public void AddBag(Bag bag, BagButton bagButton) { MyBags.Add(bag); bagButton.MyBag = bag; bag.MyBagScript.transform.SetSiblingIndex(bagButton.MyBagIndex); }