Quantcast
Channel: Answers for "Adding and Removing to a Inbuild Array"
Viewing all articles
Browse latest Browse all 4

Answer by Sisso

$
0
0
From docs "**Builtin arrays (native .NET arrays), are extremely fast and efficient but they can not be resized.**" [http://docs.unity3d.com/Documentation/ScriptReference/Array.html][1] Option A. You must use a resizable collection. var array = new Array(); array.Add("yeah"); Option B. Temporary move to a resizable collection. var array = ["one", "two"]; var ar = new Array(array); ar.Add("tree"); array = ar.ToBuiltin(String); Option C. Resize the array var array = ["one", "two"]; System.Array.Resize.(array, array.length + 1); array[array.length-1] = "tree"; Option D. Be creative PS: I write now by hand, don't expect everything to compile [1]: http://docs.unity3d.com/Documentation/ScriptReference/Array.html

Viewing all articles
Browse latest Browse all 4

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>