Get metadata from tileset

I attempted to get properties in metadata without raycast ,but failed,code is below.I think maybe i make a mistake when getting vertex/triangle index,but i dont know how to do it right.

var tilesets = model.gameObject.GetComponent();
var metadatas = tilesets.GetComponentsInChildren();

if (metadatas != null)
{
foreach (var metadata in metadatas)
{
var feature = metadata.GetComponentsInChildren();
foreach (var fea in feature)
{
var meshfilter = fea.GetComponent();
var index = (int)meshfilter.mesh.GetIndexStart(0);
var featureid = fea.GetFeatureIdFromTriangle(index);

           var table = metadata.propertyTables;
           var pros = table[fea.featureIdSets[0].propertyTableIndex];

           var dic = pros.GetMetadataValuesForFeature(featureid);
           foreach (var d in dic)
           {
               Debug.Log(d.Key);
               string f = "null";
               d.Value.GetString(f);
               Debug.Log(f);
           }            
       }
   }

}

also, I want to know is someway to get extras (in ExtensibleObject.h cesium-unity-native).I consider whether I can get extras in ceisum metadata or other methods?cause MeshPrimitive extends ExtensibleObject.

Hi @ttong1, welcome back!

I would check out the Cesium for Unity Samples project! The scene labeled 05_CesiumMetadata contains an example of how to access metadata by raycasting. You’re welcome to use the script as-is, or reference it for your own code.

Let us know if you have any follow-up questions!

thanks to your reply,I also have seen the `05_CesiumMetadata before.But unlike the use of selecting one tile by raycasting,I want to get some properties on each tile of a tileset,so I did not choose to use public raycast method. i will still have a try,if you have a solution,please tell me.
Refer to extras. Maybe i can have a try,to traverse all tile,attempt to get its gltf model object in C++,and then get the extras(jsonObject) .