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


C# BodyPart类代码示例

本文整理汇总了C#中BodyPart的典型用法代码示例。如果您正苦于以下问题:C# BodyPart类的具体用法?C# BodyPart怎么用?C# BodyPart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GetFlavor

 private static string GetFlavor(BodyPart part)
 {
     var typePartSettings = part.Settings.GetModel<BodyTypePartSettings>();
     return (typePartSettings != null && !string.IsNullOrWhiteSpace(typePartSettings.Flavor))
                ? typePartSettings.Flavor
                : part.PartDefinition.Settings.GetModel<BodyPartSettings>().FlavorDefault;
 }
开发者ID:frikihamster,项目名称:Apphub,代码行数:7,代码来源:CultureBodyPartDriver.cs

示例2: setBodyParts

 public void setBodyParts(BodyPart[] parts, Aspects.Secondary type)
 {
     foreach (BodyPart part in parts)
     {
         setBodyPart(part, type);
     }
 }
开发者ID:MarjieVolk,项目名称:ShopTilYouDrop,代码行数:7,代码来源:PlayerSpriteController.cs

示例3: DamageEventArgs

 /// <summary>
 ///     Initializes a new instance of the DamageEventArgs class.
 /// </summary>
 /// <param name="otherPlayer">The other player.</param>
 /// <param name="amount">Amount of damage done.</param>
 /// <param name="weapon">Weapon used to damage another.</param>
 /// <param name="bodypart">BodyPart shot at.</param>
 public DamageEventArgs(BasePlayer otherPlayer, float amount, Weapon weapon, BodyPart bodypart)
 {
     OtherPlayer = otherPlayer;
     Amount = amount;
     Weapon = weapon;
     BodyPart = bodypart;
 }
开发者ID:Xalphox,项目名称:SampSharp,代码行数:14,代码来源:DamageEventArgs.cs

示例4: ItemInspector

 public ItemInspector(IContent item, ContentItemMetadata metadata) {
     _item = item;
     _metadata = metadata;
     _common = item.Get<ICommonPart>();
     _routable = item.Get<RoutePart>();
     _body = item.Get<BodyPart>();
 }
开发者ID:rupertwhitlock,项目名称:IncreasinglyAbsorbing,代码行数:7,代码来源:ItemInspector.cs

示例5: Demon

	public Demon(BodyPart _head, BodyPart _body, BodyPart _legs,
		BodyPart _appendages, BodyPart _decor)
	{
		head = _head;
		body = _body;
		legs = _legs;
		appendages = _appendages;
		decor = _decor;

		//build up other attributes
		hp = head.hp + body.hp + legs.hp + appendages.hp + decor.hp;
		offense = head.offense + body.offense + legs.offense + 
			appendages.offense + decor.offense;
		defense = head.defense + body.defense + legs.defense + 
			appendages.defense + decor.defense;
		//TODO: same for other attributes, including flesh/iron/ice
		//...
		maxHp = hp;
		flight = head.flight || body.flight || legs.flight || 
			appendages.flight || decor.flight;
		sight = head.sight || body.sight || legs.sight || 
			appendages.sight || decor.sight;
		iq = head.iq || body.iq || legs.iq || appendages.iq || decor.iq;
		charm = head.charm || body.charm || legs.charm || appendages.charm || 
			decor.charm;

		//determine skills randomly
		//TODO: rand() 0-1 and determine skill from each BodyPart


	}
开发者ID:Jaegersama,项目名称:Diablonomicon,代码行数:31,代码来源:Demon.cs

示例6: TargetingDummyElement

 public TargetingDummyElement(string spriteName, BodyPart part, IResourceManager resourceManager)
 {
     _resourceManager = resourceManager;
     BodyPart = part;
     _elementSprite = _resourceManager.GetSprite(spriteName);
     Update(0);
 }
开发者ID:Tri125,项目名称:space-station-14,代码行数:7,代码来源:TargetingDummyElement.cs

示例7: Start

    void Start()
    {
        // store the Animator component
        animator = GetComponent<Animator>();
        tpController = GetComponent<ThirdPersonController>();
        // find character chest and hips
        characterChest = animator.GetBoneTransform(HumanBodyBones.Chest);
        characterHips = animator.GetBoneTransform(HumanBodyBones.Hips);

        // set all RigidBodies to kinematic so that they can be controlled with Mecanim
        // and there will be no glitches when transitioning to a ragdoll
        setKinematic(true);
        setCollider(true);

        // find all the transforms in the character, assuming that this script is attached to the root
        Component[] components = GetComponentsInChildren(typeof(Transform));

        // for each of the transforms, create a BodyPart instance and store the transform 
        foreach (Component c in components)
        {
            BodyPart bodyPart = new BodyPart();
            bodyPart.transform = c as Transform;
            bodyParts.Add(bodyPart);
        }
    }
开发者ID:Meny22,项目名称:SmartClothingProject,代码行数:25,代码来源:Ragdoll.cs

