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


C# Weapon.SetRange方法代码示例

本文整理汇总了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;
	}
开发者ID:JackUnthank,项目名称:Portfolio,代码行数:13,代码来源:InventoryBase.cs

示例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;
开发者ID:argo2445,项目名称:chummer5a,代码行数:67,代码来源:Gear.cs


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