Beispiel #1
0
        private void InitBitPlanes()
        {
            if (this.lastBits == this.GameState.SaveData.CubeShards + this.GameState.SaveData.SecretCubes)
            {
                return;
            }
            foreach (BackgroundPlane plane in this.BitPlanes)
            {
                this.LevelManager.RemovePlane(plane);
            }
            this.BitPlanes.Clear();
            if (this.AoInstance.Rotation == new Quaternion(0.0f, 0.0f, 0.0f, -1f))
            {
                this.AoInstance.Rotation = Quaternion.Identity;
            }
            int bitCount = ActorTypeExtensions.GetBitCount(this.AoInstance.ArtObject.ActorType);

            for (int index = 0; index < bitCount; ++index)
            {
                BackgroundPlane plane = new BackgroundPlane(this.LevelMaterializer.StaticPlanesMesh, index < this.GameState.SaveData.CubeShards ? (Texture)this.BitTexture : (Texture)this.AntiBitTexture)
                {
                    Rotation   = this.AoInstance.Rotation,
                    Opacity    = 0.0f,
                    Fullbright = true
                };
                this.BitPlanes.Add(plane);
                this.LevelManager.AddPlane(plane);
            }
            this.lastBits = this.GameState.SaveData.CubeShards + this.GameState.SaveData.SecretCubes;
        }
Beispiel #2
0
 public void Update(TimeSpan elapsed)
 {
     this.DetermineIsClose();
     if (this.AoInstance.ActorSettings.Inactive)
     {
         return;
     }
     if (!this.opening && !this.close && this.sinceClose.TotalSeconds > 0.0)
     {
         this.sinceClose -= elapsed;
     }
     else if (this.close && this.sinceClose.TotalSeconds < 3.0)
     {
         this.sinceClose += elapsed;
     }
     this.FadeBits();
     if (this.GameState.SaveData.CubeShards + this.GameState.SaveData.SecretCubes < ActorTypeExtensions.GetBitCount(this.AoInstance.ArtObject.ActorType) || this.sinceClose.TotalSeconds <= 0.5)
     {
         return;
     }
     this.OpenDoor(elapsed);
 }