本文整理汇总了C#中BodyPart类的典型用法代码示例。如果您正苦于以下问题:C# BodyPart类的具体用法?C# BodyPart怎么用?C# BodyPart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BodyPart类属于命名空间,在下文中一共展示了BodyPart类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: GetFallbackBodyText
private string GetFallbackBodyText(BodyPart part)
{
var locPart = part.ContentItem.Parts.OfType<LocalizationPart>().SingleOrDefault();
if(locPart!=null) {
var currentCulture = locPart.Culture.Culture;//_services.WorkContext.CurrentCulture;
var siteCulture = _cutureManager.GetSiteCulture();
var partText = GetBodyText(part);
if (string.IsNullOrWhiteSpace(partText) && siteCulture != currentCulture) {
var master = locPart.MasterContentItem.ContentItem.Parts.OfType<BodyPart>().SingleOrDefault();
return GetBodyText(master);
}
}
return GetBodyText(part);
}
开发者ID:frikihamster,项目名称:Apphub,代码行数:17,代码来源:CultureBodyPartDriver.cs
示例17: Given_bodypart_is_not_in_list_when_RemoveInjury_then_Injury_list_remains_the_same
public void Given_bodypart_is_not_in_list_when_RemoveInjury_then_Injury_list_remains_the_same()
{
//given
var bodypart = new BodyPart() { Id = 3425, Description = "Anterior cruciate ligament" };
var bodypart2 = new BodyPart() { Id = 123124, Description = "Hip flexior" };
var target = new AccidentRecord();
target.AddBodyPartThatWasInjured(bodypart, null);
target.AddBodyPartThatWasInjured(bodypart2, null);
//when
target.RemoveBodyPartThatWasInjured(new BodyPart() { Id = 124314, Description = "Test" }, null);
Assert.AreEqual(2, target.AccidentRecordBodyParts.Count);
}
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:17,代码来源:RemoveBodyPartTests.cs
示例18: Given_bodypart_is_in_list_when_RemoveInjury_then_Injury_removed_from_list
public void Given_bodypart_is_in_list_when_RemoveInjury_then_Injury_removed_from_list()
{
//given
var bodypart = new BodyPart() { Id = 3425, Description = "Anterior cruciate ligament", Deleted = false};
var bodypart2 = new BodyPart() { Id = 123124, Description = "Hip flexior", Deleted = false };
var target = new AccidentRecord();
target.AddBodyPartThatWasInjured(bodypart, null);
target.AddBodyPartThatWasInjured(bodypart2, null);
//when
target.RemoveBodyPartThatWasInjured(bodypart2, null);
Assert.AreEqual(1, target.AccidentRecordBodyParts.Count);
Assert.IsTrue(target.AccidentRecordBodyParts.All(x => x.BodyPart.Id != bodypart2.Id));
}
开发者ID:mnasif786,项目名称:Business-Safe,代码行数:17,代码来源:RemoveBodyPartTests.cs
示例19: FindLimbTip
/*
* Find the tip for a limb using the supplied info
* */
public static BodyPart FindLimbTip(BodyPart tipParent, Component[] hierarchy, string tipName)
{
// if the tip parent is null, early out
if (tipParent==null) return null;
// the part that will be returned
BodyPart ret = null;
// if there is more than one child, find the middle digit using the naming convention
if (tipParent.bone.childCount>1)
{
// search for children with the matching name
ArrayList children = new ArrayList();
int matches = 0;
foreach (Transform child in tipParent.bone)
{
children.Add(child.name);
if (child.name.Contains(tipName)) matches++;
}
if (matches==1)
{
foreach (Transform child in tipParent.bone)
{
if (child.name.Length<tipName.Length || ret!=null) continue;
if (child.name.Substring(0, tipName.Length) == tipName)
ret = BipedHelpers.AddPartByName(child.name, hierarchy);
}
}
// if no match was found, this may be a Max Biped, in which case the digits are numbered
if (ret==null)
{
Transform tip = TransformHelpers.GetTransformInHierarchy(hierarchy, tipName+(tipParent.bone.childCount/2).ToString());
if (tip!=null) ret = BipedHelpers.AddPartByName(tip.name, hierarchy);
}
}
// couldn't find the middle digit, so pick the first child
if (ret==null && tipParent.bone.childCount>0)
{
ret = BipedHelpers.AddPartByName(tipParent.bone.GetChild(0).name, hierarchy);
}
return ret;
}
开发者ID:hyper-active,项目名称:virtual-reality,代码行数:48,代码来源:BipedHelpers.cs
示例20: MakeRound
public void MakeRound(BodyPart attackPoint, BodyPart blockPoint)
{
if (human.Hp <= 0 || npc.Hp <= 0)
{
return;
}
human.AttackPoint = attackPoint;
human.BlockPoint = blockPoint;
npc.AttackPoint = GenRandPart();
npc.BlockPoint = GenRandPart();
human.GetHit(npc.AttackPoint, npc.Name);
npc.GetHit(human.AttackPoint, human.Name);
if (human.Hp <= 0 && npc.Hp <= 0)
{
if (Draw != null)
{
Draw(human, npc.Name);
}
}
else if (human.Hp <= 0)
{
if (Dead != null)
{
Dead(human, npc.Name);
}
if (Lose != null)
{
Lose(human, npc.Name);
}
}
else if (npc.Hp <= 0)
{
if (Dead != null)
{
Dead(npc, human.Name);
}
if (Win != null)
{
Win(human, npc.Name);
}
}
}
开发者ID:MadNomad,项目名称:solutions,代码行数:45,代码来源:Battle.cs
注:本文中的BodyPart类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论