本文整理汇总了C#中Weapon.SetRange方法的典型用法代码示例。如果您正苦于以下问题:C# Weapon.SetRange方法的具体用法?C# Weapon.SetRange怎么用?C# Weapon.SetRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon.SetRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Start
// Use this for initialization
void Start ()
{
equipState = Equipped.Primary;
primaryWeapon = gameObject.AddComponent<Weapon>();
Animator anim = GetComponent<Animator> ();
if (anim.runtimeAnimatorController.name.Contains ("elf")) {
primaryWeapon.SetRange (10);
}
primaryWeapon.projectilePrefab = prefab;
}
示例2: Create
//.........这里部分代码省略.........
}
}
else if (_strName.StartsWith("Arrow:"))
{
frmPickWeaponCategory.WeaponType = "bow";
}
else if (_strName.StartsWith("Bolt:"))
{
frmPickWeaponCategory.WeaponType = "crossbow";
}
frmPickWeaponCategory.ShowDialog();
_strExtra = frmPickWeaponCategory.SelectedCategory;
objNode.Text += " (" + _strExtra + ")";
}
// Add Gear Weapons if applicable.
if (objXmlGear.InnerXml.Contains("<addweapon>"))
{
XmlDocument objXmlWeaponDocument = XmlManager.Instance.Load("weapons.xml");
// More than one Weapon can be added, so loop through all occurrences.
foreach (XmlNode objXmlAddWeapon in objXmlGear.SelectNodes("addweapon"))
{
XmlNode objXmlWeapon = objXmlWeaponDocument.SelectSingleNode("/chummer/weapons/weapon[name = \"" + objXmlAddWeapon.InnerText + "\"]");
TreeNode objGearWeaponNode = new TreeNode();
Weapon objGearWeapon = new Weapon(objCharacter);
objGearWeapon.Create(objXmlWeapon, objCharacter, objGearWeaponNode, null, null);
objGearWeaponNode.ForeColor = SystemColors.GrayText;
if (blnAerodynamic)
{
objGearWeapon.Name += " (" + LanguageManager.Instance.GetString("Checkbox_Aerodynamic") + ")";
objGearWeapon.SetRange("Aerodynamic Grenades");
objGearWeaponNode.Text = objGearWeapon.DisplayName;
_strName += " (" + LanguageManager.Instance.GetString("Checkbox_Aerodynamic") + ")";
objNode.Text = DisplayName;
}
objWeaponNodes.Add(objGearWeaponNode);
objWeapons.Add(objGearWeapon);
_guiWeaponID = Guid.Parse(objGearWeapon.InternalId);
}
}
// If the item grants a bonus, pass the information to the Improvement Manager.
if (objXmlGear.InnerXml.Contains("<bonus>"))
{
// Do not apply the Improvements if this is a Focus, unless we're speicifically creating a Weapon Focus. This is to avoid creating the Foci's Improvements twice (once when it's first added
// to the character which is incorrect, and once when the Focus is actually Bonded).
bool blnApply = !((_strCategory == "Foci" || _strCategory == "Metamagic Foci") && !objXmlGear["bonus"].InnerXml.Contains("selecttext"));
if (blnApply)
{
ImprovementManager objImprovementManager;
if (blnAddImprovements)
objImprovementManager = new ImprovementManager(objCharacter);
else
objImprovementManager = new ImprovementManager(null);
objImprovementManager.ForcedValue = strForceValue;
if (!objImprovementManager.CreateImprovements(Improvement.ImprovementSource.Gear, strSource, objXmlGear["bonus"], false, intRating, DisplayNameShort))
{
_guiID = Guid.Empty;
return;