Well, I made a script where it activates and deactivates in the gameobject
, I wanted to know how to activate and deactivate the children also inside this script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class OBJETOS : MonoBehaviour
{
public GameObject[] arrayObjetos;
public void botoes(int num)
{
for(int i = 0; i < arrayObjetos.Length; i++)
{
if( arrayObjetos[num] == arrayObjetos[i])
{
arrayObjetos[i].SetActive(true);
}else{
arrayObjetos[i].SetActive(false);
}
}
}
}
//sei que pode ser assim GameObject meuobjeto = GameObject.Find("meuobjeto");
// e assim tbm GameObject ChildGameObjeto1 = ParentGameObject.transform.GetChild (0).gameObject;