| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- using Sirenix.OdinInspector;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class FanFlyingSwords : MonoBehaviour
- {
- public GameObject sword;
- public PlayerController owner;
- public float angleRange;
- public float arrivalAngle;
- public int swordsNum;
- public int damage;
- [LabelText("»÷´òÖµ")] public int attackValue;
- public void Biu()
- {
- float angleInterval = angleRange / (float)(swordsNum - 1);
- for (int i = 0; i < swordsNum; i++)
- {
- float angle = 0;
- GameObject obj = PoolManager.Instantiate(sword);
- Vector3 dir = Vector3.zero;
- if(owner.bodyTrans.localScale.x > 0)
- {
- angle = 180 - arrivalAngle - angleRange/2 + i * angleInterval;
- }
- else
- {
- angle = arrivalAngle -angleRange / 2 + i * angleInterval;
- }
- angle = angle / 180 * Mathf.PI;
- dir = new Vector3(Mathf.Cos(angle), Mathf.Sin(angle), 0);
- AttackController.AttackMethod attackMethod = owner.attackController.curAttackMethod;
- attackMethod.attackInfo.damage = damage;
- attackMethod.attackInfo.attackValue = attackValue;
- obj.GetComponent<Bullet>().BeShoot(owner, owner.transform.position + Vector3.up, dir, false, attackMethod: attackMethod);
- }
-
- }
- }
|