/// <summary> /// index == 0 : 기본공격 /// index == 1 : SpellAttack(SpellAttack은 종류가 여러가지임) /// index == 2 : JumpAttack /// </summary> public override void OnStartAttackEvent(int index) { base.OnStartAttackEvent(index); switch (index) { case SKILL_IDX_ATTACK: // 기본 공격 { SkillUtility.SimpleRangeDamage(this, this.hone.position, 1.5f, this.unitSide, this.defaultDamage, PrefabPath.Particle.FireHit, SoundKeys.EFFECT_HIT_SOUND); SoundManager.inst.PlaySound(SoundKeys.EFFECT_PUNCH, this.hone.position); } break; case SKILL_IDX_BULLET_ATTACK: { if (this.spell == SpellAttackKind.Direct) // 360 샷 { this.skillModule.skills[SKILL_IDX_BULLET_ATTACK].Action(); } else if (this.spell == SpellAttackKind.Summon) // 소환 { this.skillModule.skills[SKILL_IDX_SUMMON].Action(); } else if (this.spell == SpellAttackKind.SpiderWeb) // 거미줄(일부로 하드코딩 했음) { for (int i = 0; i < 2; i++) { SpiderWeb web = ObjectPoolManager.inst.Get <SpiderWeb>(PrefabPath.SpiderWeb); web.transform.position = this.transform.position; web.Init(this, Vector2.one * (Random.Range(-1.0f, 1) + 3)); web.PlayAnimation(KUtils.SamplePosition_NavMesh(this.transform.position + new Vector3(Random.Range(-5, 5), 0, Random.Range(-5, 5)))); SoundManager.inst.PlaySound(SoundKeys.EFFECT_CREATE_SPIDER_WEB, this.transform.position); } } } break; case SKILL_IDX_JUMP_ATTACK: // 점프공격 { this.skillModule.skills[SKILL_IDX_JUMP_ATTACK].Action(); } break; } }
public override void OnStartAttackEvent(int index) { base.OnStartAttackEvent(index); switch (this.attackType) { case DefaultAttackType.Melee: SkillUtility.SimpleRangeDamage(this, this._firePivot.position, 1.5f, this.unitSide, this.defaultDamage, PrefabPath.Particle.FireHit, SoundKeys.EFFECT_HIT_SOUND); SoundManager.inst.PlaySound(SoundKeys.EFFECT_PUNCH, this._firePivot.position); break; case DefaultAttackType.ParabolaBomb: { //타겟이 없으면 안쏨 if ((this.controller as SimpleAIController).target == null) { return; } // 불릿 생성후 발사 var bullet = ObjectPoolManager.inst.Get <BombBullet>(PrefabPath.Projectile.BombBullet); bullet.transform.position = this._firePivot.transform.position; // 불릿 초기화 및 발사 bullet.Init(this, 1, 10); bullet.range = 1; bullet.FireParabola((this.controller as SimpleAIController).target.transform.position); } break; case DefaultAttackType.CircularSector: SoundManager.inst.PlaySound(SoundKeys.EFFECT_DEFAULT_ATTACK, this._firePivot.position); StartCoroutine(SkillUtility.FireProjectile_CircularSector(this, this._firePivot.position, 3, 3, 3, 90, 1, 0.5f)); break; default: break; } }