Пример #1
0
        private void OnTriggerEnter2D(Collider2D other)
        {
            var item = other.GetComponentInParent <Item>();

            if (item != null && floor != null)
            {
                bool success = floor.AddItem(item);
                if (success)
                {
                    Debug.Log($"<color=green>Added item</color> {item.gameObject.name} to floor {floor.gameObject.name}");
                }
            }
        }