private void Start()
    {
        // Create an instance of the sound to be played
        SFXVolumeTestEvent = RuntimeManager.CreateInstance(testSFX);

        // Establish the buses to be loaded and managed
        mainBus  = RuntimeManager.GetBus("bus:/Main");
        musicBus = RuntimeManager.GetBus("bus:/Main/Music");
        sfxBus   = RuntimeManager.GetBus("bus:/Main/SFX");

        // Check player prefs, if there is a value for each take it, if not make it
        if (PlayerPrefs.HasKey(mainVolumePrefString))
        {
            mainVolume = PlayerPrefs.GetFloat(mainVolumePrefString);
        }

        if (PlayerPrefs.HasKey(musicVolumePrefString))
        {
            musicVolume = PlayerPrefs.GetFloat(musicVolumePrefString);
        }

        if (PlayerPrefs.HasKey(sfxVolumePrefString))
        {
            sfxVolume = PlayerPrefs.GetFloat(sfxVolumePrefString);
        }

        // reset the oldValues
        oldMainVolume = mainVolume;
        oldSfxVolume  = sfxVolume;
    }
Exemple #2
0
 /// <summary>
 /// Constructs a new instance of <see cref="FModMultiSounds"/>. Used to register FMOD events with multiple sounds in one event.
 /// </summary>
 /// <param name="soundPaths">The sound paths to register for this object. Paths must be relative to the base game folder.</param>
 /// <param name="mode">The mode to set the clips to. Cannot be <c>MODE.LOOP_NORMAL</c> or <c>MODE.LOOP_BIDI</c>.</param>
 /// <param name="busPath"><see cref="Bus"/> path to play these sounds under.</param>
 /// <param name="randomizeSounds">Makes the sounds play in a randomized order. when <c>false</c>, sounds will play subsequently.</param>
 public FModMultiSounds(string[] soundPaths, MODE mode, string busPath, bool randomizeSounds = false)
 {
     mode   &= ~MODE.LOOP_NORMAL & ~MODE.LOOP_BIDI; // Remove unsupported modes
     _sounds = AudioUtils.CreateSounds(soundPaths, mode).ToArray();
     _bus    = RuntimeManager.GetBus(busPath);
     this.randomizeSounds = randomizeSounds;
 }
Exemple #3
0
 private void Awake()
 {
     //QualitySettings.SetQualityLevel(5);
     if (Application.isEditor == false)
     {
         if (PlayerPrefs.GetInt("FirstGame") == 0)
         {
             PlayerPrefs.DeleteAll();
             PlayerPrefs.SetInt("FirstGame", 1);
             PlayerPrefs.SetFloat("MusicVolume", 1f);
             PlayerPrefs.SetFloat("SoundsVolume", 1f);
             PlayerPrefs.SetInt("isMute", 0); //sona musica
             if (Screen.fullScreen)
             {
                 PlayerPrefs.SetInt("ScreenMode", 0); //full screen
             }
             else if (!Screen.fullScreen)
             {
                 PlayerPrefs.SetInt("ScreenMode", 1);
             }
             PlayerPrefs.SetInt("Tutorial", 0); //0 = si
             tutorialMenu.SetActive(true);
             showIt = true;
             PlayerPrefs.SetInt("Vibration", 1); // 0 = sí
         }
     }
     Music  = RuntimeManager.GetBus("bus:/Master/Music");
     Sounds = RuntimeManager.GetBus("bus:/Master/Sounds");
     Master = RuntimeManager.GetBus("bus:/Master");
     if (!musicStarted)
     {
         backgroudMusic = RuntimeManager.CreateInstance("event:/BipedSeek/Music/Menu");
     }
 }
Exemple #4
0
 private void Start()
 {
     FMOD.Studio.Bus ambience = RuntimeManager.GetBus("bus:/Master/Sounds/Ambience");
     FMOD.Studio.Bus sfx      = RuntimeManager.GetBus("bus:/Master/Sounds/SFX");
     ambience.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
     sfx.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }
    private void Awake()
    {
        #region Singleton

        if (Instance != null)
        {
            Debug.Log($"AudioManager instance already exists. Deleting {this}");
            Destroy(gameObject);
            return;
        }
        else
        {
            Instance = this;
        }
        #endregion

        //DontDestroyOnLoad(this);

        masterBus  = RuntimeManager.GetBus("bus:/Master");
        musicBus   = RuntimeManager.GetBus("bus:/Master/Music");
        effectsBus = RuntimeManager.GetBus("bus:/Master/Effects");

        masterBus.setVolume(storedSettings.MasterVolume);
        musicBus.setVolume(storedSettings.MusicVolume);
        effectsBus.setVolume(storedSettings.EffectsVolume);
    }
