Example #1
0
        public static float GetWidth(this LineRenderer thisLineRenderer)
        {
            float start = thisLineRenderer.startWidth;
            float end   = thisLineRenderer.endWidth;

            if (start != end)
            {
                Diag.Warn("Trying to interpolate widths of line renderer that are not equal.");
            }

            return((start + end) / 2);
        }
Example #2
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);
     }
 }
Example #3
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);
            }
        }