Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Translation, RenderMeshProxy depreciated in 0.0.12 preview 30?

Discussion in 'Graphics for ECS' started by sstrong, Apr 8, 2019.

  1. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,203
    Why are Translation, Rotation, and RenderMeshProxy depreciated in preview 30? What are the replacements?

    upload_2019-4-8_20-21-50.png
     
  2. dartriminis

    dartriminis

    Joined:
    Feb 3, 2017
    Posts:
    157
    I believe they are using GameObjectConversionSystems now. As long as a GameObject has the proper MonoBehaviour components, they should get automatically converted to the proper IComponentData components. For example, any GameObject with a Transform component will get picked up by the TransformConversion system, which will take care of converting the Transform component to the Translation, Rotation, Scale, etc components.
     
    sstrong likes this.
  3. runner78

    runner78

    Joined:
    Mar 14, 2015
    Posts:
    764
    Add "Convert to Entity" to an GameObject and the GO inclusive all children are converted to entity automatically.
     
  4. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,203
    Just started testing with it. Looks like a great new feature.
     
  5. GilCat

    GilCat

    Joined:
    Sep 21, 2013
    Posts:
    676
  6. davenirline

    davenirline

    Joined:
    Jul 7, 2010
    Posts:
    948
    Wait. Does this mean Translation and Rotation components themselves are deprecated? What about entities created by code?
     
  7. Soaryn

    Soaryn

    Joined:
    Apr 17, 2015
    Posts:
    327
    No, just the proxies. They are moving away from the old Proxy like system (the wrappers) to a Conversion system.

    The data structs that go on the entity are not deprecated. Especially since Mike Acton just did a talk on it at GDC
     
  8. sstrong

    sstrong

    Joined:
    Oct 16, 2013
    Posts:
    2,203
    When the following is called, the Translation and Rotation components are automatically added. There is no longer any need to added them to the original prefab or to the entity.

    Code (CSharp):
    1. Entity prefabEntity = GameObjectConversionUtility.ConvertGameObjectHierarchy(prefab.gameObject, World.Active);
    RenderMesh is also automatically added
     
    Last edited: Apr 9, 2019