using UnityEngine; public class VoiceModEnableSwitch : MonoBehaviour { public GameObject[] SwitchTargets; public bool SetActive(int target) where T : MonoBehaviour { if (target < 0 || target >= SwitchTargets.Length) { return false; } for (int i = 0; i < SwitchTargets.Length; i++) { SwitchTargets[i].SetActive(false); OVRLipSyncContextMorphTarget component = SwitchTargets[i].GetComponent(); if ((bool)component) { component.enabled = false; } OVRLipSyncContextTextureFlip component2 = SwitchTargets[i].GetComponent(); if ((bool)component2) { component2.enabled = false; } } SwitchTargets[target].SetActive(true); MonoBehaviour component3 = SwitchTargets[target].GetComponent(); if (component3 != null) { component3.enabled = true; } return true; } public bool SetActive(int target) { if (target < 0 || target >= SwitchTargets.Length) { return false; } for (int i = 0; i < SwitchTargets.Length; i++) { SwitchTargets[i].SetActive(false); } SwitchTargets[target].SetActive(true); return true; } }