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

How is NetworkConnection a blittable type?

Discussion in 'Entity Component System' started by RyancHaynes, Nov 24, 2020.

  1. RyancHaynes

    RyancHaynes

    Joined:
    Dec 8, 2018
    Posts:
    11
    In the unity Transport preview the JobifiedServerBehaviour uses a NativeList<NetworkConnections>
    How is it that NetworkConnections is a blittable type? Is there workflow for creating your own blittable types that you can store in native containers? Or is because theres some implicit formatting of the data in the NativeContainer that the container automatically knows how to marshal the data into unmanaged memory as such that doesn't need to be blittable?
     
  2. tertle

    tertle

    Joined:
    Jan 25, 2011
    Posts:
    3,627
    Why do you think NetworkConnection wouldn't be blittable?

    It's just a struct with 2 int fields

    internal int m_NetworkId;
    internal int m_NetworkVersion;
     
    manpower13 and dannyalgorithmic like this.
  3. RyancHaynes

    RyancHaynes

    Joined:
    Dec 8, 2018
    Posts:
    11
    Yea makes sense...