/// <summary> /// Turns the stored Canvases off or on. Also handles the Joystick /// </summary> /// <param name="setter"></param> public void ToggleUI(bool setter) { _touchCanvas.enabled = setter; var joystick = _touchCanvas.gameObject.GetComponentInChildren <Joystick>(); if (joystick) { joystick.enabled = setter; } // If we're turning the UI on.... if (setter) { // We need to check if this canvas have a joystick? if (joystick) { joystick.SetAxis(joystick.axesToUse); } Noise noiseScript = _touchCanvas.gameObject.GetComponentInChildren <Noise>(); if (noiseScript != null) { noiseScript.ResetNoiseBar(); noiseScript.SetNoiseBar(noiseScript.CalculateNoiseVal(_playerData.NoiseAmount)); print(_playerData.NoiseAmount); } } }