Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
18
Assets/Scripts/Systems/ProjectileSystem.cs
Normal file
18
Assets/Scripts/Systems/ProjectileSystem.cs
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
public class ProjectileRemoveSystem : ComponentSystem
|
||||
{
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
Entities.ForEach(
|
||||
(Entity entity, Transform transform, ref ProjectileData projectile) =>
|
||||
{
|
||||
if (projectile.Life <= 0)
|
||||
{
|
||||
Object.Destroy(transform.gameObject);
|
||||
PostUpdateCommands.DestroyEntity(entity);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue