Пример #1
0
    void ResetEnvironment(GameObject cameraAxis)
    {
        debugCanvas.ResetAllLines();

        //graficas y escenario, puede que spawner

        float height = 0f;
        bool  invert = false;

        bool turnOff = false;

        cameraAxis.transform.GetChild(0).GetComponent <AgentShoot>().GetDirectionAndHeight(ref invert, ref height, ref turnOff);

        if (turnOff)
        {
            scene.GetComponent <SpawnCases>().enabled = false;

            scene.GetComponent <Spawn>().enabled = false;
        }
        else
        {
            scene.GetComponent <SpawnCases>().enabled = true;

            scene.gameObject.SetActive(true);

            scene.GetComponent <SpawnCases>().ResetSpawner(height, invert, cameraAxis.transform);

            scene.GetComponent <Spawn>().ResetSpawner(height);
        }

        foreach (Transform child in scene)
        {
            Destroy(child.gameObject);
        }

        if (active < botNames.Count)
        {
            agentName.text = botNames[active];
        }

        cameraAxis.SetActive(true);
    }