public void ActOrNavi() { ShowPlant parentValue = transform.parent.parent.GetComponent <ShowPlant>(); if (parentValue.navigate) { FindLocation(); } else { ActiveOrNot(); } }
public void StartNavigate() { ShowPlant parentValue = transform.parent.GetComponent <ShowPlant>(); if (parentValue.navigate) { parentValue.navigate = false; transform.GetChild(0).GetChild(0).GetComponent <TextMeshPro>().text = "Navigate?"; gameObject.GetComponent <MeshRenderer>().material.color = Color.white; } else { parentValue.navigate = true; transform.GetChild(0).GetChild(0).GetComponent <TextMeshPro>().text = "In Navigate"; gameObject.GetComponent <MeshRenderer>().material.color = Color.yellow; } }
public void ActOrDeactAll() { ShowPlant parentValue = transform.parent.GetComponent <ShowPlant>(); if (!parentValue.navigate) { foreach (Transform childCube in PlantMapSet.transform) { Transform singlePlant = GetSingPlant(childCube.name); if (singlePlant.gameObject.activeSelf) { singlePlant.GetChild(0).GetChild(4).GetComponent <TCPClient>().SendSingleDetails(0); singlePlant.gameObject.SetActive(false); GetComponent <MeshRenderer>().material.color = Color.red; } } } }