private void TryInitialize() { if (this.eIdleSpin != null && this.eIdleSpin.Cue != null && (!this.eIdleSpin.Cue.IsDisposed && this.eIdleSpin.Cue.State != SoundState.Stopped)) { this.eIdleSpin.Cue.Stop(false); } this.eIdleSpin = (SoundEmitter)null; this.rgbPlanes = (Mesh)null; this.particles = (PlaneParticleSystem)null; this.Phase = LesserWarp.Phases.None; this.sinceInitialized = 0.0f; this.GateAo = Enumerable.FirstOrDefault <ArtObjectInstance>((IEnumerable <ArtObjectInstance>) this.LevelManager.ArtObjects.Values, (Func <ArtObjectInstance, bool>)(x => x.ArtObject.ActorType == ActorType.LesserGate)); if (this.GateAo == null) { return; } this.InitializeRgbGate(); LesserWarp lesserWarp = this; Mesh mesh1 = new Mesh(); Mesh mesh2 = mesh1; DefaultEffect.Textured textured1 = new DefaultEffect.Textured(); textured1.Fullbright = true; DefaultEffect.Textured textured2 = textured1; mesh2.Effect = (BaseEffect)textured2; mesh1.DepthWrites = false; mesh1.Texture = (Dirtyable <Texture>)((Texture)this.WhiteTexture); mesh1.Rotation = Quaternion.CreateFromAxisAngle(Vector3.Right, -1.570796f); Mesh mesh3 = mesh1; lesserWarp.MaskMesh = mesh3; this.MaskMesh.AddFace(new Vector3(2f), Vector3.Zero, FaceOrientation.Front, true, true); this.MaskMesh.BakeTransformWithNormal <FezVertexPositionNormalTexture>(); this.MaskMesh.Position = this.GateAo.Position - Vector3.UnitY * 1.25f; this.HasCubeShard = Enumerable.Any <TrileInstance>((IEnumerable <TrileInstance>) this.LevelManager.Triles.Values, (Func <TrileInstance, bool>)(x => { if (ActorTypeExtensions.IsCubeShard(x.Trile.ActorSettings.Type)) { return((double)Vector3.Distance(x.Center, this.GateAo.Position) < 3.0); } else { return(false); } })); this.OriginalPosition = this.GateAo.Position; this.sRise = this.CMProvider.CurrentLevel.Load <SoundEffect>("Sounds/Zu/LesserWarpRise"); this.sLower = this.CMProvider.CurrentLevel.Load <SoundEffect>("Sounds/Zu/LesserWarpLower"); this.sActivate = this.CMProvider.CurrentLevel.Load <SoundEffect>("Sounds/Zu/WarpGateActivate"); this.eIdleSpin = SoundEffectExtensions.EmitAt(this.CMProvider.CurrentLevel.Load <SoundEffect>("Sounds/Zu/LesserWarpIdleSpin"), this.GateAo.Position, true, true); }