public void InitializeGameData() { string tData = Datas.CreateInstance <Datas>().GetData()[GameData.instance.currentLevel];//Getting the TextAsset data A/C level levelData = SimpleJSON.JSONArray.Parse(tData); bsize = int.Parse(levelData["r"]); //The required color array colors = new Color[] { Color.clear, Color.red, Color.green, Color.blue, new Color(1f, 165f / 255f, 0), new Color(128 / 255f, 0, 128 / 255f) }; ColorData = new int[bsize * bsize]; DotColorData = new int[bsize * bsize]; dotPoses = levelData["l"];//this is the pathe between 2 dots GameData.instance.paths = new List <List <int> >(); List <int> tpath0 = new List <int>();//the clear color path GameData.instance.paths.Add(tpath0); for (int i = 0; i < dotPoses.Count; i++) { List <int> tpath = new List <int>(); GameData.instance.paths.Add(tpath); } winLinkCount = dotPoses.Count; linkedLines = new int[GameData.instance.paths.Count + 1]; }