public IHighscores GetHighscores() { if (_highscores == null) { _highscores = new Highscores(); LoadHighscoresFromPlayerPrefs(); } return(_highscores); }
void SetScores(IHighscores scoreDatas) { if (scorePanelsNumber > scoreDatas.Count) { // it should has more scorepanels to be displayed than the score data tables count Debug.LogError("something weird is happenned in ScorePanels"); } for (int i = 0; i < scorePanelsNumber; i++) { SetScore(i, scoreDatas[i]); } }
/// <summary> /// Initializes a new instance of the <see cref="CanyonShooterGame"/> class. /// </summary> public CanyonShooterGame(string[] args) { Args = new Arguments(args); states = new GameStates(this, Components); config = new Config(); graphicsDeviceManager = new GraphicsDeviceManager(this); content = new ContentManager(Services); graphics = new Graphics(this, graphicsDeviceManager); this.Window.Title = " CanyonShooter"; Intercom.Game = this; #region Commandline Parameter Settings: #region Parameter: --setShaderModel if (Args["setShaderModel"] == "2") { graphics.ShaderModel3SupportedOverride = true; } #endregion #region Parameter: --debug if (Args["debug"] == "1") { debugMode = true; } #endregion #region Parameter: --multiThreaded // Physik Intialisierung /*if (Args["multiThreaded"] != null) * { * if(Args["multiThreaded"] == "1") * physics = new Physics(this, true); * else * { * physics = new Physics(this, false); * Components.Add(physics); * } * } * else*/// automatically set threading-mode { /*if (Environment.ProcessorCount > 1) * { * physics = new Physics(this, true); * } * else*/ { physics = new Physics(this, false); Components.Add(physics); } } #endregion #region Parameter: --testAudio // Test Audio Framework ******************************* if (Args["testAudio"] == "1") { TestAudioPlayback test1 = new TestAudioPlayback(); test1.SetUp(this); test1.TestMinigunPlayback(); test1.TearDown(); TestAudio3D test2 = new TestAudio3D(); test2.SetUp(this); test2.TestPlayback3D(); test2.TearDown(); } #endregion #endregion // Create sound system by M.Rodriguez sounds = new SoundSystem(this); // Set global volumes by M.Rodriguez sounds.EffectVolume = 1.0f; sounds.MusicVolume = 0.3f; // Initialisieren der einzelnen Komponenten: input = new Input(this); renderer = new Renderer(this, Components); effects = new EffectFactory(this); highscores = new Highscores(this); GraphicalConsole.GetSingleton(this).RegisterObjectProperty(graphics, "Graphics", "Fullscreen"); GraphicalConsole.GetSingleton(this).RegisterObjectProperty(renderer, "Renderer", "DrawCollisionShapes"); GraphicalConsole.GetSingleton(this).RegisterObjectFunction(Args, "Args", "ListParameters"); if (Args["enable3DMouse"] == "1") { hasSpaceMouse = true; device = new TDxInput.Device(); } states.SetStateStart(); // states.SetStateDebugMode(); }