상속: Engine.Region
예제 #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;
            }

            AddTimer();

            UpdateParticlesForceCoefficient(0);
        }
예제 #2
0
 /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary>
 protected override void OnDestroy()
 {
     if (region != null)
     {
         region.SetShouldDelete();
         region = null;
     }
     base.OnDestroy();
 }
예제 #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())
            {
                //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();

            AddTimer();

            UpdateParticlesForceCoefficient();
        }
예제 #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() )
            {
                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;
            }

            AddTimer();

            UpdateParticlesForceCoefficient( 0 );
        }
예제 #5
0
 /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnDestroy()"/>.</summary>
 protected override void OnDestroy()
 {
     if( region != null )
     {
         region.SetShouldDelete();
         region = null;
     }
     base.OnDestroy();
 }
예제 #6
0
        /// <summary>Overridden from <see cref="Engine.EntitySystem.Entity.OnPostCreate(Boolean)"/>.</summary>
        protected override void OnPostCreate( bool loaded )
        {
            base.OnPostCreate( loaded );

            //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" ) );
            }

            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();

            AddTimer();

            UpdateParticlesForceCoefficient();
        }
예제 #7
0
파일: PhysicalStream.cs 프로젝트: Eneth/GAO
        /// <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();

            AddTimer();
        }