예제 #1
0
 private void OnEndSkillCast(ICastableSkill skill)
 {
     if (skill is UseThing useThingSkill)
     {
         if (useThingSkill.Thing == _usableThing)
         {
             var gameObj = ThingsBehaviour.Instance.Things[_usableThing];
             gameObj.SetActive(false);
         }
     }
 }
예제 #2
0
    void Start()
    {
        _progressBackRect = ProgressBack.GetComponent <RectTransform>();
        _progressTopRect  = ProgressTop.GetComponent <RectTransform>();

        foreach (var castableSkill in _player.Skills.OfType <ICastableSkill>())
        {
            castableSkill.OnBeginCast += skill => _currentCastableSkill = skill;
            castableSkill.OnEndCast   += skill => _currentCastableSkill = null;
        }
    }
예제 #3
0
    private void OnUseThingEndCast(ICastableSkill castableSkill)
    {
        _useThingSkill.OnEndCast -= OnUseThingEndCast;

        if (_useThingSkill.Thing is IStack st)
        {
            _bag.Pull(st);
        }
        else
        {
            _bag.Pull(_lastClickedCell.Item);
        }
    }