void Start() { this.Register <PlaySoundMessage>(); this.Register <UpdateAudioSettingsMessage>(); var p = PlayerManager.Load(); _canPlaySounds = p.IsSoundEnabled; }
void Start() { this.Register <UpdateAudioSettingsMessage>(); var p = PlayerManager.Load(); _canPlayMusic = p.IsMusicEnabled; // so it won't only play first song evey time level starts _lastSong = -1; DontDestroyOnLoad(gameObject); if (!AlreadyExists()) { PlayNewSong(); } }
void Start() { // Add a few platforms in to start Enumerable.Range(0, 5).Each(x => Enumerable.Range(0, 3).Each(n => AddPlatform(Random.Range(x * 6 - 15, x * 6 - 10)))); _startTime = Time.fixedTime; this.Register <EarnMoneyMessage>(); this.Register <PlayerDiedMessage>(); var p = PlayerManager.Load(); PlayerContext.Setup(p.UpgradeLevels); Player = (GameObject)Instantiate(Resources.Load("Prefabs/Player")); }