mycj_demo/mycj/Assets/Game/Scripts/Application/Object/FBFan.cs
2024-12-02 09:37:47 +08:00

46 lines
1.4 KiB
C#
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// 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);
}
}
}
}