Пример #1
0
        void Start()
        {
            fetch = this;
            if (toolbarControl == null)
            {
                toolbarControl = gameObject.AddComponent <ToolbarControl>();
                toolbarControl.AddToAllToolbars(GuiOn, GuiOff,
                                                ApplicationLauncher.AppScenes.SPACECENTER | ApplicationLauncher.AppScenes.FLIGHT | ApplicationLauncher.AppScenes.MAPVIEW,
                                                MODID,
                                                "dangerAlertButton",
                                                "ResourceMonitors/PluginData/Icons/icon_38",
                                                "ResourceMonitors/PluginData/Icons/icon_24",
                                                MODNAME
                                                );
            }
            if (soundplayer == null)
            {
                soundplayer = new AlertSoundPlayer();
                soundplayer.Initialize("selection");
            }
            GameEvents.onVesselChange.Add(onVesselChange);
            GameEvents.OnGameSettingsApplied.Add(OnGameSettingsApplied);

            GameEvents.onGamePause.Add(onGamePause);
            GameEvents.onGameUnpause.Add(onGameUnpause);

            GameEvents.onShowUI.Add(ShowUI);
            GameEvents.onHideUI.Add(HideUI);
        }
Пример #2
0
 bool InitSoundplayer()
 {
     soundplayer = new AlertSoundPlayer();
     if (soundplayer != null)
     {
         soundplayer.Initialize(resname);
     }
     return(soundplayer != null);
 }