Ejemplo n.º 1
0
 void Awake()
 {
     moduleId = moduleIdCounter++;
     foreach (MonitorScreens monitor in monitors)
     {
         MonitorScreens pressedMonitor = monitor;
         pressedMonitor.selectable.OnInteract += delegate() { OnMonitorPress(pressedMonitor); return(false); };
     }
     foreach (MonitorScreens badnik in badniks)
     {
         MonitorScreens pressedBadnik = badnik;
         pressedBadnik.selectable.OnInteract += delegate() { OnBadnikPress(pressedBadnik); return(false); };
     }
     foreach (MonitorScreens hero in heroes)
     {
         MonitorScreens pressedHero = hero;
         pressedHero.selectable.OnInteract += delegate() { OnHeroPress(pressedHero); return(false); };
     }
     boss.selectable.OnInteract += delegate() { OnBossPress(); return(false); };
     logo.OnInteract            += delegate() { OnLogoPress(); return(false); };
     GetComponent <KMBombModule>().OnActivate += OnLights;
 }
Ejemplo n.º 2
0
 public void OnHeroPress(MonitorScreens pressedHero)
 {
     if (buttonLock)
     {
         return;
     }
     pressedHero.selectable.AddInteractionPunch(0.5f);
     if (lastPressed == null)
     {
         lastPressed = pressedHero.gameObject;
         lastPressed.gameObject.SetActive(false);
     }
     else
     {
         lastPressed.gameObject.SetActive(true);
         lastPressed = pressedHero.gameObject;
         lastPressed.gameObject.SetActive(false);
     }
     if ((secondsCount == (ringCount % 20)) || (secondsCount == (ringCount % 20) + 20) || (secondsCount == (ringCount % 20) + 40))
     {
         if (pressedHero.containsIllegalSound)
         {
             Debug.LogFormat("[Sonic & Knuckles #{0}] You pressed {1}. That is correct.", moduleId, pressedHero.label);
             SetUpBoss();
         }
         else
         {
             Debug.LogFormat("[Sonic & Knuckles #{0}] Strike! You pressed {1}. That is incorrect.", moduleId, pressedHero.label);
             Strike();
         }
     }
     else
     {
         Audio.PlaySoundAtTransform(pressedHero.attachedSound.name, transform);
     }
 }