(client) feat:实现子弹定义 chore:将建筑碰撞体改为方形
This commit is contained in:
18
Client/Assets/Scripts/Entity/Bullet.cs
Normal file
18
Client/Assets/Scripts/Entity/Bullet.cs
Normal file
@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Entity
|
||||
{
|
||||
public class Bullet:Entity
|
||||
{
|
||||
protected override void AutoBehave()
|
||||
{
|
||||
TryMove();
|
||||
}
|
||||
|
||||
private void OnTriggerEnter2D(Collider2D other)
|
||||
{
|
||||
other.GetComponent<Entity>()?.OnHit(this);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user