private void OnGUI() { if (Event.current.type != EventType.Repaint) { return; } if (LocalDamageDisplay.adminObjectShow) { GUI.color = Color.white; GUI.Box(new Rect(5f, 5f, 128f, 24f), (LocalDamageDisplay.mode != 0 ? "showing selection" : "showing characters")); if (LocalDamageDisplay.mode == 0) { UnityEngine.Object[] objArray = UnityEngine.Object.FindObjectsOfType(typeof(Character)); for (int i = 0; i < (int)objArray.Length; i++) { UnityEngine.Object obj = objArray[i]; if (obj) { Character character = (Character)obj; if (character.gameObject != this) { LocalDamageDisplay.DrawLabel(character.origin, character.name); } } } } } }
private void SetLocalOnlyComponentsEnabled(bool enable) { CCMotor component = base.GetComponent <CCMotor>(); if (component) { component.enabled = enable; CharacterController characterController = base.collider as CharacterController; if (characterController) { characterController.enabled = enable; } } CameraMount componentInChildren = base.GetComponentInChildren <CameraMount>(); if (componentInChildren) { componentInChildren.open = enable; HeadBob headBob = componentInChildren.GetComponent <HeadBob>(); if (headBob) { headBob.enabled = enable; } LazyCam lazyCam = componentInChildren.GetComponent <LazyCam>(); if (lazyCam) { lazyCam.enabled = enable; } } LocalDamageDisplay localDamageDisplay = base.GetComponent <LocalDamageDisplay>(); if (localDamageDisplay) { localDamageDisplay.enabled = enable; } }
private void SetLocalOnlyComponentsEnabled(bool enable) { CCMotor component = base.GetComponent <CCMotor>(); if (component != null) { component.enabled = enable; CharacterController collider = base.collider as CharacterController; if (collider != null) { collider.enabled = enable; } } CameraMount componentInChildren = base.GetComponentInChildren <CameraMount>(); if (componentInChildren != null) { componentInChildren.open = enable; HeadBob bob = componentInChildren.GetComponent <HeadBob>(); if (bob != null) { bob.enabled = enable; } LazyCam cam = componentInChildren.GetComponent <LazyCam>(); if (cam != null) { cam.enabled = enable; } } LocalDamageDisplay display = base.GetComponent <LocalDamageDisplay>(); if (display != null) { display.enabled = enable; } }