public void MouseLookEnabledChanged(bool val) { MouseLookEnabledCheckBox.isOn = val; foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Player")) { UnityEngine.Networking.NetworkBehaviour network = obj.GetComponent <UnityEngine.Networking.NetworkBehaviour>(); if (network == null || network.isLocalPlayer) { WeatherMakerPlayerControllerScript controller = obj.GetComponent <WeatherMakerPlayerControllerScript>(); if (controller != null) { controller.EnableMouseLook = val; } } } }
public void FlashlightChanged(bool val) { foreach (GameObject obj in GameObject.FindGameObjectsWithTag("Player")) { UnityEngine.Networking.NetworkBehaviour network = obj.GetComponent <UnityEngine.Networking.NetworkBehaviour>(); if (network == null || network.isLocalPlayer) { Light[] lights = obj.GetComponentsInChildren <Light>(); foreach (Light light in lights) { if (light.name == "Flashlight") { light.enabled = val; break; } } } } if (FlashlightToggle != null) { FlashlightToggle.isOn = val; } }