コード例 #1
0
    // 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;
        }
    }
コード例 #2
0
 public void AddSelectedListener(UnityAction listener)
 {
     onSelected.AddListener(listener);
 }