public Program()
        {
            soundBlock  = (IMySoundBlock)GridTerminalSystem.GetBlockWithName(nameSoundBlock);
            lightBlocks = new List <IMyInteriorLight>
            {
                (IMyInteriorLight)GridTerminalSystem.GetBlockWithName(nameLightBlocks[0]),
                (IMyInteriorLight)GridTerminalSystem.GetBlockWithName(nameLightBlocks[1])
            };
            lcdPanel = (IMyTextPanel)GridTerminalSystem.GetBlockWithName(nameLCDPanel);

            bigBadAlertLight         = new AlertLight(lightBlocks[0], Color.Yellow, true);
            biggerBadderAlertLight   = new AlertLight(lightBlocks[1]);
            bigBadAlertSound         = new AlertSound(soundBlock);
            bigBadAlertMessage       = new AlertText(lcdPanel, warningMessage, 2f, Color.Blue, Color.Yellow);
            biggerBadderAlertMessage = new AlertText(lcdPanel, warningMessage2, 3f, Color.Cyan, Color.Red);
            bigBadAlert = new Alert(new List <AlertObject> {
                bigBadAlertLight, bigBadAlertMessage, bigBadAlertSound
            });
            biggerBadderAlert = new Alert(new List <AlertObject> {
                biggerBadderAlertLight, bigBadAlertLight, biggerBadderAlertMessage, bigBadAlertSound
            });

            alertSystemManager = new AlertSystemManager <int>(new Dictionary <int, Alert> {
                { 0, bigBadAlert }, { 1, biggerBadderAlert }
            });
        }
            public LowHydrogenWarningSystem(List <IMyGasTank> h2TankBlocks, IMyInteriorLight warningLightBlock, IMyTextPanel warningLCDBlock, IMySoundBlock warningSoundBlock)
            {
                gasTanksManager = new GasTanksManager(h2TankBlocks);

                AlertLight warningLight = new AlertLight(warningLightBlock);
                AlertLight warningLCD   = new AlertText(warningLCDBlock, "Low H2!");
                AlertLight warningSound = new AlertSound(warningSoundBlock);

                listAlertObjects = new List <AlertLight> {
                    warningLight, warningLCD, warningSound
                };
            }
Beispiel #3
0
 // Start is called before the first frame update
 void Awake()
 {
     targetIntensity = maxIntensity;
     alertOn         = false;
     self            = this;
 }