FireBallShot.cs 835 B

123456789101112131415161718192021222324252627282930313233
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class FireBallShot : SpecialSkills
  5. {
  6. [Header("弓箭预制体")]
  7. public GameObject arrow;
  8. [Header("齐发参数")]
  9. public int num;
  10. public float angle;
  11. public float arrivalAngle;
  12. public int damage;
  13. public bool tryy;
  14. public float gravity = 9.8f; // 重力加速度
  15. public float speed;
  16. public override void Attack()
  17. {
  18. base.Attack();
  19. Shoot();
  20. }
  21. public void Shoot()
  22. {
  23. GameObject obj = PoolManager.Instantiate(arrow);
  24. obj.GetComponent<Bullet>().BeShoot(owner);
  25. FireBallController fireBallController = obj.GetComponent<FireBallController>();
  26. fireBallController.Launch(owner.targetCharacter.transform,transform.position + Vector3.up, 10);
  27. }
  28. }