private void StartCrumbling() { SoundEffectExtensions.EmitAt(this.Host.sCrumble, this.OriginalCenter, RandomHelper.Centered(0.00999999977648258)); Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint); Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint); bool flag1 = (double)vector3_1.X != 0.0; bool flag2 = flag1; int num = flag2 ? (int)vector3_2.Z : (int)vector3_2.X; Point key = new Point(flag1 ? this.Instance.Emplacement.X : this.Instance.Emplacement.Z, this.Instance.Emplacement.Y); this.LevelManager.WaitForScreenInvalidation(); Limit limit; if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit)) { limit.End += num; TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X); while ((flag2 ? id.Z : id.X) != limit.End) { TrileInstance toRemove = this.LevelManager.TrileInstanceAt(ref id); if (toRemove != null && !toRemove.Hidden && toRemove.Trile.ActorSettings.Type == ActorType.Crumbler) { toRemove.Hidden = true; this.LevelMaterializer.CullInstanceOut(toRemove); this.InstancesToClear.Add(toRemove); ITrixelParticleSystems particleSystems = this.ParticleSystems; CrumblersHost.CrumblerState crumblerState = this; Game game = ServiceHelper.Game; TrixelParticleSystem.Settings settings = new TrixelParticleSystem.Settings() { BaseVelocity = Vector3.Zero, Energy = 0.1f, ParticleCount = (int)(20.0 / (double)this.InstancesToClear.Count), GravityModifier = 0.6f, Crumble = true, ExplodingInstance = toRemove }; TrixelParticleSystem trixelParticleSystem1; TrixelParticleSystem trixelParticleSystem2 = trixelParticleSystem1 = new TrixelParticleSystem(game, settings); crumblerState.System = trixelParticleSystem1; TrixelParticleSystem system = trixelParticleSystem2; particleSystems.Add(system); } if (flag2) { id.Z += num; } else { id.X += num; } } } Waiters.Wait(1.0, new Action(this.ClearTriles)).AutoPause = true; }
public TrixelParticleSystem(Game game, TrixelParticleSystem.Settings settings) : base(game) { this.settings = settings; this.DrawOrder = 10; this.PhysicsManager = ServiceHelper.Get<IPhysicsManager>(); this.CameraManager = ServiceHelper.Get<IGameCameraManager>(); this.GameState = ServiceHelper.Get<IGameStateManager>(); this.LightingPostProcess = ServiceHelper.Get<ILightingPostProcess>(); this.CollisionManager = ServiceHelper.Get<ICollisionManager>(); }
public TrixelParticleSystem(Game game, TrixelParticleSystem.Settings settings) : base(game) { this.settings = settings; this.DrawOrder = 10; this.PhysicsManager = ServiceHelper.Get <IPhysicsManager>(); this.CameraManager = ServiceHelper.Get <IGameCameraManager>(); this.GameState = ServiceHelper.Get <IGameStateManager>(); this.LightingPostProcess = ServiceHelper.Get <ILightingPostProcess>(); this.CollisionManager = ServiceHelper.Get <ICollisionManager>(); }
private void StartCrumbling() { SoundEffectExtensions.EmitAt(this.Host.sCrumble, this.OriginalCenter, RandomHelper.Centered(0.00999999977648258)); Vector3 vector3_1 = FezMath.SideMask(this.CameraManager.Viewpoint); Vector3 vector3_2 = FezMath.ForwardVector(this.CameraManager.Viewpoint); bool flag1 = (double) vector3_1.X != 0.0; bool flag2 = flag1; int num = flag2 ? (int) vector3_2.Z : (int) vector3_2.X; Point key = new Point(flag1 ? this.Instance.Emplacement.X : this.Instance.Emplacement.Z, this.Instance.Emplacement.Y); this.LevelManager.WaitForScreenInvalidation(); Limit limit; if (this.LevelManager.ScreenSpaceLimits.TryGetValue(key, out limit)) { limit.End += num; TrileEmplacement id = new TrileEmplacement(flag1 ? key.X : limit.Start, key.Y, flag2 ? limit.Start : key.X); while ((flag2 ? id.Z : id.X) != limit.End) { TrileInstance toRemove = this.LevelManager.TrileInstanceAt(ref id); if (toRemove != null && !toRemove.Hidden && toRemove.Trile.ActorSettings.Type == ActorType.Crumbler) { toRemove.Hidden = true; this.LevelMaterializer.CullInstanceOut(toRemove); this.InstancesToClear.Add(toRemove); ITrixelParticleSystems particleSystems = this.ParticleSystems; CrumblersHost.CrumblerState crumblerState = this; Game game = ServiceHelper.Game; TrixelParticleSystem.Settings settings = new TrixelParticleSystem.Settings() { BaseVelocity = Vector3.Zero, Energy = 0.1f, ParticleCount = (int) (20.0 / (double) this.InstancesToClear.Count), GravityModifier = 0.6f, Crumble = true, ExplodingInstance = toRemove }; TrixelParticleSystem trixelParticleSystem1; TrixelParticleSystem trixelParticleSystem2 = trixelParticleSystem1 = new TrixelParticleSystem(game, settings); crumblerState.System = trixelParticleSystem1; TrixelParticleSystem system = trixelParticleSystem2; particleSystems.Add(system); } if (flag2) id.Z += num; else id.X += num; } } Waiters.Wait(1.0, new Action(this.ClearTriles)).AutoPause = true; }