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