本文整理汇总了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;
}
示例2: setBodyParts
public void setBodyParts(BodyPart[] parts, Aspects.Secondary type)
{
foreach (BodyPart part in parts)
{
setBodyPart(part, type);
}
}
示例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;
}
示例4: ItemInspector
public ItemInspector(IContent item, ContentItemMetadata metadata) {
_item = item;
_metadata = metadata;
_common = item.Get<ICommonPart>();
_routable = item.Get<RoutePart>();
_body = item.Get<BodyPart>();
}
示例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
}
示例6: TargetingDummyElement
public TargetingDummyElement(string spriteName, BodyPart part, IResourceManager resourceManager)
{
_resourceManager = resourceManager;
BodyPart = part;
_elementSprite = _resourceManager.GetSprite(spriteName);
Update(0);
}
示例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);
}
}
示例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;
}
示例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;
}
示例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;
}
示例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>();
}
示例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];
}
}
示例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);
}
示例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));
}
示例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));
})
);
}