当前位置: 首页>>代码示例>>C#>>正文


C# Item.getName方法代码示例

本文整理汇总了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;
 }
开发者ID:Gabe-Biele,项目名称:Project-Circleage,代码行数:10,代码来源:GameUI.cs

示例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
    }
开发者ID:bcjroberts,项目名称:ProjectBCM,代码行数:17,代码来源:ItemManager.cs

示例3: UnEquipWeapon

 void UnEquipWeapon(Item item)
 {
     if (item.itemType == ItemType.Weapon)
     {
         Destroy(weaponSlot.FindChild(item.getName()+"_"+item.getIdItem()).gameObject);
     }
 }
开发者ID:BoisArnaud,项目名称:Assets,代码行数:7,代码来源:PlayerInventory.cs

示例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;
     }
 }
开发者ID:BoisArnaud,项目名称:Assets,代码行数:10,代码来源:PlayerInventory.cs

示例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;
 }
开发者ID:AshBlankets,项目名称:PlaceMapp,代码行数:7,代码来源:Order.cs

示例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;
 }
开发者ID:POSTECH-OOP-14,项目名称:POSMON,代码行数:22,代码来源:CharacterStatus.cs

示例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);
	}
开发者ID:aintech,项目名称:Heroes_of_Routine,代码行数:41,代码来源:ItemDescriptor.cs

示例8: equals

 public bool equals(Item item)
 {
     if (getItemType() == item.getItemType() && getName() == item.getName() && getSatisfyStrength() == item.getSatisfyStrength())
         return true;
     return false;
 }
开发者ID:Ozelotl,项目名称:Portfolio,代码行数:6,代码来源:Item.cs


注:本文中的Item.getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。