Exemplo n.º 1
0
 void Awake()
 {
     if (_ui)
     {
         this.GetComponent <Image>().color = CustomColor.GetColor(_color);
     }
     else
     {
         if (onlyChildren)
         {
             Renderer[] _r = this.GetComponentsInChildren <Renderer>();
             for (int i = 0; i < _r.Length; i++)
             {
                 _r[i].material.color = CustomColor.GetColor(_color);
             }
         }
         else
         {
             this.GetComponent <Renderer>().material.color = CustomColor.GetColor(_color);
         }
     }
 }