本文整理汇总了C#中System.Entity.FindChild方法的典型用法代码示例。如果您正苦于以下问题:C# Entity.FindChild方法的具体用法?C# Entity.FindChild怎么用?C# Entity.FindChild使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Entity
的用法示例。
在下文中一共展示了Entity.FindChild方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateYurei
/// <summary>
/// Create Yurei, the main character
/// </summary>
private void CreateYurei()
{
this.yurei = EntityManager.Find("yurei");
Entity starDust = yurei.FindChild("dust");
starDust.FindComponent<SpriteAtlasRenderer>().LayerType = typeof(ForegroundLayer);
yurei.AddComponent(new YureiBehavior(starDust));
Transform3D transform = yurei.FindComponent<Transform2D>().Transform3D;
transform.Position = new Vector3(500, this.VirtualScreenManager.BottomEdge - 152, 150);
transform.Scale = Vector3.One * 0.85f;
yurei.FindComponent<SkeletalRenderer>().LayerType = typeof(ForegroundLayer);
}
示例2: ConfigureHandAnchor
/// <summary>
/// Create a hand anchor
/// </summary>
/// <param name="root">The root entity.</param>
/// <param name="name">The name of the entity.</param>
/// <returns>the new entity.</returns>
private Entity ConfigureHandAnchor(Entity root, string name)
{
Entity anchor = root.FindChild(name);
if (anchor == null)
{
anchor = new Entity(name)
.AddComponent(new Transform3D())
.AddComponent(new HandRig());
root.AddChild(anchor);
}
return anchor;
}
示例3: Get_directions
protected void Get_directions(int Pos_x, int Pos_y, Entity Monsters_set)
{
if ((Tower_bullet.Bullet.Enabled) && (Tower_bullet.Bullet_bitmap.X != Pos_x || Tower_bullet.Bullet_bitmap.Y != Pos_y) && (Tower_target != ""))
{
var Monster_targeted = Monsters_set.FindChild(Tower_target);
int dif_x = (int)Tower_bullet.Bullet_bitmap.X - (int)Monster_targeted.FindComponent<Transform2D>().X;
int dif_y = (int)Tower_bullet.Bullet_bitmap.Y - (int)Monster_targeted.FindComponent<Transform2D>().Y;
Get_ammo_speed(dif_x, dif_y);
Static.Functions.get_Directions((int)dif_x, (int)dif_y, ref Tower_bullet.Bullet_dir_x, ref Tower_bullet.Bullet_dir_y);
Tower_bullet.Move_bullet(Tower_bitmap.X, Tower_bitmap.Y);
}
}
示例4: Get_Damage
public int Get_Damage(Mobs.Mob_Base Monster, Entity Monsters_set)
{
if (Tower_bullet.Bullet_access)
{
Tower_bullet.Bullet_speed_x = Tower_bullet.Bullet_speed_y = Tower_bullet.Bullet_speed;
if (Tower_target == "" || Monster.Mob.Name == Tower_target)
{
int Pos_x = (int)Monster.Mob.FindComponent<Transform2D>().X;
int Pos_y = (int)Monster.Mob.FindComponent<Transform2D>().Y;
if ((Check_Range(Pos_x, Pos_y)) &&
(!Tower_bullet.Bullet.Enabled)
&& (Tower_target == ""))
Get_values(Monster.Mob.Name);
Get_directions(Pos_x, Pos_y, Monsters_set);
if (Tower_target != "")
{
if (((Get_hit(Pos_x, Pos_y,
(int)Tower_bullet.Bullet_bitmap.X,
(int)Tower_bullet.Bullet_bitmap.Y)) &&
Tower_bullet.Bullet.Enabled)
|| (Monsters_set.FindChild(Tower_target).Enabled == false))
{
if (Monster.Mob.Name == Tower_target)
Monster.HP -= Tower_bullet.Bullet_damage;
Reset_values();
return Tower_bullet.Bullet_damage;
}
else
return 0;
}
}
}
return 0;
}
示例5: ConfigureTrackerAnchor
/// <summary>
/// Creates the OVR position tracker position
/// </summary>
/// <param name="root">The root entity</param>
/// <returns>The tracker anchor</returns>
private Entity ConfigureTrackerAnchor(Entity root)
{
Entity anchor = root.FindChild(trackerAnchorName);
if (anchor == null)
{
anchor = new Entity(trackerAnchorName)
.AddComponent(new Transform3D());
root.AddChild(anchor);
}
return anchor;
}
示例6: ConfigureEyeAnchor
/// <summary>
/// Creates an eye anchor
/// </summary>
/// <param name="root">The root entity</param>
/// <param name="eye">The eye type</param>
/// <returns>The eye anchor</returns>
private Entity ConfigureEyeAnchor(Entity root, VREyeType eye)
{
string eyeName = (eye == VREyeType.CenterEye) ? "Center" : (eye == VREyeType.LeftEye) ? "Left" : "Right";
string name = eyeName + eyeAnchorName;
Entity anchor = root.FindChild(name);
if (anchor == null)
{
anchor = new Entity(name)
.AddComponent(new Transform3D());
if (eye == VREyeType.CenterEye)
{
anchor.AddComponent(new SoundListener3D());
}
root.AddChild(anchor);
}
return anchor;
}