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


C# Weapon.Equip方法代码示例

本文整理汇总了C#中Weapon.Equip方法的典型用法代码示例。如果您正苦于以下问题:C# Weapon.Equip方法的具体用法?C# Weapon.Equip怎么用?C# Weapon.Equip使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Weapon的用法示例。


在下文中一共展示了Weapon.Equip方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: EquipWeapon

 /// <summary>
 /// 穿上武器
 /// </summary>
 void EquipWeapon(Weapon _weapon)
 {
     //穿上裝備,如果返回false代表無法裝備
     if (!_weapon.Equip())
         return;
     Equip(_weapon, true);//穿上裝備
     AddPassiveSpell(_weapon.SpellID);
 }
开发者ID:scozirge,项目名称:AVentureCapital,代码行数:11,代码来源:Equip.cs

示例2: Equip

    public void Equip(Weapon.Type type)
    {
        Expel(); //just in case

        if(type != Weapon.Type.NumTypes) {
            mCurWeapon = weapons[(int)type];
            mCurWeapon.gameObject.SetActiveRecursively(true);
            mCurWeapon.Equip();
        }
    }
开发者ID:ddionisio,项目名称:GitGirl,代码行数:10,代码来源:PlayerGrabber.cs

示例3: Equip

	/// <summary>
	/// Equip the specified item. This method also updates and maintains the equipmentUI.
	/// </summary>
	/// <param name="item">Item to equip.</param>
	public override void Equip(Item item) {
		attributes.RegisterEquip (item);

		if (item.Type == ItemType.Weapon) {
			var wep = Instantiate (item.prefab);
			wep.transform.SetParent (weaponSlot.transform, false);

			if (wep != null) {
				weapon = wep.GetComponent<Weapon> ();
				weapon.Equip (calculateDamage ());
			}
		}
		if(item.Type == ItemType.Offhand)
		{

		}
		if(item.Type == ItemType.Armor)
		{

		}
		//Instantiate armor - not added yet!!
	}
开发者ID:TobiasMorell,项目名称:Game2Grow-Wizard,代码行数:26,代码来源:Wizard.cs

示例4: AddPlayersWeaponsToInventory

	public static void AddPlayersWeaponsToInventory(int pmPlayerId, Dictionary<string,Item> pmInventory, Player player)
	{
		IDbConnection dbconn = GetConnection ();
		IDbCommand dbcmd = dbconn.CreateCommand();
		string sqlQuery = 	"select w.ID, w.NAME, w.WEAPON_TYPE_ID, w.WEAPON_CATEGORY_ID, w.WEAPON_DAMAGE_DIE_SIDES, w.WEAPON_DAMAGE_DIE_QUANTITY, w.SHORT_RANGE, w.LONG_RANGE, w.ICON_NAME, es.NAME, es.ID " +
			"FROM WEAPONS w join CHARACTERS_ITEMS ci on ci.ITEM_ID = w.ID and ci.ITEM_TYPE = 1  JOIN EQUIPEMENT_SLOTS es on ci.FIELD_ID = es.ID  where ci.CHARACTER_ID = " + pmPlayerId;
		dbcmd.CommandText = sqlQuery;

		IDataReader reader = dbcmd.ExecuteReader();
		while (reader.Read ()) {

			List<EquipementTypes> lvTypes = GetWeaponEqTypes (reader.GetInt32 (0), dbconn);

			Item lvItem = new Weapon (reader.GetString (1), GetWeaponTypeById (reader.GetInt32 (2)), GetWeaponCategoryById (reader.GetInt32 (3)), reader.GetInt32 (4), reader.GetInt32 (5), lvTypes, reader.GetInt32 (6), reader.GetInt32 (7));
			lvItem.resourceImageName = reader.GetString (8);
			lvItem.inventoryFieldId = reader.GetString (9);

			if (reader.GetInt32 (10) == player.databaseEqWeaponId)
				lvItem.Equip (player, false);
				

			pmInventory.Add (reader.GetString (9), lvItem);
	}

		CleanUp (reader,dbcmd,dbconn);
		reader = null;
		dbcmd = null;
		dbconn = null;
	}
开发者ID:sakurazuka90,项目名称:DnD5BattleEngine,代码行数:29,代码来源:DatabaseController.cs


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