This commit is contained in:
wulongxiao 2024-12-25 16:47:54 +08:00
parent bd0c31fcf2
commit 729442fafa
2 changed files with 58 additions and 55 deletions

View File

@ -119,15 +119,20 @@ public class Bullet : MonoBehaviour
private void OnTriggerEnter2D(Collider2D collision) private void OnTriggerEnter2D(Collider2D collision)
{ {
if (NumberOfBulletAttacks > 0)
{
NumberOfBulletAttacks -= 1;
//Debug.Log("½øÈë¼ì²â·¶Î§");
Role Crole = collision.gameObject.GetComponent<Role>(); Role Crole = collision.gameObject.GetComponent<Role>();
if (Crole) if (Crole)
{ {
if (Crole.camp != role.camp) if (Crole.camp != role.camp)
{ {
if (NumberOfBulletAttacks < 0)
{
return;
}
else
{
NumberOfBulletAttacks -= 1;
}
foreach (var buff in role.storageBuff) foreach (var buff in role.storageBuff)
{ {
if (!Crole.PlayerBuff.Contains(buff)) if (!Crole.PlayerBuff.Contains(buff))
@ -186,7 +191,6 @@ public class Bullet : MonoBehaviour
} }
} }
}
if (bulletAttributes == BulletAttributes.Water) //ˮ if (bulletAttributes == BulletAttributes.Water) //ˮ
{ {
@ -202,13 +206,8 @@ public class Bullet : MonoBehaviour
} }
} }
} }
} }
else
{
}
} }
private float lastDamageTime = 0f; private float lastDamageTime = 0f;
private void OnTriggerStay2D(Collider2D collision) private void OnTriggerStay2D(Collider2D collision)

View File

@ -36,6 +36,10 @@ public enum CharacterFlags
land = 1 << 1, land = 1 << 1,
big = 1 << 2, big = 1 << 2,
min = 1 << 3, min = 1 << 3,
FlyBig=fly|big,
FlyMin=fly|min,
LandBig = land | big,
LandMin = land | min,
} }
/// <summary> /// <summary>