Пример #1
0
    private void Init()
    {
        model        = menuModelObject.GetComponent <SC_MenuModel>();
        objects      = model.GetObjects();
        audioManager = audioManagerObject.GetComponent <SC_AudioManager>();
        scenes       = new List <GameObject>();

        foreach (KeyValuePair <string, GameObject> obj in objects)
        {
            if (obj.Value.name.Contains(SC_MenuModel.SCENE_PREFIX))
            {
                scenes.Add(obj.Value);
            }

            if (obj.Value.name.StartsWith(SC_MenuModel.SCENE_PREFIX) && !(obj.Value.name.Contains(SharedDataHandler.nextScreenRequested)))
            {
                obj.Value.SetActive(false);
            }
        }

        InitGameObjectInitialStates();
        AddRoomEvents();

        audioManager.Play(SC_MenuModel.BG_MUSIC_MENU_VAR_NAME);
    }
Пример #2
0
    private void PlayShuffleSound()
    {
        float MAX_SHUFFLE_SFX_PITCH  = 3f;
        float BASE_SHUFFLE_SFX_PITCH = 1f;
        float PITCH_INC_VALUE        = .1f;

        audioManager.Play(SC_GameModel.SHUFFLE_VAR_NAME);
        AudioSource source = audioManager.sounds.Find(sound => sound.name == SC_GameModel.SHUFFLE_VAR_NAME);

        if (source.pitch >= MAX_SHUFFLE_SFX_PITCH)
        {
            source.pitch = BASE_SHUFFLE_SFX_PITCH;
        }
        else
        {
            source.pitch += PITCH_INC_VALUE;
        }
    }
Пример #3
0
    private void Init()
    {
        audioManager = audioManagerObject.GetComponent <SC_AudioManager>();
        HidePreviewSoldier();
        countdownManager.SetActive(true);
        shuffleHandler.SetActive(true);
        isMyTurn = SharedDataHandler.isPlayerStarting;

        //audioManager.sounds.Find(sound => sound.name == SC_GameModel.BG_MUSIC_GAMEPLAY_VAR_NAME).volume = SharedDataHandler.globalBgmVolume;
        InitSoundValues();
        audioManager.Play(SC_GameModel.BG_MUSIC_GAMEPLAY_VAR_NAME);
    }