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. Dismiss Notice

Question Handling managed components

Discussion in 'Entity Component System' started by J_Revel, Jun 13, 2023.

  1. J_Revel

    J_Revel

    Joined:
    Nov 22, 2021
    Posts:
    6
    Hello !
    I'm trying to understand how managed components work, but it seems they are barely cited in the documentation. It is explained how to declare them, but not how to attach them to entities. AddComponent does not allow to provide the component to add for managed objects, and it does not seem to add anything, as I get nothing querying it afterwards with SystemAPI.ManagedAPI.GetComponent.
    I must be missing something obvious or misunderstand something, but I can't find anything useful in the docs.
    Any clue ? Thanks in advance !
     
  2. FaithlessOne

    FaithlessOne

    Joined:
    Jun 19, 2017
    Posts:
    256
    J_Revel likes this.
  3. J_Revel

    J_Revel

    Joined:
    Nov 22, 2021
    Posts:
    6
    Thank you, that's what I was looking for ! Yeah I call it managed component since it's called that way in the docs : https://docs.unity3d.com/Packages/com.unity.entities@1.0/manual/components-managed.html
    I just found AddComponentObject that does the same thing in Bakers, the naming does not feel consistent at all, but it works !