Example #1
0
    public void ActOrNavi()
    {
        ShowPlant parentValue = transform.parent.parent.GetComponent <ShowPlant>();

        if (parentValue.navigate)
        {
            FindLocation();
        }
        else
        {
            ActiveOrNot();
        }
    }
Example #2
0
    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;
        }
    }
Example #3
0
    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;
                }
            }
        }
    }