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


C# Entity.FindChild方法代码示例

本文整理汇总了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);
        }
开发者ID:julietsvq,项目名称:Samples,代码行数:18,代码来源:MyScene.cs

示例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;
        }
开发者ID:WaveEngine,项目名称:Extensions,代码行数:21,代码来源:LeapMotionRig.cs

示例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);
            }
        }
开发者ID:edzio94,项目名称:Tower-Defense,代码行数:16,代码来源:Towers_Classes.cs

示例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;
        }
开发者ID:edzio94,项目名称:Tower-Defense,代码行数:38,代码来源:Towers_Classes.cs

示例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;
        }
开发者ID:WaveEngine,项目名称:Components,代码行数:19,代码来源:VRCameraRig.cs

示例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;
        }
开发者ID:WaveEngine,项目名称:Components,代码行数:28,代码来源:VRCameraRig.cs


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