public void InvokeSkill(ActiveSkill skill) { var idleState = stateAnimator.GetBehaviour <IdleState>(); var currentSelectedProgrammer = idleState.SelectedObject.GetComponent <Programmer>(); if (skill is IEffectProducible) { var effectObject = (skill as IEffectProducible).MakeEffect(currentSelectedProgrammer.transform); currentSelectedProgrammer.OnSkillEnded += () => { Destroy(effectObject); }; } if (skill is ISoundProducible) { var effectSoundClip = (skill as ISoundProducible).EffectSound; var audioSource = SoundManager.Instance.FetchAvailableSource(); audioSource.PlayOneShot(effectSoundClip); } var boss = StageManager.Instance.Unit.Boss; currentSelectedProgrammer.UseSkill(); currentSelectedProgrammer.SpendSkillCost(skill.Cost); skill.OnSkillMissed += HandleMissedSkill; skill.ApplySkill(boss, boss.Ability.ProjType, boss.Ability.Techtype); skill.OnSkillMissed -= HandleMissedSkill; objectInformationPresenter.ResetInformationUi(); idleState.ResetSelectedObject(); }