コード例 #1
0
ファイル: EditorUtility.cs プロジェクト: bmjoy/face-nn
 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);
     }
 }
コード例 #2
0
ファイル: EditorUtility.cs プロジェクト: bmjoy/face-nn
 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);
     }
 }
コード例 #3
0
ファイル: EditorUtility.cs プロジェクト: bmjoy/face-nn
        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);
                }
            }
        }
コード例 #4
0
 /// <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));
 }
コード例 #5
0
 /// <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));
 }