Search Unity

What did MoveForward and MoveSpeed get changed to?

Discussion in 'Entity Component System' started by Kobaltic1, Nov 17, 2018.

  1. Kobaltic1

    Kobaltic1

    Joined:
    Jan 22, 2015
    Posts:
    183
    I have this code:

    Code (CSharp):
    1.  
    2. EntityCommandBuffer.AddSharedComponent(new  MoveForward());
    3.  EntityCommandBuffer.AddComponent(new MoveSpeed { speed = 6 });
    4.  
    No namespace found for both of them. I am using Unity.Transforms. I am trying to figure out what they are now. Also where can I find documentation on these changes?

    Whole file:
    Code (CSharp):
    1. using Unity.Collections;
    2. using UnityEngine;
    3. using Unity.Entities;
    4. using Unity.Jobs;
    5. using Unity.Transforms;
    6.  
    7. public class FiringSystem : JobComponentSystem
    8. {
    9.  
    10.     [Inject] private FiringBarrier _barrier;
    11.  
    12.     protected override JobHandle OnUpdate(JobHandle inputDeps)
    13.     {
    14.         return new FiringJob
    15.         {
    16.             EntityCommandBuffer = _barrier.CreateCommandBuffer()
    17.         }.Schedule(this, inputDeps);
    18.     }
    19.  
    20.     private struct FiringJob : IJobProcessComponentData<Firing, Position, Rotation>
    21.     {
    22.         public EntityCommandBuffer EntityCommandBuffer;
    23.         public void Execute(ref Firing firing, ref Position position, ref Rotation rotation)
    24.         {
    25.             EntityCommandBuffer.CreateEntity();
    26.             EntityCommandBuffer.AddSharedComponent(BootStrap.BulletRenderer);
    27.             EntityCommandBuffer.AddComponent(new LocalToWorld());
    28.             EntityCommandBuffer.AddSharedComponent(new  MoveForward());
    29.             EntityCommandBuffer.AddComponent(new MoveSpeed { speed = 6 });
    30.             EntityCommandBuffer.AddComponent(position);
    31.             EntityCommandBuffer.AddComponent(rotation);
    32.         }
    33.     }
    34.  
    35.     private class FiringBarrier : BarrierSystem
    36.     {
    37.  
    38.     }
    39. }
     
  2. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
    They got removed :( . I don't believe these specific changes are documented, but you can find the release notes for ECS here.
     
  3. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,759