// Start is called before the first frame update void Start() { cldr = gameObject.GetComponent <Collider2D>(); isSelected = false; abilityResolver = GameManager.Instance.GetComponent <AbilityResolver>(); selectedEvent.AddListener(abilityResolver.OnUnitSelectHandler); Debug.Log(gameObject.name); switch (gameObject.name) { case ("PlayerSwordsman(Clone)"): menu = GameManager.Instance.menuWarrior; break; case ("PlayerWizard(Clone)"): menu = GameManager.Instance.menuWizard; break; case ("PlayerHealer(Clone)"): menu = GameManager.Instance.menuWizard; break; default: break; } }
public void AddSelectedListener(UnityAction listener) { onSelected.AddListener(listener); }