public void ActivateAlarm() { PuzzleALARM _alarm = AlarmPuzzle.GetComponent <PuzzleALARM>(); if (hasAlarmedOnce) { int actualChance = Random.Range(0, 100); if (actualChance >= 50) { _alarm.Toggle(); } } else { _alarm.Toggle(); } hasAlarmedOnce = true; }
public void ActivateAlarm(bool forceIt = false) { PuzzleALARM _alarm = AlarmPuzzle.GetComponent <PuzzleALARM>(); if (forceIt) { _alarm.Toggle(); } else { ActivateAlarm(); } hasAlarmedOnce = true; }