private void Awake() { selectionScreen.gameObject.SetActive(true); playerPlus.onClick.AddListener(AddOnePlayer); playerMinus.onClick.AddListener(RemoveOnePlayer); computerPlus.onClick.AddListener(AddOneComputer); computerMinus.onClick.AddListener(RemoveOneComputer); selectionScreen.GetComponent <Button>().onClick.AddListener(delegate { StartCoroutine(SelectCharacterAt(-1)); }); for (int i = 0; i < playerSelectors.Length; i++) { CharacterSelector cs = playerSelectors[i]; cs.SetButtonEnable(i < playerCount); cs.SetIndex(i); cs.button.onClick.AddListener(delegate { StartCoroutine(StartSelectCharacterFor(cs.GetIndex())); }); } foreach (CharacterButton cb in selectionScreen.characters) { cb.button.onClick.AddListener(delegate { StartCoroutine(SelectCharacterAt(cb.character.id)); }); } foreach (Character c in computerCharacters) { c.type = "computer"; } startButton.onClick.AddListener(StartGame); startPosition = new Vector2(0f, 0f); music = GetComponent <AudioSource>(); maxVolume = music.volume; music.volume = 0; UpdateCounterText(); }