public void ToggleUIPanel(GameObject g) { if (g.activeSelf == true) { uiFader.FadeOutPanel(g); if (g = GameObject.Find("Textbox")) { textInput.currentField.interactable = false; textInput.currentField.onEndEdit.RemoveAllListeners(); } } else { uiFader.FadeInPanel(g); if (g = GameObject.Find("Textbox")) { textInput.currentField.interactable = true; textInput.currentField.ActivateInputField(); textInput.currentField.onEndEdit.AddListener(textInput.AcceptStringInput); } } }
public void HackItem(string[] separatedInputWords) { string nounToHack = separatedInputWords[1]; if (nounsInRoom.Contains(nounToHack)) { foreach (InteractableObject o in controller.roomNavigation.currentRoom.interactableObjectsInRoom) { if (o.noun == nounToHack) { bool b = TestForInteractibility(o); if (b) { //Start the hacking music controller.roomNavigation.defaultTrack.stop(FMOD.Studio.STOP_MODE.ALLOWFADEOUT); HackingController.hackingTrack.start(); HackingController.hackingTrack.setVolume(hackingVolume * controller.roomNavigation.masterVolume); HackingController.hackingIntensity.setValue(1); //Reset the important file found tracking bool HackingController.importantFileFound = false; Debug.Log("Hacking"); controller.hacking = true; //Find the correct library of files to load up for the player to interact with HackingController.LoadLibrary(nounToHack); //Switch UIs over uiFader.FadeInPanel(controller.hackingUI); //Switch the current input fields around, then run ActivateFields textInput.currentField = textInput.hackingInputField; textInput.notCurrentField = textInput.inputField; controller.ClearCurrentLog(); ActivateFields(); //Switch the display output to begin logging & outputting the appropriate display controller.currentActionLog = controller.hackingActionLog; controller.currentDisplayText = controller.hackingDisplayText; } } } } else { controller.LogStringWithReturn("You don't see a " + nounToHack + " here."); } }