Exemple #1
0
            public GeyserState(TrileGroup group, GeysersHost host)
            {
                ServiceHelper.InjectServices((object)this);
                this.Host             = host;
                this.Group            = group;
                this.SinceStateChange = TimeSpan.FromSeconds(-(double)group.GeyserOffset);
                Vector3 position = Enumerable.Aggregate <TrileInstance, Vector3>((IEnumerable <TrileInstance>) this.Group.Triles, Vector3.Zero, (Func <Vector3, TrileInstance, Vector3>)((a, b) => a + b.Center)) / (float)group.Triles.Count;
                int     key1     = IdentifierPool.FirstAvailable <BackgroundPlane>(this.LevelManager.BackgroundPlanes);

                this.TopPlane = new BackgroundPlane(this.LevelMaterializer.AnimatedPlanesMesh, "sewer/sewer_geyser_top", true)
                {
                    Id             = key1,
                    Position       = position,
                    YTextureRepeat = true,
                    Crosshatch     = true,
                    Doublesided    = true
                };
                this.LevelManager.BackgroundPlanes.Add(key1, this.TopPlane);
                int key2 = IdentifierPool.FirstAvailable <BackgroundPlane>(this.LevelManager.BackgroundPlanes);

                this.TilePlane = new BackgroundPlane(this.LevelMaterializer.AnimatedPlanesMesh, "sewer/sewer_geyser_tile", true)
                {
                    Id             = key2,
                    Position       = position,
                    YTextureRepeat = true,
                    Billboard      = true
                };
                this.LevelManager.BackgroundPlanes.Add(key2, this.TilePlane);
                this.TopPlane.Timing.Step = this.TilePlane.Timing.Step;
                this.loopEmitter          = SoundEffectExtensions.EmitAt(this.Host.LoopSound, position, true, 0.0f, 0.0f);
                foreach (TrileInstance trileInstance in group.Triles)
                {
                    trileInstance.PhysicsState.IgnoreCollision    = true;
                    trileInstance.PhysicsState.IgnoreClampToWater = true;
                }
            }
Exemple #2
0
 public GeyserState(TrileGroup group, GeysersHost host)
 {
   ServiceHelper.InjectServices((object) this);
   this.Host = host;
   this.Group = group;
   this.SinceStateChange = TimeSpan.FromSeconds(-(double) group.GeyserOffset);
   Vector3 position = Enumerable.Aggregate<TrileInstance, Vector3>((IEnumerable<TrileInstance>) this.Group.Triles, Vector3.Zero, (Func<Vector3, TrileInstance, Vector3>) ((a, b) => a + b.Center)) / (float) group.Triles.Count;
   int key1 = IdentifierPool.FirstAvailable<BackgroundPlane>(this.LevelManager.BackgroundPlanes);
   this.TopPlane = new BackgroundPlane(this.LevelMaterializer.AnimatedPlanesMesh, "sewer/sewer_geyser_top", true)
   {
     Id = key1,
     Position = position,
     YTextureRepeat = true,
     Crosshatch = true,
     Doublesided = true
   };
   this.LevelManager.BackgroundPlanes.Add(key1, this.TopPlane);
   int key2 = IdentifierPool.FirstAvailable<BackgroundPlane>(this.LevelManager.BackgroundPlanes);
   this.TilePlane = new BackgroundPlane(this.LevelMaterializer.AnimatedPlanesMesh, "sewer/sewer_geyser_tile", true)
   {
     Id = key2,
     Position = position,
     YTextureRepeat = true,
     Billboard = true
   };
   this.LevelManager.BackgroundPlanes.Add(key2, this.TilePlane);
   this.TopPlane.Timing.Step = this.TilePlane.Timing.Step;
   this.loopEmitter = SoundEffectExtensions.EmitAt(this.Host.LoopSound, position, true, 0.0f, 0.0f);
   foreach (TrileInstance trileInstance in group.Triles)
   {
     trileInstance.PhysicsState.IgnoreCollision = true;
     trileInstance.PhysicsState.IgnoreClampToWater = true;
   }
 }