void Awake() { pGoodGuysContainer = GameObject.Find("GoodGuys").GetComponent<CharactersControl>(); pPlayer = pGoodGuysContainer.gameObject.transform.GetChild(m_iPlayerNum).gameObject.GetComponentInChildren<Player>(); EventTrigger.Entry tEntry = new EventTrigger.Entry(); tEntry.eventID = EventTriggerType.PointerUp; tEntry.callback.AddListener(delegate { pGoodGuysContainer.SelectCharacter(pPlayer); }); gameObject.GetComponent<EventTrigger>().triggers.Add(tEntry); }
void Awake() { pGoodGuysContainer = GameObject.Find("GoodGuys").GetComponent <CharactersControl>(); pPlayer = pGoodGuysContainer.gameObject.transform.GetChild(m_iPlayerNum).gameObject.GetComponentInChildren <Player>(); EventTrigger.Entry tEntry = new EventTrigger.Entry(); tEntry.eventID = EventTriggerType.PointerUp; tEntry.callback.AddListener(delegate { pGoodGuysContainer.SelectCharacter(pPlayer); }); gameObject.GetComponent <EventTrigger>().triggers.Add(tEntry); }
public void MouseClick() { for (int i = 0; i < m_pIsSelected.Length; i++) { if (!CharactersControl.PlayerCharacters[i].IsDead) { pCharactersControl.SelectCharacter(i); m_pIsSelected[i] = true; } } }