本文整理汇总了C#中Item.GetName方法的典型用法代码示例。如果您正苦于以下问题:C# Item.GetName方法的具体用法?C# Item.GetName怎么用?C# Item.GetName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.GetName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FillDisplay
public void FillDisplay(Item pmItem)
{
itemImage.GetComponent<Image> ().sprite = pmItem.GetSprite();
itemName.GetComponent<Text> ().text = pmItem.GetName ();
itemDescription.GetComponent<Text> ().text = pmItem.GetDescription ();
mItem = pmItem;
if (pmItem is UsableItem) {
useButton.GetComponent<Button> ().interactable = true;
} else {
useButton.GetComponent<Button> ().interactable = false;
}
}
示例2: addItem
public static void addItem(Item item)
{
bool found = false;
foreach (Item i in inventory)
{
if (i.GetName() == item.GetName())
{
i.addQuantity(item.getQuantity());
found = true;
return;
}
}
if (!found)
inventory.Add(item);
}
示例3: AddItem
public bool AddItem(Item item_)
{
int index = 0;
for (int loop = 5; loop < Config.inventoryRow * Config.inventoryCol; loop++) {
if(equip[loop] == null){
index = loop;
equip[loop] = item_;
UI_Control.AddLog(item_.GetName() + "을(를) 획득하였다.");
break;
}
if(loop == Config.inventoryRow * Config.inventoryCol - 1){
UI_Control.AddLog("빈 자리가 없다!");
return false;
}
}
ui_control.AddItem (item_, index);
return true;
}
示例4: StorageFile
public StorageFile(string[] parentPathParts, Item remoteSource)
: base(parentPathParts.Merge(remoteSource.GetName()))
{
_remoteSource = remoteSource;
}
示例5: TakeOn
public void TakeOn(EEquipmentPlaces _place, Item _item)
{
var equipmentPlacesAttribute = EquipmentPlacesAttribute.GetAttribute(_place);
if (!equipmentPlacesAttribute.IsAbleToEquip(_item.Category))
{
throw new ApplicationException("Нельзя экипировать '" + _item.GetName(this) + "' как '" + EALSentence.NONE.GetString(_place.AsNoun()) + "'");
}
var item = m_equipment[_place];
if (item != null)
{
throw new ApplicationException("Одно поверх другого?");
}
m_backPack.GetItems(this).Remove(_item);
m_equipment[_place] = _item;
}
示例6: Pickup
private bool Pickup(Item[] list, Item it)
{
if (it == null)
return true;
for (int i = 0; i < list.Length; i++) {
if (list[i] == null) {
list[i] = it;
_game.Messenger.ItemMessage(it.GetName());
return true;
}
}
return false;
}