You can’t; that’s the Unityscript Array class. It has nothing to do with C# or built-in arrays. Use the MSDN docs (which should also be used if you’re using Unityscript, because all languages use .NET). If you’re resizing arrays a lot, don’t use them, use List, but if you do occasionally resize an array, use Resize.
I used Array.Resize, worked ok, but now when i’m trying to change the values via checking if its possible, i get soem weird results.
First of all it seems to replace the current values, but at the end of it i get a broken array error. Now when i debuged it, i found some pretty strange things happening, after the 5 value it’s replacing twice and seems like it doesnt know what to replace… it sometimes repalces the previous item … wich is quite not the effect i want haha.
Anyway here is the code i wrote:
void ReplaceArrayValue(float[] array,int check,int max,float replaceValue)
{
if (array.Length==max)
for (int i = 0; i < array.Length; i++)
if (array[i]==array[check])
{
Debug.Log("Replacing " + i + " with "+check+" ("+replaceValue+")");
array[check]=replaceValue;
}
}