private IEnumerator SkillPrepare() { if (_caster.UnitAttack.State == EUnitAttackState.WatchTarget) { //if (_caster.UnitPathfinder.CurrentState == EUnitMovementState.WatchEnemy) _caster.StopTargetAttack(true); } _caster.CastingSkill = true; _caster.ModelView.PlaySkillAnimation(ESkillKey.ExplosiveCharges); yield return(new WaitForSeconds(_skillParameters.CastTime)); GameObject skillViewGO = GameObject.Instantiate(Resources.Load(_viewPrefabPath) as GameObject) as GameObject; if (skillViewGO != null) { _skillView = skillViewGO.GetComponent <SkillExplosiveChargesView>(); _skillView.Run(_caster); } _caster.CastingSkill = false; if (_caster.UnitAttack.State == EUnitAttackState.WatchTarget) { //if (_caster.UnitPathfinder.CurrentState == EUnitMovementState.WatchEnemy) _caster.StartTargetAttack(); } }
protected override void Clear() { base.Clear(); if (_skillView != null) { _skillView.End(); _skillView = null; } _shotsLeft = -1; }
private IEnumerator SkillPrepare() { if (_caster.UnitAttack.State == EUnitAttackState.WatchTarget) //if (_caster.UnitPathfinder.CurrentState == EUnitMovementState.WatchEnemy) _caster.StopTargetAttack(true); _caster.CastingSkill = true; _caster.ModelView.PlaySkillAnimation(ESkillKey.ExplosiveCharges); yield return new WaitForSeconds(_skillParameters.CastTime); GameObject skillViewGO = GameObject.Instantiate(Resources.Load(_viewPrefabPath) as GameObject) as GameObject; if (skillViewGO != null) { _skillView = skillViewGO.GetComponent<SkillExplosiveChargesView>(); _skillView.Run(_caster); } _caster.CastingSkill = false; if (_caster.UnitAttack.State == EUnitAttackState.WatchTarget) //if (_caster.UnitPathfinder.CurrentState == EUnitMovementState.WatchEnemy) _caster.StartTargetAttack(); }