本文整理汇总了C#中Item.getName方法的典型用法代码示例。如果您正苦于以下问题:C# Item.getName方法的具体用法?C# Item.getName怎么用?C# Item.getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Item
的用法示例。
在下文中一共展示了Item.getName方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: drawHoverBox
public GameObject drawHoverBox(Item theItem)
{
GameObject aHoverBox = ourGWM.createObject("UI/HoverWindow");
aHoverBox.name = "HoverWindow";
aHoverBox.transform.SetParent(GameObject.Find("UICanvas").transform);
aHoverBox.transform.position = Input.mousePosition + new Vector3(-95, 51);
aHoverBox.transform.FindChild("Name").gameObject.GetComponent<Text>().text = theItem.getName();
aHoverBox.transform.FindChild("Description").gameObject.GetComponent<Text>().text = theItem.getDescription();
return aHoverBox;
}
示例2: addItem
//Method adds item to inventory
public void addItem(Item item)
{
InventoryItem iItem = null;
for(int j = 0; j < inventory.Count; j++) {
if (inventory[j].getItem().getName().Equals(item.getName())) {
iItem = inventory[j];
break;
}
}
if (iItem==null) {//Object not found
iItem = new InventoryItem(item, 1);
}
//Need to add code to either increase the item count or add the item to the list,
//then update the current weight variable
}
示例3: UnEquipWeapon
void UnEquipWeapon(Item item)
{
if (item.itemType == ItemType.Weapon)
{
Destroy(weaponSlot.FindChild(item.getName()+"_"+item.getIdItem()).gameObject);
}
}
示例4: EquipWeapon
void EquipWeapon(Item item)
{
if (item.itemType == ItemType.Weapon)
{
Transform t = Instantiate (item.getItemModel().transform, weaponSlot.position, weaponSlot.rotation) as Transform;
GameObject Clone = t.gameObject;
Clone.name = item.getName()+"_"+item.getIdItem();
Clone.transform.parent = weaponSlot;
}
}
示例5: showConfirmation
public void showConfirmation(Item food, int quantity)
{
string orderString = "<b>"+food.getName()+"</b>";
orderString += "\n\nQuantity: " + quantity;
orderString += "\nTotal Price: $" + (quantity * food.getPrice()).ToString("F2");
confirmationText.text = orderString;
}
示例6: addItemToInventory
public bool addItemToInventory(Item item)
{
bool add = false;
for (int i = 0; i < 256; i++)
{
if (inventory[i] == null && !add)
{
inventory[i] = item;
if (item.getitem_Amount() <= 0)
item.additem_Amount(1);
return true;
}
else if (inventory[i].getName() == item.getName())
{
inventory[i].additem_Amount(1);
add = true;
return true;
}
}
/* No available inventory */
return false;
}
示例7: showDescription
public void showDescription (Item item) {
this.item = item;
nameValue.text = item.getName();
stat_2.text = "";
if (item is ArmorModifier) {
stat_1.text = "Защита=> " + ((ArmorModifier)item).getArmor().ToString();
} else if (item is WeaponItem) {
stat_1.text = ((WeaponItem)item).getDamage().ToString() + " " + ((WeaponItem)item).getWeaponType().getSpeedType().getSpeedName();
// stat_2.text = "Урон=> " + ((WeaponItem)item).getDamage().ToString();
// stat_1.text = "Скорость=> " + ((WeaponItem)item).getWeaponType().getAttackSpeed().ToString();
} else if (item is PotionItem) {
stat_1.text = ((PotionItem)item).getPotionType().getEffectDescript();
} else if (item is MaterialItem) {
stat_1.text = "";
}
if (stat_2.text.Equals("")) {
body.localPosition = bodyPosStat_1;
description.transform.localPosition = descriptPos_1;
} else {
body.localPosition = bodyPosStat_2;
description.transform.localPosition = descriptPos_2;
}
if (item.getItemQuality() != ItemQuality.COMMON) {
qualityValue.text = item.getItemQuality().getDescription();
qualityValue.color = item.getItemQuality().getColor();
quality.gameObject.SetActive(true);
} else {
quality.gameObject.SetActive(false);
}
description.text = item.getDescription();
costText.text = item.getCost().ToString();
stretchBody();
setActionMsg(item.getHolder());
onScreen = true;
Update();
gameObject.SetActive(true);
}
示例8: equals
public bool equals(Item item)
{
if (getItemType() == item.getItemType() && getName() == item.getName() && getSatisfyStrength() == item.getSatisfyStrength())
return true;
return false;
}