Exemple #6
0
 private void Awake()
 {
     Instance = this;
     MuteButton.onClick.AddListener(ToggleHandle);
     SceneManager.activeSceneChanged += SceneManager_activeSceneChanged;
     _musicBus = RuntimeManager.GetBus("bus:/Master");
 }
Exemple #7
0
 private void Awake()
 {
     //볼륨에 대한 Bus를 가져옵니다.
     MasterBus = RuntimeManager.GetBus("bus:/Master");
     BgmBus    = RuntimeManager.GetBus("bus:/Master/BGM");
     SfxBus    = RuntimeManager.GetBus("bus:/Master/SFX");
 }
    public void UnMuteCommonSounds()
    {
        string busString = "Bus:/UsualSounds";

        FMOD.Studio.Bus bus;
        bus = RuntimeManager.GetBus(busString);
        bus.setFaderLevel(1.0f);
    }
Exemple #9
0
 void Awake()
 {
     Music           = RuntimeManager.GetBus("bus:/Master/Music");
     SFX             = RuntimeManager.GetBus("bus:/Master/SFX");
     Master          = RuntimeManager.GetBus("bus:/Master");
     SFXVolumeEvent  = RuntimeManager.CreateInstance("event:/Master/SFX_Events/UI/Nav");
     playSelectSound = RuntimeManager.CreateInstance("event:/Master/SFX_Events/UI/Select");
     backSelectSound = RuntimeManager.CreateInstance("event:/Master/SFX_Events/UI/Back");
     startGameSound  = RuntimeManager.CreateInstance("event:/Master/SFX_Events/UI/startGame");
 }
Exemple #10
0
    public static Bus SetBusVolume(string busName, float newValue)
    {
        FMOD.Studio.Bus bus;

        bus = RuntimeManager.GetBus(busName);


        bus.setVolume(newValue);

        return(bus);
    }
Exemple #11
0
    private void Start()
    {
        nameForBus = new Dictionary <string, Bus>();

        for (int i = 0; i < busses.Length; i++)
        {
            Bus bus = RuntimeManager.GetBus(busses[i].path);
            bus.setVolume(busses[i].initialVolume);
            nameForBus.Add(busses[i].name, bus);
        }
    }
    public void MuteCommonSounds()
    {
        string busString = "Bus:/UsualSounds";

        FMOD.Studio.Bus bus;
        bus = RuntimeManager.GetBus(busString);
        bus.setFaderLevel(0f);
        ambientSound.GetComponent <FMODUnity.StudioEventEmitter>().Stop();
        vaccuumSound.StopEngine();
        Debug.Log("MUTE");
    }
        private static Bus GetBus(string busPath)
        {
            if (buses.TryGetValue(busPath, out Bus bus))
            {
                return(bus);
            }

            bus = RuntimeManager.GetBus(busPath);
            buses.Add(busPath, bus);
            return(bus);
        }
Exemple #14
0
    void Awake()
    {
        MasterBus = RuntimeManager.GetBus("Bus:/");

        MasterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
        music            = RuntimeManager.CreateInstance("event:/Music/Music");
        musicDescription = RuntimeManager.GetEventDescription("event:/Music/Music");

        musicDescription.getParameterDescriptionByName("Health", out triggerMusic);
        mID = triggerMusic.id;

        music.setParameterByID(mID, 4.00f);
        //Debug.Log("on Wake");
        music.start();
    }
Exemple #15
0
    private void Awake()
    {
        string masterBusString = "Bus:/";

        FMOD.Studio.Bus masterBus;
        masterBus = RuntimeManager.GetBus(masterBusString);

        //masterBus.getFaderLevel(out float);
        LeanTween.value(0f, 1f, fadeInTime).setEase(LeanTweenType.easeInCubic).setOnUpdate(
            (float value) => {
            masterBus.setFaderLevel(value);
        }
            );
        StartCoroutine(FadeImageAfterAudio());
    }
