private void OnEndSkillCast(ICastableSkill skill) { if (skill is UseThing useThingSkill) { if (useThingSkill.Thing == _usableThing) { var gameObj = ThingsBehaviour.Instance.Things[_usableThing]; gameObj.SetActive(false); } } }
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; } }
private void OnUseThingEndCast(ICastableSkill castableSkill) { _useThingSkill.OnEndCast -= OnUseThingEndCast; if (_useThingSkill.Thing is IStack st) { _bag.Pull(st); } else { _bag.Pull(_lastClickedCell.Item); } }