void Start()
        {
            Debug.Log("[DNGRALT] Danger Alerts started."); //Lets the user know the add-on was started, DEBUG
            Debug.Log("[DNGRALT] Sound file exists: " + GameDatabase.Instance.ExistsAudioClip(normalAlert));
            soundplayer.Initialize(normalAlert); // Initializes the player, does some housekeeping

            DangerAlertSettings.Instance.UpdateFromCfg();

            dangerAlertGui = gameObject.AddComponent<DangerAlertGUI>();

            GameEvents.onGamePause.Add(OnPause);
            GameEvents.onGameUnpause.Add(OnUnpause);
        }
Beispiel #2
0
        void Start()
        {
            Instance = this;
            Log.Info("Danger Alerts started.");              //Lets the user know the add-on was started, DEBUG
            Log.Info("Sound file exists: " + GameDatabase.Instance.ExistsAudioClip(SOUND_DIR + normalAlert));
            soundplayer.Initialize(SOUND_DIR + normalAlert); // Initializes the player, does some housekeeping

            dangerAlertGui = gameObject.AddComponent <DangerAlertGUI>();

            GameEvents.onGamePause.Add(OnPause);
            GameEvents.onGameUnpause.Add(OnUnpause);
            GameEvents.onCrash.Add(onCrash);
        }
        //Updates all the setting classes variables from a DangerAlertGUI's textbox values.
        public void UpdateFromGui(DangerAlertGUI gui)
        {
            MasterToggle = gui.masterToggle;
            MasterVolume = gui.VolumeSlider;
            SoundToggle = gui.soundToggle;
            Window = gui.Window;

            GUIPosition = gui.GetPosition();
        }