Exemple #16
0
        #pragma warning restore 0649

        #region Unity Events & Setup

        // Sets up the class and cameras to be in screen space.
        private void Awake()
        {
            // Canvasses settings.
            mainMenuCanvas.renderMode    = RenderMode.ScreenSpaceCamera;
            loadGameCanvas.renderMode    = RenderMode.ScreenSpaceCamera;
            optionsMenuCanvas.renderMode = RenderMode.ScreenSpaceCamera;

            // Audio buses.
            masterBus = RuntimeManager.GetBus("bus:/Master");
            musicBus  = RuntimeManager.GetBus("bus:/Master/Music");
            sfxBus    = RuntimeManager.GetBus("bus:/Master/SFX");

            // Sync Saved Settings
            SyncUiWithSaveFile();
        }
    private void Start()
    {
        heartbeat = RuntimeManager.CreateInstance(heartbeatRef);
        heartbeat.start();

        heartbeat.getPitch(out minHeartbeatPitch);
        maxHeartbeatPitch = minHeartbeatPitch + 0.3f;

        minHeartbeatVolumeDb = GetVolumeFromDecibels(-30f);
        maxHeartbeatVolumeDb = GetVolumeFromDecibels(0f);

        heartbeatGroup = RuntimeManager.GetBus("bus:/Master/SFX/Player/HeartbeatGrp");
        HandlePlayerHealthChanged(1f);

        RuntimeManager.StudioSystem.setParameterByName("MasterPitchParam", 0f);
    }
Exemple #18
0
    // Start is called before the first frame update
    void Start()
    {
        MasterBus = RuntimeManager.GetBus("Bus:/");

        MasterBus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);

        titleMusic = RuntimeManager.CreateInstance("event:/Music/Title");
        titleDesc  = RuntimeManager.GetEventDescription("event:/Music/Title");

        titleDesc.getParameterDescriptionByName("Fade", out titleTrigger);
        titleID = titleTrigger.id;

        titleMusic.setParameterByID(titleID, 1.00f);

        titleMusic.start();
    }
Exemple #19
0
    public static void Load()
    {
        OptionsSave saveData = (OptionsSave)Serialization.Load(Saving.FileNames.SETTINGS);

        if (saveData != null)
        {
            RuntimeManager.GetBus(AudioSettings.BUS_START_PREFIX + AudioSettings.BUS_MASTER).setVolume(saveData._masterVol);
            RuntimeManager.GetBus(AudioSettings.BUS_START_PREFIX + AudioSettings.BUS_MUSIC).setVolume(saveData._musicVol);
            RuntimeManager.GetBus(AudioSettings.BUS_START_PREFIX + AudioSettings.BUS_SFX).setVolume(saveData._SFXVol);

            QualitySettings.SetQualityLevel(saveData._graphicsQuality);
            QualitySettings.masterTextureLimit = saveData._textureDetail;
            TerrainGenerator.SetRenderDistanceOnStart(saveData._renderDistance);

            Player.GetPlayerCamera().fieldOfView = saveData._FOV;
            Player.SetSensitivity(saveData._lookSensitivity);
        }
    }
Exemple #20
0
    private IEnumerator DoNiceBuddhaThings()
    {
        yield return(new WaitForSeconds(1.5f));

        gravity.StabGravityInTheBack(500000f);

        //  yield return new WaitForSeconds(2f);
        AnimationManager.Instance.DoEndstageCameraEffect();


        yield return(new WaitForSeconds(4.5f));

        FMOD.Studio.Bus masterBus;
        masterBus = RuntimeManager.GetBus("Bus:/");

        LeanTween.value(gameObject, 1.0f, 0.5f, 1.0f).setOnUpdate(
            (float val) => { masterBus.setFaderLevel(val); }
            ).setEase(LeanTweenType.easeInOutCubic).setUseEstimatedTime(true);
    }
Exemple #21
0
    public static void Save()
    {
        float masterVol, musicVol, SFXVol;

        RuntimeManager.GetBus(AudioSettings.BUS_START_PREFIX + AudioSettings.BUS_MASTER).getVolume(out masterVol);
        RuntimeManager.GetBus(AudioSettings.BUS_START_PREFIX + AudioSettings.BUS_MUSIC).getVolume(out musicVol);
        RuntimeManager.GetBus(AudioSettings.BUS_START_PREFIX + AudioSettings.BUS_SFX).getVolume(out SFXVol);


        OptionsSave saveData = new OptionsSave
                                   (masterVol, musicVol, SFXVol,
                                   Screen.currentResolution,
                                   Screen.fullScreen, QualitySettings.GetQualityLevel(),
                                   QualitySettings.masterTextureLimit, TerrainGenerator.RenderDistanceIndex,
                                   Player.GetPlayerCamera().fieldOfView,
                                   Player.GetSensitivity());

        Serialization.Save(Saving.FileNames.SETTINGS, saveData);
    }
