예제 #1
0
    public void OwnerUpdate(GameObject collider)
    {
        if (owner == null && protectTime <= 0)
        {
            ItemBox box = collider.GetComponentInParent <ItemBox>();

            if (box != null && !box.IsFull())
            {
                owner = collider;
            }
        }
    }
예제 #2
0
    public bool IsObtained()
    {
        bool isObtained = false;

        if (owner != null)
        {
            ItemBox box = owner.GetComponentInParent <ItemBox>();

            if (!box.IsFull())
            {
                box.ObtainItem(itemID);
                isObtained = true;
            }
            else
            {
                owner = null;
            }
        }

        return(isObtained);
    }