本文整理汇总了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);
}
示例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();
}
}
示例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!!
}
示例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;
}