Sevdat Posted July 21 Posted July 21 (edited) Good morning, How can I change the names of objects to be as a string[] array instead of just string? If I create many objects and I need to detect their names as a path then it would be at O(1) speed to get names for the objects by using arrays than parsing a string with split. For example: Path string: string name = "sphere/1" path string[] string[] name = new string[]{"sphere","1"} If I have many objects, it would be more efficient to use name[0] to check where the object belongs to than to use name.Split() no? So how do I change the source files in Unigine to achive that? I tried this: but it gives the error: Or how can I add an extra struct to the Node so that I can create additional data? for example, name2 Edited July 21 by Sevdat
cash-metall Posted July 22 Posted July 22 Hello. The name inside the engine is a string. and unfortunately there is no way to change this. ----------- alternatively, you can look towards "extension methods" in c# or other "dirty" hacks https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method
Sevdat Posted July 22 Author Posted July 22 (edited) On 7/22/2024 at 10:39 AM, cash-metall said: Hello. The name inside the engine is a string. and unfortunately there is no way to change this. ----------- alternatively, you can look towards "extension methods" in c# or other "dirty" hacks https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/extension-methods https://learn.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/how-to-implement-and-call-a-custom-extension-method Good day cash metall, I wrote every possible combination. I used namespace, classes, static etc. I can't even get it to appear here: Edited July 23 by Sevdat
Recommended Posts