/// <summary> /// Toggle the nuke anchor if the disk has been inserted, the code has been input and the nuke can be anchored /// </summary> public void AnchorNukeButton() { if (!Nuke.IsAncharable) { return; } if (nuke.NukeSlot.IsEmpty) { this.TryStopCoroutine(ref corHandler); this.StartCoroutine(UpdateDisplay("Insert the disk!", "Insert the disk!"), ref corHandler); return; } bool?isAnchored = Nuke.AnchorNuke(); if (isAnchored != null) { InfoAnchorColor.SetValueServer(isAnchored.Value ? colorRed : colorGreen); this.TryStopCoroutine(ref corHandler); this.StartCoroutine(UpdateDisplay("Anchor is: " + (isAnchored.Value ? "Off" : "On"), (isAnchored.Value ? "Nuke position Unlocked!" : "Nuke position Locked!")), ref corHandler); } else { this.TryStopCoroutine(ref corHandler); this.StartCoroutine(UpdateDisplay("Safety is on!", "Nuke is unarmed!"), ref corHandler); } }
private void Start() { //only executed on server if (IsServer) { // Logger.Log( $"{name} Kinda init. Nuke code is {NukeInteract.NukeCode}" ); InitialInfoText = $"Enter {Nuke.NukeCode.ToString().Length}-digit code:"; InfoNukeDisplay.SetValueServer("Insert the disk!"); if (!Nuke.IsAncharable) { InfoAnchorColor.SetValueServer(colorGrey); } } }