Ejemplo n.º 1
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate(bool loaded)
        {
            base.OnPostCreate(loaded);

            if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle())
            {
                const string        regionTypeName = "ManualInfluenceRegion";
                InfluenceRegionType regionType     = (InfluenceRegionType)EntityTypes.Instance.GetByName(
                    regionTypeName);
                if (regionType == null)
                {
                    regionType = (InfluenceRegionType)EntityTypes.Instance.ManualCreateType(
                        regionTypeName,
                        EntityTypes.Instance.GetClassInfoByEntityClassName("InfluenceRegion"));
                    regionType.NetworkType = EntityNetworkTypes.ServerOnly;
                }

                region                  = (InfluenceRegion)Entities.Instance.Create(regionType, Map.Instance);
                region.ShapeType        = Region.ShapeTypes.Capsule;
                region.DistanceFunction = InfluenceRegion.DistanceFunctionType.NormalFadeAxisX;

                region.SetTransform(Position, Rotation, InfluenceRegionScale);
                region.PostCreate();
                region.AllowSave        = false;
                region.EditorSelectable = false;

                bladesMotor = PhysicsModel.GetMotor("bladesMotor") as GearedMotor;
            }

            SubscribeToTickEvent();
        }
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate(bool loaded)
        {
            base.OnPostCreate(loaded);

            if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle())
            {
                //region
                const string regionTypeName = "ManualInfluenceRegion";

                InfluenceRegionType regionType = (InfluenceRegionType)EntityTypes.Instance.GetByName(
                    regionTypeName);
                if (regionType == null)
                {
                    regionType = (InfluenceRegionType)EntityTypes.Instance.ManualCreateType(
                        regionTypeName,
                        EntityTypes.Instance.GetClassInfoByEntityClassName("InfluenceRegion"));
                    regionType.NetworkType = EntityNetworkTypes.ServerOnly;
                }

                if (Type.Thickness != 0 && Type.Length != 0)
                {
                    region           = (InfluenceRegion)Entities.Instance.Create(regionType, Map.Instance);
                    region.ShapeType = Region.ShapeTypes.Box;
                    UpdateTransform();
                    region.PostCreate();
                    region.AllowSave        = false;
                    region.EditorSelectable = false;
                }
            }

            UpdateMode();

            SubscribeToTickEvent();
        }
Ejemplo n.º 3
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate(bool loaded)
        {
            base.OnPostCreate(loaded);

            if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle())
            {
                const string regionTypeName = "ManualInfluenceRegion";
                InfluenceRegionType regionType = (InfluenceRegionType)EntityTypes.Instance.GetByName(
                    regionTypeName);
                if (regionType == null)
                {
                    regionType = (InfluenceRegionType)EntityTypes.Instance.ManualCreateType(
                        regionTypeName,
                        EntityTypes.Instance.GetClassInfoByEntityClassName("InfluenceRegion"));
                    regionType.NetworkType = EntityNetworkTypes.ServerOnly;
                }

                region = (InfluenceRegion)Entities.Instance.Create(regionType, Map.Instance);
                region.ShapeType = Region.ShapeTypes.Capsule;
                region.DistanceFunction = InfluenceRegion.DistanceFunctionType.NormalFadeAxisX;

                region.SetTransform(Position, Rotation, InfluenceRegionScale);
                region.PostCreate();
                region.AllowSave = false;
                region.EditorSelectable = false;

                bladesMotor = PhysicsModel.GetMotor("bladesMotor") as GearedMotor;
            }

            SubscribeToTickEvent();
        }
Ejemplo n.º 4
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate(bool loaded)
        {
            base.OnPostCreate(loaded);

            if (EntitySystemWorld.Instance.IsServer() || EntitySystemWorld.Instance.IsSingle())
            {
                //region
                const string regionTypeName = "ManualInfluenceRegion";

                InfluenceRegionType regionType = (InfluenceRegionType)EntityTypes.Instance.GetByName(
                    regionTypeName);
                if (regionType == null)
                {
                    regionType = (InfluenceRegionType)EntityTypes.Instance.ManualCreateType(
                        regionTypeName,
                        EntityTypes.Instance.GetClassInfoByEntityClassName("InfluenceRegion"));
                    regionType.NetworkType = EntityNetworkTypes.ServerOnly;
                }

                if (Type.Thickness != 0 && Type.Length != 0)
                {
                    region = (InfluenceRegion)Entities.Instance.Create(regionType, Map.Instance);
                    region.ShapeType = Region.ShapeTypes.Box;
                    UpdateTransform();
                    region.PostCreate();
                    region.AllowSave = false;
                    region.EditorSelectable = false;
                }
            }

            UpdateMode();

            SubscribeToTickEvent();
        }