void Start() { FingerGestures.OnFingerTap += FingerGestures_OnFingerTap; bool noError; noError = PListManager.ParsePListFile(gameData.text, ref gameDataTable); if (noError) { allPositions = (Hashtable)gameDataTable["positions"]; availableAnimals = (ArrayList)gameDataTable["availableAnimals"]; } else { //next game AGGameState.loadNextGameInLoop(AGGameIndex.k_MemoryAnimal); } dataManager = new MADataManager(AGGameIndex.k_MemoryAnimal, 0, progression.text); ickyAnimations = ickyModel.GetComponent <MAIckyAnimations>(); nextQuestion(); }
public void loadDataForAllGames(string file) { progressionData = null; bool noError = PListManager.ParsePListFile(file, ref progressionData); if (noError) { allCateriesData = (ArrayList)progressionData["PreSchoolGames"]; } else { Debug.Log("cannot access progression data"); } }
public void loadCategoryResources(string _resourcesData) { Hashtable localData = null; bool noError = PListManager.ParsePListFile(_resourcesData, ref localData); if (noError) { resourcesData = (Hashtable)localData["Resources"]; } else { Debug.Log("cannot access progression data"); } categoryDataResources = (Hashtable)resourcesData[catergoryName]; }
// -------- read plist data void parsePlist() { allPositionsHashTable = new ArrayList(); bool noError; noError = PListManager.ParsePListFile(gameData.text, ref gameDataTable); if (noError) { allHidingSpots = (ArrayList)gameDataTable["AllHidingSpots"]; } Debug.Log("AllHidingSpots: " + allHidingSpots); for (int i = 0; i < allHidingSpots.Count; i++) { allPositionsHashTable.Add(allHidingSpots[i]); Debug.Log("Hiding Spot: " + allHidingSpots[i]); } }
public void ParsePolygonsFromFile() { this.ClearBodiesList(); if (PlistPath == null) { return; } Hashtable plistData = new Hashtable(); PListManager.ParsePListFile(PlistPath.text, ref plistData); Hashtable bodies = plistData["bodies"] as Hashtable; if (bodies == null) { Debug.Log("Bodies not found"); } ArrayList keyNames = new ArrayList(bodies.Keys); _totalPolygonsinFile = new PolygonObject[keyNames.Count]; if (keyNames != null) { for (int i = 0; i < keyNames.Count; i++) { _totalPolygonsinFile[i] = new PolygonObject(); _totalPolygonsinFile[i].bodyname = keyNames[i] as String; Hashtable bodyDic = bodies[keyNames[i]] as Hashtable; ArrayList fixtures = bodyDic["fixtures"] as ArrayList; var totalPaths = new List <PolygonPath>(); for (var f = 0; f < fixtures.Count; f++) { var fixture = fixtures[f] as Hashtable; if (fixture == null) { continue; } var polygonsArray = fixture["polygons"] as ArrayList; if (polygonsArray == null) { continue; } for (int j = 0; j < polygonsArray.Count; j++) { ArrayList pointArray = polygonsArray[j] as ArrayList; PolygonPath tempPath = new PolygonPath(); Vector2[] pointsVector = new Vector2[pointArray.Count]; for (int k = 0; k < pointsVector.Length; k++) { string pointInString = pointArray[k] as String; pointsVector[k] = this.ConvertToVector2FromString(pointInString); } tempPath.points = pointsVector; totalPaths.Add(tempPath); } } _totalPolygonsinFile[i].paths = totalPaths.ToArray(); } Array.Sort(_totalPolygonsinFile); this.setPolygonOfIndex(selectedIndex); } else { Debug.Log("Keys not found"); } }
public void ParsePolygonsFromFile() { this.ClearBodiesList(); if (PlistPath == null) { return; } Hashtable plistData = new Hashtable(); PListManager.ParsePListFile(PlistPath.text, ref plistData); Hashtable bodies = plistData["bodies"] as Hashtable; if (bodies == null) { Debug.Log("Bodies not found"); } ArrayList keyNames = new ArrayList(bodies.Keys); _totalPolygonsinFile = new PolygonObject[keyNames.Count]; if (keyNames != null) { for (int i = 0; i < keyNames.Count; i++) { _totalPolygonsinFile[i] = new PolygonObject(); _totalPolygonsinFile[i].bodyname = keyNames[i] as String; Hashtable bodyDic = bodies[keyNames[i]] as Hashtable; /*Using single fixture because unity support single fixture*/ ArrayList fixtures = bodyDic["fixtures"] as ArrayList; Hashtable fixture1 = fixtures[0] as Hashtable; ArrayList polygonsArray = fixture1["polygons"] as ArrayList; PolygonPath[] totalPaths = new PolygonPath[polygonsArray.Count]; for (int j = 0; j < totalPaths.Length; j++) { ArrayList pointArray = polygonsArray[j] as ArrayList; PolygonPath tempPath = new PolygonPath(); Vector2[] pointsVector = new Vector2[pointArray.Count]; for (int k = 0; k < pointsVector.Length; k++) { string pointInString = pointArray[k] as String; pointsVector[k] = this.ConvertToVector2FromString(pointInString); } tempPath.points = pointsVector; totalPaths[j] = tempPath; } _totalPolygonsinFile[i].paths = totalPaths; } Array.Sort(_totalPolygonsinFile); this.setPolygonOfIndex(selectedIndex); } else { Debug.Log("Keys not found"); } }