void OnFocus() { if (maxRows <= 0) { maxRows = 30; } if (maxCols <= 0) { maxCols = 11; } Initialize(); LoadDataFromLocal(levelNumber); LevelEditorBase lm = GameObject.FindWithTag("LevelEditor").GetComponent <LevelEditorBase>(); //解决打开错误场景后窗口卡住的问题 if (lm == null) { Debug.LogError("Can't find LevelEditorBase组件!"); window.Close(); } ballTex = new Texture[lm.sprites.Length]; for (int i = 0; i < lm.sprites.Length; i++) { ballTex[i] = lm.sprites[i].texture; } }