Initial Commit
This commit is contained in:
commit
ee5c2f922d
2255 changed files with 547750 additions and 0 deletions
17
Assets/Scripts/Systems/RigidBody2DCopyDataSystem.cs
Normal file
17
Assets/Scripts/Systems/RigidBody2DCopyDataSystem.cs
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
using Unity.Entities;
|
||||
using UnityEngine;
|
||||
|
||||
namespace DefaultNamespace
|
||||
{
|
||||
public class RigidBody2DCopyDataSystem : ComponentSystem
|
||||
{
|
||||
protected override void OnUpdate()
|
||||
{
|
||||
Entities.ForEach(
|
||||
(Rigidbody2D rigidBody, ref RigidBody2DData data) =>
|
||||
{
|
||||
data = new RigidBody2DData { Position = rigidBody.position, Velocity = rigidBody.velocity, Rotation = rigidBody.rotation };
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue