Example #1
0
    public void SelectMutation()
    {
        MutationManager mutationManager = GameObject.FindGameObjectWithTag("MutationManager").GetComponent <MutationManager>();

        mutationManager.AddMutationID(idMonster, mutation);

        string s = "CAPITAL";

        SceneManager.LoadScene(s);

        // SceneManager.UnloadScene(currentScene);

        /*
         * SceneManager.SetActiveScene(SceneManager.GetSceneByName(s));
         * for (int i = 0; i < SceneManager.GetActiveScene().GetRootGameObjects().Length; i++)
         * {
         *   GameObject go = SceneManager.GetActiveScene().GetRootGameObjects()[i];
         *   if (go.tag != "Spotligth")
         *       SceneManager.GetActiveScene().GetRootGameObjects()[i].SetActive(true);
         * }
         */

        GameObject  g  = GameObject.FindGameObjectWithTag("ProtoManager");
        ProtoScript ps = null;

        if (g != null)
        {
            ps = g.GetComponent <ProtoScript>();
            ps.map.EnterMap();
            ps.currentIndex++;
        }
    }