Files
MRCS/Assets/_MrCs/Scripts/Bullets/PistolBullet.cs

38 lines
892 B
C#

using System.Collections;
using System.Collections.Generic;
using DragonLi.Frame;
using Mirror;
using UnityEngine;
public class PistolBullet : Bullet
{
[Server]
public override void OnSpawn(int ownerIndex, Vector3 recoil, float recoilCount,float time)
{
base.OnSpawn(ownerIndex, recoil, recoilCount,time);
type = GunType.Pistol;
GunInfo bulletInfo = GameManager.Ins.GunInfos[type][1];
damage = bulletInfo.Damage;
}
public override void OnApplyDamage(IDamagable damagable)
{
damagable.ApplyDamage(damage, ownerIndex, transform);
}
[Server]
public override void OnHitPlayer(int index)
{
Debug.Log(index + "玩家受击");
if (index == 0)
{
GameManager.Ins.redScore += 2;
}
else
{
GameManager.Ins.blueScore += 2;
}
}
}