Exemplo n.º 1
0
        /// <summary>
        /// Initializes this instance.
        /// </summary>
        /// <param name="game">The game.</param>
        public void Initialize(SampleWPFProject.Game game)
        {
            this.game  = game;
            this.scene = WaveServices.ScreenContextManager.CurrentContext[0] as MyScene;

            this.EarthRadius       = this.scene.Earth.FindComponent <Transform3D>().Scale.X;
            this.EarthDayLength    = this.scene.Earth.FindComponent <OrbitBehavior>().DayTime;
            this.MoonRadius        = this.scene.Moon.FindComponent <Transform3D>().Scale.X;
            this.MoonDayLength     = this.scene.Moon.FindComponent <OrbitBehavior>().DayTime;
            this.MoonOrbitLength   = this.scene.Moon.FindComponent <OrbitBehavior>().YearTime;
            this.MoonOrbitRadius   = this.scene.Moon.FindComponent <OrbitBehavior>().Radius;
            this.SunLightIntensity = this.scene.Sun.Color.R / 255f;
            this.SunFlareRadius    = this.scene.Sun.LensFlare.Scale;
        }
Exemplo n.º 2
0
 /// <summary>
 /// Called when [game loaded].
 /// </summary>
 /// <param name="sender">The sender.</param>
 /// <param name="game">The game.</param>
 private void OnGameLoaded(object sender, Game game)
 {
     var viewModel = this.DataContext as SolarSystemViewModel;
     viewModel.Initialize(game);
 }