DeepSearch

From Unify Community Wiki
(Difference between revisions)
Jump to: navigation, search
(Fixed C# version)
m
Line 1: Line 1:
 +
{{Stub}}
 +
 
==JS Script==
 
==JS Script==
 
<javascript>
 
<javascript>

Revision as of 18:12, 24 September 2011

This article is a stub.

You can help UnifyWiki by expanding it.


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