Files
MRCS/Assets/_MrCs/Scripts/Bullets/GatlingBullet.cs
2025-11-04 14:51:46 +08:00

32 lines
922 B
C#

using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using DragonLi.Frame;
using LitJson;
using Mirror;
using UnityEngine;
public class GatlingBullet : Bullet
{
[Server]
public override void OnSpawn(int ownerIndex, Vector3 recoil, float recoilCount)
{
base.OnSpawn(ownerIndex, recoil, recoilCount);
type = BulletType.GatlingBullet;
BulletInfo bulletInfo = GameManager.Ins.BulletInfos[type][1];
damage = bulletInfo.Damage;
deToughness = bulletInfo.DeToughness;
}
public Dictionary<int, SettleInfo> keyValues = new Dictionary<int, SettleInfo>();
public override void OnApplyDamage(IDamagable damagable)
{
damagable.ApplyDamage(damage, ownerIndex, transform);
if (ownerIndex != -1)
{
GameManager.Ins.AddScore(ownerIndex.ToString(), (int)damage);
}
}
}