Example #1
0
 public void toggleAnimatorOfAllChildren(bool b)
 {
     foreach (Transform child in transform)
     {
         Animator       anim = child.GetComponent <Animator>();
         ForAllChildren fac  = child.gameObject.GetComponent <ForAllChildren>();
         if (anim != null)
         {
             anim.enabled = b;
         }
         if (fac != null)
         {
             fac.toggleAnimatorOfAllChildren(b);
         }
     }
 }
Example #2
0
    void setVisibilityOfAllChildren(bool visible)
    {
        ForAllChildren sr = gameObject.GetComponent <ForAllChildren>();

        sr.setColorOfAllChildren((visible) ? Color.white : Color.grey);
    }