示例8: BodyPartMessage

 private string BodyPartMessage(BodyPart part)
 {
     string message = "";
     switch (part)
     {
         case BodyPart.Groin:
             message = "nuts";
             break;
         case BodyPart.Torso:
             message = "chest";
             break;
         case BodyPart.Head:
             message = "head";
             break;
         case BodyPart.Left_Arm:
             message = "arm";
             break;
         case BodyPart.Right_Arm:
             message = "arm";
             break;
         case BodyPart.Left_Leg:
             message = "leg";
             break;
         case BodyPart.Right_Leg:
             message = "leg";
             break;
     }
     return message;
 }
开发者ID:millpond,项目名称:space-station-14,代码行数:29,代码来源:MedicalCapability.cs

示例9: requiredpart

        public BodyPart requiredpart(int partIndex)
        {
            BodyPart part = null;

            switch (partIndex)
            {
                case 0:
                    part = new BodyPart("images/Fairy_0.png", "Fairy");
                    break;
                case 1:
                    part = new BodyPart("images/Frankenstein_0.png", "Frankenstein");
                    break;
                case 2:
                    part = new BodyPart("images/Skeleton_0.png", "Skeleton");
                    break;
                case 3:
                    part = new BodyPart("images/Vampire_0.png", "Vampire");
                    break;
                case 4:
                    part = new BodyPart("images/Werewolf_0.png", "Werewolf");
                    break;
                case 5:
                    part = new BodyPart("images/Witch_0.png", "Witch");
                    break;
            }

            return part;
        }
开发者ID:hornoo,项目名称:IN710hornerb1,代码行数:28,代码来源:HeadFactory.cs

示例10: Armor

 public Armor(int armorMin, int durability, ArmorTypes type, int armorMax, BodyPart equipLocation)
 {
     this.Name = type.ToString();
     this.Durability = durability;
     this.EquipLocation = BodyPart.Chest;
     this.ArmorValue = GetArmorValue(armorMin, armorMax);
     this.EquipLocation = equipLocation;
 }
开发者ID:gabcinder2004,项目名称:GladiatorRPG,代码行数:8,代码来源:Armor.cs

示例11: ItemInspector

 public ItemInspector(IContent item, ContentItemMetadata metadata, IEnumerable<IHtmlFilter> htmlFilters) {
     _item = item;
     _metadata = metadata;
     _htmlFilters = htmlFilters;
     _common = item.Get<ICommonPart>();
     _titleAspect = item.Get<ITitleAspect>();
     _body = item.Get<BodyPart>();
 }
开发者ID:SunRobin2015,项目名称:RobinWithOrchard,代码行数:8,代码来源:ItemInspector.cs

示例12: getSprite

 public Sprite getSprite(Aspects.Secondary type, BodyPart bodyPart)
 {
     if (sprites.ContainsKey(type)) {
         return sprites[type][bodyPart];
     } else {
         Debug.Log("No sprites for player type " + type);
         return sprites[Aspects.Secondary.NONE][bodyPart];
     }
 }
开发者ID:MarjieVolk,项目名称:ShopTilYouDrop,代码行数:9,代码来源:PlayerSprites.cs

示例13: Given_body_part_is_in_list_when_AddBodyPart_then_body_part_is_not_duplicated

        public void Given_body_part_is_in_list_when_AddBodyPart_then_body_part_is_not_duplicated()
        {
            //given
            var bodyPart = new BodyPart() { Id = 3425, Description = "Finger nail" };

            var target = new AccidentRecord();

            target.AddBodyPartThatWasInjured(bodyPart, null);
            target.AddBodyPartThatWasInjured(bodyPart, null);

            Assert.AreEqual(1, target.AccidentRecordBodyParts.Count);
        }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:12,代码来源:AddBodyPartTests.cs

示例14: Given_body_part_list_is_empty_when_AddBodyPart_then_body_part_appears_in_list

        public void Given_body_part_list_is_empty_when_AddBodyPart_then_body_part_appears_in_list()
        {
            //given
            var bodyPart = new BodyPart() { Id = 3425, Description = "Toe nail" };

            var target = new AccidentRecord();

            target.AddBodyPartThatWasInjured(bodyPart, null);

            Assert.IsTrue(target.AccidentRecordBodyParts.Any(x => x.BodyPart.Id == bodyPart.Id));

            Assert.AreEqual(target, target.AccidentRecordBodyParts.First(x => x.BodyPart.Id == bodyPart.Id));
        }
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:13,代码来源:AddBodyPartTests.cs

示例15: Display

 protected override DriverResult Display(BodyPart part, string displayType, dynamic shapeHelper)
 {
     return Combined(
         ContentShape("Parts_Common_Body",
                      () => {
                          var bodyText = GetFallbackBodyText(part);
                          return shapeHelper.Parts_Common_Body(ContentPart: part, Html: new HtmlString(bodyText));
                      }),
         ContentShape("Parts_Common_Body_Summary",
                      () => {
                          var bodyText = GetBodyText(part);
                          return shapeHelper.Parts_Common_Body_Summary(ContentPart: part, Html: new HtmlString(bodyText));
                      })
         );
 }
开发者ID:frikihamster,项目名称:Apphub,代码行数:15,代码来源:CultureBodyPartDriver.cs


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