コード例 #1
0
 public void AddBag(Bag bag, int bagIndex)
 {
     bag.SetupScript();
     MyBags.Add(bag);
     bag.MyBagButton            = bagButtons[bagIndex];
     bagButtons[bagIndex].MyBag = bag;
 }
コード例 #2
0
    public void OpenClose()
    {
        bool closedBag = MyBags.Find(x => !x.MyBagScript.IsOpen);

        foreach (Bag bag in MyBags)
        {
            if (bag.MyBagScript.IsOpen != closedBag)
            {
                bag.MyBagScript.OpenClose();
            }
        }
    }
コード例 #3
0
 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;
         }
     }
 }
コード例 #4
0
 public void RemoveBag(Bag bag)
 {
     MyBags.Remove(bag);
     Destroy(bag.MyBagScript.gameObject);
 }
コード例 #5
0
 public void AddBag(Bag bag, BagButton bagButton)
 {
     MyBags.Add(bag);
     bagButton.MyBag = bag;
     bag.MyBagScript.transform.SetSiblingIndex(bagButton.MyBagIndex);
 }