I faced the problem that I cannot look at the contents of variables under debugging, for example List<int> t1 int[] t2 and int t3 . Error reported: The name 't' doe not exist in current context . Variables are declared and then initialized through out inside another function. There they are really initialized. Purely for checking manually assigned values int[] t2 = new[] {5, 6, 7}; and still the same error when you look at them under debugging. However, the data itself in the variables are present! I make this conclusion based on the fact that if you output them to the foreach (var i in t) Debug.Log(i); console foreach (var i in t) Debug.Log(i); then they are output normally. Tell me how to solve the problem?
UPD: Comrades ... t error message was written intentionally, in order to generalize errors to each of the variables and not to write: "... for example List<int> t1 int[] t2 and int t3 . Errors are reported: The name 't1' does not exist in current context. , The name 't2' does not exist in current context. , The name 't3' does not exist in current context. "respectively. But still I had to write it!
UPD2: The code is as follows:
private IEnumerator Update() { yield return null; while (true) { if (!_sourceDataIsReady) yield return null; _sourceDataIsReady = false; // кое-что делаю... bool chessboardFound; Point2f[] corners; chessboardFound = Cv2.FindChessboardCorners(_matGrayFrame, _pattern.size, out corners, ChessboardFlags.FastCheck); // вот здесь, после выполнения функции, // не было видно переменных chessboardFound и corners // и снова делаю что-то } } For the test I used the following code:
private IEnumerator Update() { yield return null; while (true) { List<int> t1 = new List<int>() {5,6,7}; int[] t2 = new [] {5,6,7}; int t3 = 5 for (var i=0; i<3; i++){ Debug.Log($"List i: {t1[i]}"); Debug.Log($"Array i: {t2[i]}"); } Debug.Log($"Int: {t3}"); } }
terror message was written intentionally to summarize the errors to each of the variables and not to write: "... for exampleList<int> t1int[] t2andint t3. Errors are reported:The name 't1' does not exist in current context.The name 't2' does not exist in current context.The name 't1' does not exist in current context.,The name 't2' does not exist in current context.,The name 't3' does not exist in current context.. " But still I had to write it! - GoodSimon