mycj_demo/mycj/Assets/Game/Scripts/Application/Object/FBFan.cs

46 lines
1.4 KiB
C#
Raw Normal View History

2024-12-02 09:37:47 +08:00
// Felix-BangFBFan
//   へ     /|
//  /7    ∠_/
//  / │    
//  Z _,    /`ヽ
// │     ヽ   /  〉
//  Y     `  /  /
// イ● 、 ●  ⊂⊃〈  /
// ()  へ    | \〈
//  >ー 、_  ィ  │
//  / へ   / ノ<|
//  ヽ_ノ  (_  │//
//  7       |
//  ―r ̄ ̄`ー―_
// Describe风扇炮塔
// Createtime2018/10/18
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace FBApplication
{
public class FBFan : FBTower
{
private int f_bulletCount = 6;
protected override void Shot(FBMonster monster)
{
base.Shot(monster);
for (int i = 0; i < f_bulletCount; i++)
{
float radians = (Mathf.PI * 2f / f_bulletCount) * i;
Vector3 dir = new Vector3(Mathf.Cos(radians), Mathf.Sin(radians), 0f);
//产生子弹
GameObject go = FBGame.Instance.ObjectPool.Spawn("FanBullet");
FBFanBullet bullet = go.GetComponent<FBFanBullet>();
bullet.transform.position = transform.position;//中心点
bullet.Load(this.UseBulletID, this.Level, this.MapRect, dir);
}
}
}
}