Exemple #22
0
    void Awake()
    {
        if ((instance != null && instance != this))
        {
            Destroy(this.gameObject);
            return;
        }
        else
        {
            instance = this;
            DontDestroyOnLoad(this);
            Init();
        }

        musicBus = RuntimeManager.GetBus("bus:/Master/Music");
        SFXBus   = RuntimeManager.GetBus("bus:/Master/SFX");

        SetMusicVolume(PlayerPrefs.GetFloat("musicVolume", 1));
        SetSFXVolume(PlayerPrefs.GetFloat("sfxVolume", 1));
    }
Exemple #23
0
    private void TimeTween(bool animateIn)
    {
        float first  = 1.0f;
        float second = 0.0f;

        if (!animateIn)
        {
            first  = 0.0f;
            second = 1.0f;
        }

        ShowUI(animateIn);

        FMOD.Studio.Bus masterBus;
        masterBus = RuntimeManager.GetBus("Bus:/");

        LeanTween.value(gameObject, first, second, tweenTime).setOnUpdate(
            (float val) => { Time.timeScale = val; masterBus.setFaderLevel(val); }
            ).setEase(LeanTweenType.easeInOutCubic).setUseEstimatedTime(true).setOnComplete(() => {
            isCooledDown = true;
        });
    }
    private void Awake()
    {
        if (_instance != null && Instance != this)
        {
            Destroy(this.gameObject);
        }
        else
        {
            _instance = this;
            DontDestroyOnLoad(this);
        }

        AmbienceBus     = RuntimeManager.GetBus(ambienceStringName);
        MusicBus        = RuntimeManager.GetBus(musicEffectsStringName);
        SoundEffectsBus = RuntimeManager.GetBus(soundEffectsStringName);
        VoiceBus        = RuntimeManager.GetBus(voiceStringName);

        AmbienceVolumeMultiple     = defaultAudioLevel;
        MusicVolumeMultiple        = defaultAudioLevel;
        SoundEffectsVolumeMultiple = defaultAudioLevel;
        VoiceVolumeMultiple        = defaultAudioLevel;
    }
    private void Start()
    {
        //Debug.Log("MasterVol Pref " + PlayerPrefs.GetFloat("MasterVol"));
        //Debug.Log("MusicVol Pref " + PlayerPrefs.GetFloat("MusicVol"));
        //Debug.Log("SoundsVol Pref " + PlayerPrefs.GetFloat("SoundsVol"));

        MasterBus = RuntimeManager.GetBus("bus:/Master");
        MusicBus  = RuntimeManager.GetBus("bus:/Master/Music");
        SoundsBus = RuntimeManager.GetBus("bus:/Master/Sounds");

        MasterBusVol = PlayerPrefs.GetFloat("MasterVol");
        MusicBusVol  = PlayerPrefs.GetFloat("MusicVol");
        SoundsBusVol = PlayerPrefs.GetFloat("SoundsVol");
        mute         = PlayerPrefs.GetString("IsMuted") == "True" ? true : false;

        if (mute)
        {
            MasterBus.setMute(mute);
            MusicBus.setMute(mute);
            SoundsBus.setMute(mute);
        }

        soundsVolTest = "event:/UI/UI_MenuSelection";
    }
Exemple #26
0
 public void StopAllSounds()
 {
     bus = RuntimeManager.GetBus("event:/PlayerEffect");
     bus.stopAllEvents(FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }
Exemple #27
0
 void Awake()
 {
     music  = RuntimeManager.GetBus("bus:/Master/Music");
     Sounds = RuntimeManager.GetBus("bus:/Master/Sounds");
     Master = RuntimeManager.GetBus("bus:/Master");
 }
    public void stopAllEvents()
    {
        Bus SFX = RuntimeManager.GetBus(MASTER_SFX_PATH);

        SFX.stopAllEvents(FMOD.Studio.STOP_MODE.IMMEDIATE);
    }
Exemple #29
0
 /// <summary>
 /// Stoppa tutti i suoni con fade finale
 /// </summary>
 public static void StopAllSounds(bool immediately = false)
 {
     RuntimeManager.GetBus("bus:/").stopAllEvents(immediately ? FMOD.Studio.STOP_MODE.IMMEDIATE : FMOD.Studio.STOP_MODE.ALLOWFADEOUT);
 }
Exemple #30
0
 private void Awake()
 {
     Master = RuntimeManager.GetBus("bus:/Master");
     Bgm    = RuntimeManager.GetBus("bus:/Master/Music");
 }