コード例 #1
0
        /// <summary>
        /// Drops the actual item and stops the ability.
        /// </summary>
        private void DropItem()
        {
            // DropItem may be triggered by the animation event even when the ability isn't active.
            if (!IsActive)
            {
                return;
            }

            // Drop each item. If a drop prefab is specified then the item will be dropped.
            if (m_DroppedItems == null)
            {
                m_DroppedItems = new ResizableArray <GameObject>();
            }
            else
            {
                m_DroppedItems.Clear();
            }
            for (int i = 0; i < m_Items.Length; ++i)
            {
                if (m_Items[i] != null)
                {
                    var droppedItem = m_Inventory.RemoveItem(m_Items[i].ItemIdentifier, m_Items[i].SlotID, 1, true);
                    if (droppedItem != null)
                    {
                        m_DroppedItems.Add(droppedItem);
                    }
                    m_Items[i] = null;
                }
            }

            StopAbility();
        }
コード例 #2
0
 public void Clear()
 {
     _buffer.Clear();
 }