public static void EnumChildObject(Transform t, object param, EnumTransform fun) { for (int i = 0; i < t.childCount; ++i) { Transform child = t.GetChild(i); fun(child, param); } }
public static void EnumRootObject(EnumTransform cb, object param = null) { UnityEngine.SceneManagement.Scene s = SceneManager.GetActiveScene(); GameObject[] roots = s.GetRootGameObjects(); for (int i = 0, imax = roots.Length; i < imax; ++i) { Transform t = roots[i].transform; cb(t, param); } }
public static void EnumTargetObject(string goPath, EnumTransform cb, object param = null) { GameObject go = GameObject.Find(goPath); if (go != null) { Transform t = go.transform; for (int i = 0, imax = t.childCount; i < imax; ++i) { Transform child = t.GetChild(i); cb(child, param); } } }
/// <summary> /// Gets the wrapper. /// </summary> /// <param name="src">The source.</param> /// <returns>IRelativeToSetting[].</returns> public static IRelativeToSetting[] GetWrapper(RelativeToSetting[] src) { return(EnumTransform <IRelativeToSetting, RelativeToSetting> .Change(src)); }
/// <summary> /// Gets the instance. /// </summary> /// <param name="src">The source.</param> /// <returns>RelativeToSetting[].</returns> public static RelativeToSetting[] GetInstance(IRelativeToSetting[] src) { return(EnumTransform <IRelativeToSetting, RelativeToSetting> .Change(src)); }