void FixedUpdate() { if (!forceSolve && abortMode && !Exploded) { bool state = ticker >= 0.25f; ticker += Time.fixedDeltaTime; if (state) { if (ticker >= 0.5f) { ticker -= 0.5f; Display.text = ""; } } else { if (ticker >= 0.25f) { Service.CauseStrike("ABORT!"); Display.text = "ABORT!"; } } } }
public void RequestSafeDetonation() { // Try to detonate this by attempting to do the following /* Set the max strikes to the current number of strikes, + 1. * Cause a strike to blow it on the next strike. * Have the record manager say it blew it up. */ if (Application.isEditor) { var bombComponent = GetComponentInParent <KMBomb>(); if (bombComponent != null) { var timer = bombComponent.gameObject.transform.Find("TimerModule(Clone)"); if (timer != null) { var script = timer.GetComponent("TimerModule"); if (script != null) { script.SetValue("ExplodedToTime", true); } } else { Debug.LogFormat("can't find component"); } } else { Debug.LogFormat("can't find component"); } } else { var bombComponent = GetComponentInParent <KMBomb>(); if (bombComponent != null) { var script = bombComponent.GetComponent("Bomb"); if (script != null) { var curStrikes = bombInfo.GetStrikes(); script.SetValue("NumStrikesToLose", curStrikes + 1); //script.CallMethod("Detonate"); commands.CauseStrike("Requested Detonation"); /* * KMBombModule modSelf = GetComponent<KMBombModule>(); * if (modSelf != null) * modSelf.HandleStrike(); */ } else { Debug.LogFormat("can't find script component bomb"); } } else { Debug.LogFormat("can't find bomb component"); } } }