Example #1
0
        public void Update()
        {
            var distance = inventory.transform.position - container.transform.position;

            if (!inventory.HasContainer(container.gameObject))
            {
                Destroy(this);
            }
            else if (distance.sqrMagnitude > (range * range))
            {
                inventory.RemoveContainer(container.gameObject);
                Destroy(this);
            }
        }