2D-Platformer/Assets/Scripts/Systems/Actor/ActorBoundCopySystem.cs
2022-02-12 12:53:50 +02:00

18 lines
No EOL
403 B
C#

using Unity.Entities;
using UnityEngine;
namespace DefaultNamespace
{
public class ActorBoundCopySystem : ComponentSystem
{
protected override void OnUpdate()
{
Entities.ForEach(
(CapsuleCollider2D collider, ref ActorBoundsData actorBounds) =>
{
var bounds = collider.bounds;
actorBounds = new ActorBoundsData { Rect = new Rect(bounds.min, bounds.size) };
});
}
}
}