Character[] GenerateHireList(int nbChara, Character.Characterclass c) { Character[] hireList = new Character[nbChara]; GameObject chara = new GameObject(); for (int i = 0; i < nbChara; i++) { hireList[i] = new Character(c, cname); } return(hireList); }
void Hire(int windowID) { cname = GUILayout.TextField(cname); string[] classes = { "Intérim", "Stagiaire", "Secrétaire", "Ingénieur", "Manageur", "Technicien de surface", "Agent de sécurité", "Comptable" }; choice = GUILayout.SelectionGrid(choice, classes, 2); type = (Character.Characterclass)choice; nbProfiles = (int)GUILayout.HorizontalSlider(nbProfiles, 1, 10); if (cname != "" && GUILayout.Button("Hire!")) { hireList = GenerateHireList(nbProfiles, type); doWindow2 = true; choice = -1; doWindow0 = false; } }