Пример #1
0
        private void OnEngineStart(object sender, System.EventArgs e)
        {
            this._timeRuler = new TimeRuler(this) { Visible = true, ShowLog = true };
            this.Components.Add(this._timeRuler);

        #if XNA
            this._bloomComponent = new BloomComponent(this);
            this.Components.Add(this._bloomComponent);
        #endif
        }
Пример #2
0
        public override void Initialize()
        {
            Logger.Trace("init()");

            // import required services.
            this._chunkStorage = (IChunkStorage) this.Game.Services.GetService(typeof (IChunkStorage));
            this._camera = (ICamera) this.Game.Services.GetService(typeof (ICamera));
            this._player = (IPlayer) this.Game.Services.GetService(typeof (IPlayer));
            this._fogger = (IFogger) this.Game.Services.GetService(typeof (IFogger));
            this.VertexBuilder = (IVertexBuilder) this.Game.Services.GetService(typeof (IVertexBuilder));            
            this._timeRuler = (TimeRuler) this.Game.Services.GetService(typeof (TimeRuler));

            this._assetManager = (IAssetManager)this.Game.Services.GetService(typeof(IAssetManager));
            if (this._assetManager == null)
                throw new NullReferenceException("Can not find asset manager component.");

            this.Generator = new BiomedTerrain(new RainForest());
            base.Initialize();
        }