예제 #1
0
    private void OnTriggerExit2D(Collider2D other)
    {
        if (other.GetComponent <WorldThing>() != null)
        {
            worldThingInfocus.Highlight(false);
            worldThingInfocus = worldNothing;
        }

        if (other.GetComponent <ItemController>() != null)
        {
            AvailableItems.Remove(other.GetComponent <ItemController>());
            AvailableItems.TrimExcess();
        }
        // Debug.Log("There are " + AvailableItems.Count + " items available.");
    }
예제 #2
0
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent <WorldThing>() != null)
        {
            worldThingInfocus = other.GetComponent <WorldThing>();
            if (EquippedItem)
            {
                worldThingInfocus.Highlight(EquippedItem.CanActivateWith(worldThingInfocus));
            }
        }

        if (other.GetComponent <ItemController>() != null)
        {
            SafeAdd(other.GetComponent <ItemController>());
        }
        // Debug.Log("There are " + AvailableItems.Count + " items available.");
    }