Ejemplo n.º 1
0
 public static void CenterToParentRenderer(this Renderer childRenderer, Renderer parentRenderer)
 {
     if (childRenderer.transform.IsChildOf(parentRenderer.transform))
     {
         Vector3 childCenter  = childRenderer.bounds.center;
         Vector3 parentCenter = parentRenderer.bounds.center;
         Vector3 offset       = parentCenter - childCenter;
         childRenderer.transform.position += offset;
     }
     else
     {
         Diag.Report("child renderer " + childRenderer + " is not a child of " + parentRenderer);
     }
 }
Ejemplo n.º 2
0
        private static void DirSearch(List <string> listFilesFound, string sDir)
        {
            try
            {
                foreach (string d in Directory.GetDirectories(sDir))
                {
                    foreach (string f in Directory.GetFiles(d))
                    {
                        listFilesFound.Add(f);
                    }

                    DirSearch(listFilesFound, d);
                }
            }
            catch (Exception excpt)
            {
                Diag.Report(excpt.Message);
            }
        }