public override void DoBasicAttack() { GameObject magicBoltInstance = Instantiate(magicBolt, movement.transform.position + movement.transform.right * 0.5f + movement.transform.forward * 1.5f + movement.transform.up * 1.1f, Quaternion.LookRotation(movement.transform.forward, new Vector3(0.0f, 1.0f, 0.0f))) as GameObject; DamageProjectile script = magicBoltInstance.GetComponent <DamageProjectile>(); script.SetDirection(movement.transform.forward); }
private void SpawnArrow() { GameObject movingArrow = Instantiate(arrow, transform.position + transform.forward + transform.up * 1.7f, Quaternion.LookRotation(transform.forward, new Vector3(1.0f, 0.0f, 0.0f)) * Quaternion.Euler(90.0f, 0.0f, 0.0f)) as GameObject; DamageProjectile script = movingArrow.GetComponent <DamageProjectile>(); script.SetDirection(transform.forward); script.SetDamage(damage); }
public void SpawnArrow() { GameObject movingArrow = Instantiate(arrow, playerMovement.transform.position + playerMovement.transform.forward * 0.7f + playerMovement.transform.up * 1.35f, Quaternion.LookRotation(playerMovement.transform.forward, new Vector3(1.0f, 0.0f, 0.0f)) * Quaternion.Euler(90.0f, 0.0f, 0.0f)) as GameObject; DamageProjectile script = movingArrow.GetComponent <DamageProjectile>(); script.SetDamage(baseDamage); script.SetSpeed(arrowSpeed); script.SetDirection(playerMovement.transform.forward); }
private void Damage(DamageProjectile damageProjectile) { healthEnemy -= damageProjectile.GetDamage(); damageProjectile.Hit(); if (healthEnemy <= 0) { DieEnemy(); } }
private void OnTriggerEnter2D(Collider2D other) { DamageProjectile damageProjectile = other.GetComponent <DamageProjectile>(); if (!damageProjectile) { return; } Damage(damageProjectile); //ProcessHit }
public override void DoAttack() { Vector3 arrowDirection = target.position - position.position; GameObject movingArrow = Instantiate(arrow, position.position + position.forward * 0.7f + position.up * 1.5f, Quaternion.LookRotation(arrowDirection, new Vector3(1.0f, 0.0f, 0.0f)) * Quaternion.Euler(90.0f, 0.0f, 0.0f)) as GameObject; DamageProjectile script = movingArrow.GetComponent <DamageProjectile>(); script.SetDamage(damage); script.SetDirection(movingArrow.transform.up); }
private void Damage(DamageProjectile damageProjectile) { healthMeteorite -= damageProjectile.GetDamage(); damageProjectile.Hit(); if (healthMeteorite <= 0) { DieMeteorite(); } }
public override void DoAttack() { Vector3 spellDirection = target.position - position.position; GameObject fireballInstance = Instantiate(fireball, position.position + position.forward * 2.0f + position.up * 1.1f, Quaternion.LookRotation(spellDirection, new Vector3(0.0f, 1.0f, 0.0f))) as GameObject; DamageProjectile script = fireballInstance.GetComponent <DamageProjectile>(); script.SetDamage(damage); script.SetOwner(ProjectileOwner.Enemy); script.SetDirection(fireballInstance.transform.forward); }
public void SpawnArrowFan() { for (int i = -2; i < 3; i++) { GameObject movingArrow = Instantiate(arrow, playerMovement.transform.position + playerMovement.transform.forward * 0.7f + playerMovement.transform.up * 1.35f, Quaternion.LookRotation(playerMovement.transform.forward, new Vector3(1.0f, 0.0f, 0.0f)) * Quaternion.Euler(90.0f, 0.0f, 0.0f) * Quaternion.Euler(i * 25.0f, 0.0f, 0.0f)) as GameObject; if (playerMovement.transform.forward == Vector3.right || playerMovement.transform.forward == Vector3.left) { movingArrow.transform.rotation = Quaternion.LookRotation(playerMovement.transform.forward, new Vector3(1.0f, 0.0f, 0.0f)) * Quaternion.Euler(90.0f, 0.0f, 0.0f) * Quaternion.Euler(0.0f, 0.0f, i * 25.0f); } DamageProjectile script = movingArrow.GetComponent <DamageProjectile>(); script.SetDamage(baseDamage * 1.2f); script.SetSpeed(arrowSpeed); script.SetDirection(movingArrow.transform.up); } }