GameObjectConversionSystem dissappeared in 1.0.0-pre.15. What happened with it?

Hello,

I have been using parts of Physics Samples code to lock physics to less axis of freedom (keep it 2D).
I just upgraded to latest entities/physics packages and GameObjectConversionSystem has disappeared and code sample is not compiling.

How should I refactor code depending on it?

-Evgeni

GameObjectConversionSystems are gone in favor of Bakers and BakingSystems.

https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/upgrade-guide.html

1 Like

I gave up on using the new package. It was not the only issue I had.

Hey @Evgeni_Incineration , as @thelebaron said before Bakers are the new workflow instead of GameObjectConversionSystems. Please, if you encounter any issues let us know it. :slight_smile:

Basic Baker
This example shows how to change the usage of IConvertGameObjectToEntity to a Baker:

public struct MyComponent : IComponentData
{
   public float Value;
}

// BEFORE
public class MyMonoBehaviour : MonoBehaviour, IConvertGameObjectToEntity
{
   public float value;

   public void Convert(Entity entity, EntityManager dstManager,
       GameObjectConversionSystem conversionSystem)
   {
       dstManager.AddComponentData(entity, new MyComponent {Value = value});
   }
}


// AFTER
public class MyMonoBehaviour : MonoBehaviour
{
   public float value;
}

public class MyBaker : Baker<MyMonoBehaviour>
{
   public override void Bake(MyMonoBehaviour authoring)
   {
      AddComponent(new MyComponent {Value = authoring.value} );
   }
}
1 Like

I would recommend updating Physics Samples.

1 Like

Physics Samples are regularly updated internally and released after the official announcement. Please stay tuned.

Still waiting for update to Physics samples.

@Evgeni_Incineration thank you for your patience. You can find the physics samples updated here EntityComponentSystemSamples/PhysicsSamples at master · Unity-Technologies/EntityComponentSystemSamples · GitHub

3 Likes

<3