private void DestroyRigs() { CinemachineVirtualCamera[] array = new CinemachineVirtualCamera[CinemachineFreeLook.RigNames.Length]; for (int i = 0; i < CinemachineFreeLook.RigNames.Length; i++) { foreach (object obj in base.transform) { Transform transform = (Transform)obj; if (transform.gameObject.name == CinemachineFreeLook.RigNames[i]) { array[i] = transform.GetComponent <CinemachineVirtualCamera>(); } } } for (int j = 0; j < array.Length; j++) { if (array[j] != null) { if (CinemachineFreeLook.DestroyRigOverride != null) { CinemachineFreeLook.DestroyRigOverride(array[j].gameObject); } else { UnityEngine.Object.Destroy(array[j].gameObject); } } } this.m_Rigs = null; this.mOrbitals = null; }
private void DestroyRigs() { CinemachineVirtualCamera[] array = new CinemachineVirtualCamera[CinemachineFreeLook.RigNames.Length]; for (int i = 0; i < CinemachineFreeLook.RigNames.Length; i++) { IEnumerator enumerator = base.transform.GetEnumerator(); try { while (enumerator.MoveNext()) { object obj = enumerator.Current; Transform transform = (Transform)obj; if (transform.gameObject.name == CinemachineFreeLook.RigNames[i]) { array[i] = transform.GetComponent <CinemachineVirtualCamera>(); } } } finally { IDisposable disposable; if ((disposable = (enumerator as IDisposable)) != null) { disposable.Dispose(); } } } for (int j = 0; j < array.Length; j++) { if (array[j] != null) { if (CinemachineFreeLook.DestroyRigOverride != null) { CinemachineFreeLook.DestroyRigOverride(array[j].gameObject); } else { UnityEngine.Object.Destroy(array[j].gameObject); } } } this.m_Rigs = null; this.mOrbitals = null; }