示例#1
0
    public void Remove(ItemData itemData, bool isMoving, int amount = -1)
    {
        if (restriction == null)
        {
            restriction = this.GetComponentInChildren <ItemContainerRestrictor>();
        }

        if (restriction != null)
        {
            if (restriction.IsRestricted(ItemContainerRestrictor.ContainerAction.remove))
            {
                return;
            }
        }
        RemoveItem(itemData, isMoving, amount);
    }
示例#2
0
    public void Add(ItemData itemData, int amount = -1, bool isSave = true)
    {
        if (restriction == null)
        {
            restriction = this.GetComponentInChildren <ItemContainerRestrictor>();
        }

        if (restriction != null)
        {
            if (restriction.IsRestricted(ItemContainerRestrictor.ContainerAction.add))
            {
                return;
            }
        }

        AddItem(itemData, amount, isSave);
    }
示例#3
0
    public ContainerAddState GetContainerAddState(ItemData itemData)
    {
        if (restriction == null)
        {
            restriction = this.GetComponentInChildren <ItemContainerRestrictor>();
        }

        if (restriction != null)
        {
            if (restriction.IsRestricted(ItemContainerRestrictor.ContainerAction.add))
            {
                return(new ContainerAddState(ContainerAddState.ActionState.No));
            }
        }
        if (itemData.isLocked)
        {
            return(new ContainerAddState(ContainerAddState.ActionState.No));
        }

        return(MyContainerAddState(itemData));
    }
示例#4
0
    public ContainerAddState GetContainerAddState(ItemData itemData)
    {
        if (restriction == null)
        {
            restriction = this.GetComponentInChildren<ItemContainerRestrictor>();
        }

        if (restriction != null)
        {
            if (restriction.IsRestricted(ItemContainerRestrictor.ContainerAction.add))
            {
                return new ContainerAddState(ContainerAddState.ActionState.No);
            }
        }
        if (itemData.isLocked)
        {
            return new ContainerAddState(ContainerAddState.ActionState.No);
        }

        return MyContainerAddState(itemData);
    }
示例#5
0
    public void Remove(ItemData itemData, bool isMoving, int amount = -1)
    {
        if (restriction == null)
        {
            restriction = this.GetComponentInChildren<ItemContainerRestrictor>();
        }

        if (restriction != null)
        {
            if (restriction.IsRestricted(ItemContainerRestrictor.ContainerAction.remove))
            {
                return;
            }
        }
        RemoveItem(itemData, isMoving, amount);
    }
示例#6
0
    public void Add(ItemData itemData, int amount = -1, bool isSave = true)
    {
        if (restriction == null)
        {
            restriction = this.GetComponentInChildren<ItemContainerRestrictor>();
        }

        if (restriction != null)
        {
            if (restriction.IsRestricted(ItemContainerRestrictor.ContainerAction.add))
            {
                return;
            }
        }

        AddItem(itemData, amount, isSave);

    }