Exemplo n.º 1
0
    public void populateGenreList()
    {
        int genrecounter = 0;

        foreach (string button in genreNames)
        {
            if (GUI.Button(new Rect(genreButtonPosition, 325, 100, 35), button))
            {
                PlayerGenre                = GameObject.Find(button + "(Clone)");
                ObjectGenreScript          = PlayerGenre.GetComponent <PrefabGenreScript> ();
                SetGenre.ObjectGenreScript = ObjectGenreScript;
                SetGenre.PlayerScript      = PlayerScript;
                SetGenre.Set();
                genreNames[genrecounter] = null;

                int downsome = 0;
                int counter  = -1;

                foreach (string unusedvariable in genreNames)
                {
                    counter += 1;
                    if (genreNames[counter] == null)
                    {
                        downsome += 1;
                    }
                    if (counter + downsome < genreNames.Length)
                    {
                        genreNames[counter] = genreNames[counter + downsome];
                    }
                    else
                    {
                        counter -= 1;
                    }
                }
                //if(downsome!=0)
                //{
                //genreNames[counter + downsome] = null;
                //}

                System.Array.Resize(ref genreNames, genreNames.Length - downsome);
                GenreControllerScript.genreNames   = genreNames;
                GenreControllerScript.genreNumber -= 1;
                //Destroy (PlayerGenre, 0);
                Application.LoadLevel(2);
            }
            genrecounter        += 1;
            genreButtonPosition += 175;
        }
        genrecounter        = 0;
        genreButtonPosition = 25;
    }
Exemplo n.º 2
0
    public void populateGenreList()
    {
        int genrecounter = 0;

        foreach (string button in genreNames)
        {
            if (GUI.Button(new Rect(genreButtonPosition, 325, 100, 35), button))
            {
                PlayerGenre                = GameObject.Find(button + "(Clone)");
                ObjectGenreScript          = PlayerGenre.GetComponent <PrefabGenreScript> ();
                SetGenre.ObjectGenreScript = ObjectGenreScript;
                SetGenre.PlayerScript      = PlayerScript;
                SetGenre.Set();
                //Destroy (PlayerGenre, 0);
                GenreControllerScript.DestroyUnusedGenres();
                Destroy(GenreController);
                Application.LoadLevel(5);
            }
            genrecounter        += 1;
            genreButtonPosition += 175;
        }
        genrecounter        = 0;
        genreButtonPosition = 25;
    }