예제 #1
0
 public void Control()
 {
     if (ItemsOnTheGround.Count > 0)
     {
         ItemsOnTheGround item = ItemsOnTheGround[0];
         AddItem(item);
     }
 }
예제 #2
0
    private void OnTriggerEnter2D(Collider2D collider)
    {
        ItemsOnTheGround item = collider.GetComponent <ItemsOnTheGround>();

        if (item)
        {
            ItemsOnTheGround.Add(item);
        }
    }
예제 #3
0
    private void OnTriggerExit2D(Collider2D collider)
    {
        ItemsOnTheGround item = collider.GetComponent <ItemsOnTheGround>();

        if (item)
        {
            for (int i = 0; i < ItemsOnTheGround.Count; i++)
            {
                if (ItemsOnTheGround[i] == item)
                {
                    ItemsOnTheGround.RemoveAt(i);
                }
            }
        }
    }
예제 #4
0
 private void AddItem(ItemsOnTheGround item)
 {
     item.Collect(Inventory1);
 }