DeepSearch

From Unify Community Wiki
Revision as of 17:30, 26 March 2011 by Cominu (Talk | contribs)

Jump to: navigation, search

JS Script

<javascript>

static function deepSearch (t : Transform, s : String) : Transform { var dt : Transform = t.Find (s); if (dt) return dt; else { for (var child : Transform in t) { dt = deepSearch (child, s); if (dt) return dt; } } return null; } </javascript>

C# Script

<csharp>

  static public Transform deepSearch(Transform t, string s)
  {
      Transform dt = t.Find(s);
      if (dt != null)
          return dt;
      else
      {
          foreach (Transform child in t)
          {
              dt = deepSearch(child, s);
              if (dt != null)
                  return dt;
          }
      }
      return null;
  }

</csharp>

Personal tools
Namespaces

Variants
Actions
Navigation
Extras
Toolbox