コード例 #1
0
 public void Stop(InventoryObject _inventory)
 {
     if (base.Stop() && _inventory != null)
     {
         _inventory.Action(this);
     }
 }
コード例 #2
0
        public void Update(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            if (base.Update())
            {
                _inventory.Action(this);
            }
        }
コード例 #3
0
        public void Update(InventoryObject _inventory)
        {
            if (!Enabled || _inventory == null)
            {
                return;
            }

            foreach (InventoryActionDataObject _action in ActionList)
            {
                _action.Update(_inventory);
            }
        }
コード例 #4
0
        public void Insert(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            foreach (InventorySlotObject _slot in _inventory.Slots)
            {
                _slot.Amount = Insert(_slot.ItemName, _slot.Amount);
            }
        }
コード例 #5
0
        public void Stop(ICEWorldBehaviour _component)
        {
            InventoryObject    _inventory = null;
            ICECreatureControl _control   = _component as ICECreatureControl;

            if (_control != null)
            {
                _inventory = _control.Creature.Status.Inventory;
            }

            foreach (InventoryActionDataObject _action in ActionList)
            {
                _action.Stop(_inventory);
            }
        }
コード例 #6
0
        public static InventorySlotObject GetInventorySlot(GameObject _object, string _slot)
        {
            if (_object == null)
            {
                return(null);
            }

            InventoryObject _inventory = GetInventory(_object);

            if (_inventory != null)
            {
                return(_inventory.GetSlotByItemName(_slot));
            }
            else
            {
                return(null);
            }
        }
コード例 #7
0
        public void Copy(InventoryObject _inventory)
        {
            if (_inventory == null)
            {
                return;
            }

            base.Copy(_inventory);

            MaxSlots              = _inventory.MaxSlots;
            IgnoreInventoryOwner  = _inventory.IgnoreInventoryOwner;
            DefaultDropRange      = _inventory.DefaultDropRange;
            LastCollectedObjectID = _inventory.LastCollectedObjectID;
            UseDetachOnDie        = _inventory.UseDetachOnDie;

            Slots.Clear();
            foreach (InventorySlotObject _slot in _inventory.Slots)
            {
                Slots.Add(new InventorySlotObject(OwnerComponent, _slot));
            }
        }
コード例 #8
0
        public static InventoryObject GetInventory(GameObject _object)
        {
            if (_object == null)
            {
                return(null);
            }

            ICECreatureEntity _entity    = _object.GetComponent <ICECreatureEntity>();
            InventoryObject   _inventory = null;

            if (_entity != null)
            {
                if (_entity as ICECreatureControl != null)
                {
                    ICECreatureControl _creature = _entity as ICECreatureControl;
                    if (_creature != null)
                    {
                        _inventory = _creature.Creature.Status.Inventory;
                    }
                }
                else if (_entity as ICECreaturePlayer != null)
                {
                    ICECreaturePlayer _player = _entity as ICECreaturePlayer;
                    if (_player != null)
                    {
                        _inventory = _player.Inventory;
                    }
                }
                else if (_entity as ICECreatureItem != null)
                {
                    ICECreatureItem _item = _entity as ICECreatureItem;
                    if (_item != null)
                    {
                        _inventory = _item.Inventory;
                    }
                }
            }

            return(_inventory);
        }
コード例 #9
0
 public InventoryObject(InventoryObject _inventory) : base(_inventory)
 {
 }