public bool counterplanet = true;
GameObject[] planets;
void Start () {
planets = GameObject.FindGameObjectsWithTag ("mycube");
}
public void Toggle_mycube() {
if(counterplanet) {
foreach(GameObject planet in planets) {
planet.SetActive (false);
counterplanet = false;
}
}
else {
foreach(GameObject planet in planets) {
planet.SetActive (true);
counterplanet = true;
}
}
}