protected override void EndUsage() { if (_caster != null) { base.EndUsage(); if (_skillView != null) { GameObject.Destroy(_skillView.gameObject); _skillView = null; } BaseUnitBehaviour caster = _caster; GameTimer.Instance.FinishCoroutine(Shoot()); Clear(); caster.StartTargetAttack(); } }
protected override void StartUsage() { base.StartUsage(); _shotsLeft = (int)_skillParameters.Duration; _wfs = new WaitForSeconds(0.1f); //duration betweeen attacks StartCooldown(); (_caster.UnitData as BaseHero).UseSkill(_skillParameters); _caster.StopTargetAttack(true); GameObject skillViewResource = Resources.Load(_viewPrefabPath) as GameObject; if (skillViewResource != null) { _skillView = (GameObject.Instantiate(skillViewResource) as GameObject).GetComponent<SkillClipDischargeView>(); } GameTimer.Instance.RunCoroutine(Shoot()); }
protected override void StartUsage() { base.StartUsage(); _shotsLeft = (int)_skillParameters.Duration; _wfs = new WaitForSeconds(0.1f); //duration betweeen attacks StartCooldown(); (_caster.UnitData as BaseHero).UseSkill(_skillParameters); _caster.StopTargetAttack(true); GameObject skillViewResource = Resources.Load(_viewPrefabPath) as GameObject; if (skillViewResource != null) { _skillView = (GameObject.Instantiate(skillViewResource) as GameObject).GetComponent <SkillClipDischargeView>(); } GameTimer.Instance.RunCoroutine(Shoot()); }