The main adventage of TArray in comparison to others is that this solution combines unbelievably simple and low amout of code [totally 180 lines] with nearly every expected feature, beacuse of fullness of well-written approaches.
Another is that the TArray is not a class like many other extended arrays, but still a structure like classic array - so it is really fast and memory safe and friendly, and also support enumerations and LINQ expressions natively.
- Using Unity Git packages support:
Toolabar->Window/PackageManager->+->AddpackagefromGitURL->"https://github.com/ovsky/TArray.git#upm"- Unity Git URL suppport, by adding this entry in your packages manifest.json:
"com.ovsky.tarray": "https://github.com/ovsky/TArray.git#upm"- Using Unity tarball support and wget [Linux] or start [Windows] download:
Linux: "wget https://github.com/ovsky/TArray/tarball/upm -O ovsky.tarray-upm.tgz"
Windows: "start https://github.com/ovsky/TArray/tarball/upm"Use: Toolabar->Window/PackageManager->+->Addpackagefromtarball->Select: "ovsky.tarray-*.tgz"The upm stands for Unity Package Manager - the default manager for Unity-ready external packages/extensions.
Multiple declaration possibilities:
TArray<int>integerArray=newTArray<int>(5,5);// Classic declarationTArray<int>integerArray=newint[5,5];// Array attributed declarationTArray<int>integerArray=newArray[5,5];// Classic array declarationTArray<int>integerArray=new(5,5);// Modern .NET declarationEasy conversion support:
TArray<int>integerArray=stringArray.Cast<int>();// Convert string to int arrayTArray<string>stringArray=customArray.Cast<string>();// Convert custom to string arrayDifferent value get/set options:
intelement=integerArray[2,2];// Get value using attributesintelement=integerArray.Get(2,2);// Get value using methodintegerArray[2,2]=1;// Set value using attributesintegerArray.Set(2,2,1);// Set value using methodAll LINQ operations support:
TArray<Pets>petsArray=petsArray.Array.OrderBy(pet =>pet.Age).ToArray();// Sort class array by class property valueTArray<Pets>dogsArray=petsArray.Array.Select(pet =>petisDog).ToArray();// Select Dogs from Pets arrayTArray<int>integerArray=integerArray.Array.OrderBy(i =>i).ToArray();// Sort int array valuesType-free array operations:
ITArrayvalueArray;valueArray=newTArray<int>(5,5);// Declare int array at the fieldvalueArray=valueArray.Cast<string>();// Cast the array to string values and apply to undefined fieldvalueArray=newTArray<bool>(5,5).Set(0,0,true);// Then change it to bool array with (0, 0) set to trueTArray<bool>boolArray=valueArray;// Apply the undefined value array to array with defined typeAnd more!
TArray Editor (Property Drawer actually) - is an extendable, flexible, and the most important: it supports all serializable types (existing and user-defined) out of the box, without creating the new Unity Inspector or Editor!
Copyright (C) 2023 - Przemysław Orłowski
"THE SOFTWARE IS PROVIDED 'AS IT IS' (...)"
also known as:
**The MIT License**: https://choosealicense.com/licenses/mit/



