Exemple #1
0
        public override void Initialize()
        {
            AFAssetManager.SetDirectoryOwner("QuebraCuca");

            m_stateManager = AFObject.Create <AFStateManager>();

            m_stateManager.Initialize(new GameStateFactory());

            _resolutionController = ResolutionController.Instance();
            _paths  = PathConstants.Instance();
            _sounds = SoundConstants.Instance();

            GameObject _soundManager = new GameObject();

            _soundManager.name = "SoundManager";
            _soundManager.AddComponent <SoundManager>().Init();
            //SoundManager.PlaySoundByName(SoundConstants.BG_SOUND);

            AFSingleTransition tras = AFObject.Create <AFSingleTransition>();
            SpriteRenderer     sr   = tras.gameObject.AddComponent <SpriteRenderer>();

            sr.transform.position   = new Vector3(0, 0, 6);
            sr.sprite               = AFAssetManager.Instance.CreateSpriteFromTexture("Common/High/loadingscreen");
            sr.transform.localScale = new Vector3(1, 1, 1);
            m_stateManager.AddTransition(tras);

            m_stateManager.GotoState(AState.EGameState.MENU);

            base.Initialize();
        }
        public override void ClientInitialize()
        {
            if (!Api.IsEditor)
            {
                // force master server connection in non-game mode (in non-Editor only)
                Api.Client.MasterServer.Connect();
            }

            Api.Client.Scene
            .CreateSceneObject("Update helper")
            .AddComponent <ClientComponentUpdateHelper>();

            Client.Core.SetLoadingSplashScreenManager(LoadingSplashScreenManager.Instance);

            Client.CurrentGame.ConnectionStateChanged      += RefreshCurrentGameServerConnectionState;
            Client.CurrentGame.ConnectingFailed            += GameServerLoginFailedDialogHelper.ShowDialog;
            Client.CurrentGame.ConnectingFailedModsMissing += GameServerConnectingFailedModsMissingHandler;
            RefreshCurrentGameServerConnectionState();

            Client.Core.IsCompilingChanged         += RefreshCompilingState;
            Client.Core.IsCompilationFailedChanged += RefreshCompilationFailedState;
            RefreshCompilingState();
            RefreshCompilationFailedState();

            Client.MasterServer.LoggedInStateChanged   += RefreshLoggedInState;
            Client.MasterServer.LoginFailed            += MasterServerLoginFailedHandler;
            Client.MasterServer.ConnectingFailed       += MasterServerConnectingFailedHandler;
            Client.MasterServer.ConnectionStateChanged += RefreshMasterServerConnectionState;
            Client.SteamApi.StateChanged += SteamServiceStateChanged;

            RefreshLoggedInState();

            if (Client.MasterServer.LastLoginErrorCode.HasValue)
            {
                MasterServerLoginFailedHandler(Client.MasterServer.LastLoginErrorCode.Value);
            }

            RefreshMasterServerConnectionState();

            MainMenuMusicHelper.Init();
            GameplayMusicHelper.Init();
            ClientComponentCameraScreenShakes.Init();

            SoundConstants.ApplyConstants();
        }
 private void handleScoreChanged(int points, SoundConstants.Sfx sound, LightingConstants.Lfx lightEffect)
 {
     if (points > 0)
         GameManager.getInstance().AddScore(points);
     if (sound != SoundConstants.Sfx.None)
         SoundManager.PlaySfx(sound);
     if (lightEffect != LightingConstants.Lfx.None)
         LightManager.PlaySequence(lightEffect);
 }
Exemple #4
0
 internal static void PlaySfx(SoundConstants.Sfx sound)
 {
     getInstance().playSfx(sound);
 }
Exemple #5
0
 internal static void PlayMusic(SoundConstants.Music music, bool repeat)
 {
     getInstance().playMusic(music, repeat);
 }
Exemple #6
0
 public MusicPlayListItem(SoundConstants.Music music, bool repeat)
 {
     Music = music; Repeat = repeat;
 }
Exemple #7
0
 private void playSfx(SoundConstants.Sfx sound)
 {
     _soundDriver.PlaySfx((int)sound);
 }
Exemple #8
0
 private void playMusic(SoundConstants.Music music, bool repeat)
 {
     _log.Debug("Sound Manager Enqueueing Music: " + music.ToString());
     _musicQueue.Enqueue(new MusicPlayListItem(music, repeat));
 }