void CheckThreeWires(BinaryLeds scriptObj) { if (scriptObj.cutWires >= 3) { // If you messed up three times, we'll give you a pass since you can't solve the module otherwise. GetComponent <KMBombModule>().HandlePass(); solved = true; } }
void OnCutLogic(WireDelegateInfo info, BinaryLeds scriptObj) { if (info.isCut) // Don't do anything if you already cut the wire { return; } int timeIndex = GetIndexFromTime(Time.time, blinkDelay); Debug.LogFormat("[Binary LEDs #{0}] Cutting wire {1}. Required time index is {2}, current time is {3}", _moduleId, info.color, solutions[sequenceIndex, (int)info.color], timeIndex); scriptObj.cutWires++; if (!isActivated) { Debug.LogFormat("[Binary LEDs #{0}] Cut wire before module has been activated!", _moduleId); GetComponent <KMBombModule>().HandleStrike(); ReduceBlinkDelay(); } else { if (solutions[sequenceIndex, (int)info.color] == timeIndex) { GetComponent <KMBombModule>().HandlePass(); solved = true; } else { GetComponent <KMBombModule>().HandleStrike(); ReduceBlinkDelay(); } } GetComponent <KMAudio>().PlayGameSoundAtTransform(KMSoundOverride.SoundEffect.WireSnip, transform); GetComponent <KMSelectable>().AddInteractionPunch(); info.isCut = true; }