本文整理汇总了C#中Slot.IsEmpty方法的典型用法代码示例。如果您正苦于以下问题:C# Slot.IsEmpty方法的具体用法?C# Slot.IsEmpty怎么用?C# Slot.IsEmpty使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Slot
的用法示例。
在下文中一共展示了Slot.IsEmpty方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MoveItem
//Moves item to new slot in inventory/swap items
public void MoveItem(Slot clickedSlot)
{
//If holding shift, make a splitStack window
if (Input.GetKey(KeyCode.LeftShift) && !clickedSlot.IsEmpty() && !HoverIcon.hoverIcon)
{
from = clickedSlot;
CreateSplitter();
return;
}
if (clickedSlot.transform.parent.gameObject.Equals(GameControl.comboWindow.gameObject))
{
if (HoverIcon.hoverIcon != null)
{
if (HoverIcon.hoverIcon.GetComponent<Slot>().SlotItems().Type != BaseItem.ItemType.RELIC)
{
return;
}
}
else
{
if (clickedSlot.name.Equals("ResultSlot"))
{
if (GameControl.comboWindow.Created)
{
from = clickedSlot;
CreateHoverIcon();
while (!from.IsEmpty())
{
HoverIcon.hoverIcon.GetComponent<Slot>().Items.Push(from.RemoveItem());
}
GameControl.comboWindow.Created = false;
}
return;
}
}
}
if (clickedSlot.transform.parent.gameObject.Equals(GameControl.equipment.gameObject))
{
if (HoverIcon.hoverIcon != null)
{
if (HoverIcon.hoverIcon.GetComponent<Slot>().SlotItems().Type == BaseItem.ItemType.EQUIPMENT)
{
BaseEquipment item = (BaseEquipment)(HoverIcon.hoverIcon.GetComponent<Slot>().SlotItems());
if (!item.SubType.ToString().Equals(clickedSlot.name))
{
return;
}
GameControl.player.Stats.TransferStats(item.Stats);
}
else if (HoverIcon.hoverIcon.GetComponent<Slot>().SlotItems().Type == BaseItem.ItemType.WEAPON)
{
if (clickedSlot.name.Equals("MAINHAND") || clickedSlot.name.Equals("OFFHAND"))
{
BaseWeapon item = (BaseWeapon)(HoverIcon.hoverIcon.GetComponent<Slot>().SlotItems());
if (item.Hand==2 && !clickedSlot.name.Equals("MAINHAND"))
{
return;
}
GameControl.player.Stats.TransferStats(item.Stats);
}
else
{
return;
}
}
else
{
return;
}
}
else
{
if (!clickedSlot.IsEmpty())
{
GameControl.player.Stats.RemoveStats(clickedSlot.GetComponent<Slot>().SlotItems().Stats);
}
}
}
//If from is null and slot has items in it, set from equal to slicked slot
if (HoverIcon.hoverIcon == null)
{
if (!clickedSlot.IsEmpty())
{
from = clickedSlot;
CreateHoverIcon();
while (!from.IsEmpty())
{
HoverIcon.hoverIcon.GetComponent<Slot>().Items.Push(from.RemoveItem());
}
}
}
//If the hoverIcon exists and has items in it, run code
else if (HoverIcon.hoverIcon != null)
{
to = clickedSlot;
//.........这里部分代码省略.........