- Home /
Non-issue
Array exists, but won't give length???
I have this array:
byte[] rawMap;
void Start() {
rawMap = new byte[921600];
Debug.Log (rawMap.Length); // this outputs 921600 just fine to the console
}
void Update(){
Array.Copy (src, rawMap, rawMap.Length); // FAIL
}
For some reason, the .Length is not recognized. If I set a breakpoint, even in the Start function, the debugger won't show me length. It says "the name rawMap.Length does not exist in the current context." BUT! It shows the array itself, along with the length of it, and all the elements, fine! And Array.Copy fails because it can't resolve .Length on it. I also tried GetLength() and is says no such method. VERY odd. Ideas?
Answer by DaveA · Nov 10, 2011 at 02:13 AM
Well, I don't know why the debugger was doing that, it led me astray. I fixed my problem with some casting (problem turned out to be on 'src' but the debugger wierdness let me think it was rawMap)
Follow this Question
Related Questions
Picking a Random Order for Levers 1 Answer
Adding variables from all scripts 2 Answers
A problem with arrays 1 Answer
Array.length edited using scripts 2 Answers
Different footstep sounds problem! 2 Answers