Search Unity

Feature Request uint index for NativeArray

Discussion in 'Burst' started by DevDunk, May 29, 2023.

  1. DevDunk

    DevDunk

    Joined:
    Feb 13, 2020
    Posts:
    5,057
    It would be great if we can use unsigned ints as index in native collections. Especially for mesh generation where uint or ushort is often used for indices.
    Is there a reason this is not added?
     
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    5,948
    Probably because it is totally uncommon to have unsigned indexes in .NET collection types.

    Casting isn't an issue as long as the size stays within the range of the signed type.
     
    DevDunk likes this.