Пример #1
0
        private static GameObject CreateOrGetGameObject(string path)
        {
            if (CurveBindingUtility.s_Root == null)
            {
                CurveBindingUtility.s_Root = CurveBindingUtility.CreateNewGameObject(null, "Root");
            }
            if (path.Length == 0)
            {
                return(CurveBindingUtility.s_Root);
            }
            string[] array = path.Split(new char[]
            {
                '/'
            });
            Transform transform = CurveBindingUtility.s_Root.transform;

            string[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                string    name       = array2[i];
                Transform transform2 = transform.FindChild(name);
                if (transform2 == null)
                {
                    transform = CurveBindingUtility.CreateNewGameObject(transform, name).transform;
                }
                else
                {
                    transform = transform2;
                }
            }
            return(transform.gameObject);
        }
 private static GameObject CreateOrGetGameObject(string path)
 {
   if ((UnityEngine.Object) CurveBindingUtility.s_Root == (UnityEngine.Object) null)
     CurveBindingUtility.s_Root = CurveBindingUtility.CreateNewGameObject((Transform) null, "Root");
   if (path.Length == 0)
     return CurveBindingUtility.s_Root;
   string[] strArray = path.Split('/');
   Transform parent = CurveBindingUtility.s_Root.transform;
   foreach (string name in strArray)
   {
     Transform child = parent.FindChild(name);
     parent = !((UnityEngine.Object) child == (UnityEngine.Object) null) ? child : CurveBindingUtility.CreateNewGameObject(parent, name).transform;
   }
   return parent.gameObject;
 }