//지속 공격 public IEnumerator DeleyDamege(CollisionHit collisionHit, float damage, float deley, int index, bool critical) { m_bHit = true; yield return(new WaitForSeconds(deley)); List <Vector3> vector = collisionHit.ListCollisions(m_AttackBounds); if (vector.Count > 0 && m_bHit) { for (int i = 0; i < vector.Count; ++i) { if (critical) { collisionHit.PhysicsEffs((vector[i] - transform.position).normalized * 0.5f, i, 0, (int)damage * 2, 2, 0, true); m_fShake = 0.13f; } else { collisionHit.PhysicsEffs((vector[i] - transform.position).normalized * 0.1f, i, 0, (int)damage, 2, 0, false); m_fShake = 0.09f; } collisionHit.HitShakeCamera(0.1f, m_fShake); } m_bHit = false; } critical = Critical(); StartCoroutine(DeleyDamege(collisionHit, damage, deley, index, critical)); }
public void Damage(Vector3 vec, PlayerChain playerChain, CollisionHit collisionHit, float damage, float deley, float stop, int index, int critical) { bool _bCritical; m_AttackBounds.center = transform.position; m_AttackBounds.extents = vec; playerChain.GetPlayer(index, transform.position); m_nCritical = critical; _bCritical = Critical(); switch (index) { case 3: StartCoroutine(DeleyDamege(collisionHit, damage, deley, index, _bCritical)); break; case 4: List <Vector3> vector = collisionHit.ListCollisions(m_AttackBounds); if (vector.Count > 0) { for (int i = 0; i < vector.Count; ++i) { if (_bCritical) { AIController _aIController = collisionHit.PhysicsEffs((vector[i] - transform.position).normalized * 0.5f, i, 0, (int)damage * 2, 2, 1, true); m_fShake = 0.13f; } else { AIController _aIController = collisionHit.PhysicsEffs((vector[i] - transform.position).normalized * 0.1f, i, 0, (int)damage, 2, 1, false); m_fShake = 0.09f; collisionHit.Freezing(_aIController); } collisionHit.HitShakeCamera(0.1f, m_fShake); } } break; } Destroy(gameObject, stop); }
public virtual void BulletMove() { bool _bCritical = Critical(); if (m_fRemove >= m_fLiveTime) { gameObject.SetActive(false); m_fRemove = 0; } List <Vector3> _vector = m_CollisionHit.ListCollisions(m_AttackRange); if (_vector.Count > 0 && m_bHit) { for (int i = 0; i < _vector.Count; ++i) { if (_bCritical) { m_CollisionHit.PhysicsEffs((_vector[i] - transform.position).normalized * 0.5f, i, 0, (int)m_fDamage * 2, 1, 0, true); } else { m_CollisionHit.PhysicsEffs((_vector[i] - transform.position).normalized * 0.1f, i, 0, (int)m_fDamage, 1, 0, false); } } if (_bCritical) { m_fShake = 0.13f; } else { m_fShake = 0.09f; } m_CollisionHit.HitShakeCamera(0.1f, m_fShake); m_bHit = false; } }