public static bool FindTransform(Transform rootTrans, Transform findTrans) { if (rootTrans == findTrans) { return(true); } IEnumerator enumerator = rootTrans.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform rootTrans2 = (Transform)enumerator.get_Current(); if (NgObject.FindTransform(rootTrans2, findTrans)) { return(true); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } return(false); }
public static Transform FindTransform(Transform rootTrans, string name) { Transform transform = rootTrans.Find(name); if (transform) { return(transform); } IEnumerator enumerator = rootTrans.GetEnumerator(); try { while (enumerator.MoveNext()) { Transform rootTrans2 = (Transform)enumerator.get_Current(); transform = NgObject.FindTransform(rootTrans2, name); if (transform) { return(transform); } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } return(null); }
public static bool FindTransform(Transform rootTrans, Transform findTrans) { if (rootTrans == findTrans) { return(true); } foreach (Transform rootTrans2 in rootTrans) { if (NgObject.FindTransform(rootTrans2, findTrans)) { return(true); } } return(false); }
public static Transform FindTransform(Transform rootTrans, string name) { Transform transform = rootTrans.Find(name); if (transform) { return(transform); } foreach (Transform rootTrans2 in rootTrans) { transform = NgObject.FindTransform(rootTrans2, name); if (transform) { return(transform); } } return(null); }