void ConfigGameData() { phaseOneObjs = new List <ItemToBeMastered> (); phaseTwoObjs = new List <ItemToBeMastered> (); phaseThreeObjs = new List <ItemToBeMastered> (); unmasteredItems = new List <ItemToBeMastered> (); currentlyActivatedGameObjects = new List <GameObject> (); currentlyActivatedImages = new List <Image> (); individualElements = GameObject.FindGameObjectsWithTag("elements"); elementsShorthand = GameObject.FindGameObjectsWithTag("elementShort"); groups = GameObject.FindGameObjectsWithTag("groups"); print(groups.Length); foreach (GameObject go in individualElements) { ItemToBeMastered item = new ItemToBeMastered(0f, go); phaseOneObjs.Add(item); } foreach (GameObject go in elementsShorthand) { ItemToBeMastered item = new ItemToBeMastered(0f, go); phaseTwoObjs.Add(item); } foreach (GameObject go in groups) { ItemToBeMastered item = new ItemToBeMastered(0f, go); phaseThreeObjs.Add(item); } //sort all the lists alphabetically List <ItemToBeMastered> tempList = new List <ItemToBeMastered> (); tempList = phaseOneObjs.OrderBy(item => item.itemGameObject.name).ToList(); phaseOneObjs = new List <ItemToBeMastered> (tempList); List <ItemToBeMastered> tempList2 = new List <ItemToBeMastered> (); tempList2 = phaseTwoObjs.OrderBy(item => item.itemGameObject.name).ToList(); phaseTwoObjs = new List <ItemToBeMastered> (tempList2); List <ItemToBeMastered> tempList3 = new List <ItemToBeMastered> (); tempList3 = phaseThreeObjs.OrderBy(item => item.itemGameObject.name).ToList(); phaseThreeObjs = new List <ItemToBeMastered> (tempList3); totalTerms = phaseOneObjs.Count + phaseTwoObjs.Count + phaseThreeObjs.Count; // if (AppManager.s_instance != null) { // float previousMasteryData = AppManager.s_instance.pullAssignMastery (AppManager.s_instance.currentAssignments [AppManager.s_instance.currIndex]) / 100; //// thresholds of data will be objs.count over totalTerms // if (previousMasteryData < (phaseOneObjs.Count / totalTerms)) { // mastery.value = 0; // } else if (previousMasteryData > (phaseOneObjs.Count / totalTerms) && (previousMasteryData < (phaseOneObjs.Count + phaseTwoObjs.Count) / totalTerms)) { // mastery.value = (float)phaseOneObjs.Count / totalTerms; // curPhase = HotSpotPhase.Typing; // } else if (previousMasteryData > (phaseOneObjs.Count + phaseTwoObjs.Count) / totalTerms) { // mastery.value = (float)(phaseOneObjs.Count + phaseTwoObjs.Count) / totalTerms; // curPhase = HotSpotPhase.Groups; // } // } }
void ConfigGameData () { phaseOneObjs = new List<ItemToBeMastered> (); phaseTwoObjs = new List<ItemToBeMastered> (); phaseThreeObjs = new List<ItemToBeMastered> (); unmasteredItems = new List<ItemToBeMastered> (); currentlyActivatedGameObjects = new List<GameObject> (); currentlyActivatedImages = new List<Image> (); individualElements = GameObject.FindGameObjectsWithTag ("elements"); elementsShorthand = GameObject.FindGameObjectsWithTag ("elementShort"); groups = GameObject.FindGameObjectsWithTag ("groups"); print (groups.Length); foreach (GameObject go in individualElements) { ItemToBeMastered item = new ItemToBeMastered (0f, go); phaseOneObjs.Add (item); } foreach (GameObject go in elementsShorthand) { ItemToBeMastered item = new ItemToBeMastered (0f, go); phaseTwoObjs.Add (item); } foreach (GameObject go in groups) { ItemToBeMastered item = new ItemToBeMastered (0f, go); phaseThreeObjs.Add (item); } //sort all the lists alphabetically List<ItemToBeMastered> tempList = new List<ItemToBeMastered> (); tempList = phaseOneObjs.OrderBy (item => item.itemGameObject.name).ToList (); phaseOneObjs = new List<ItemToBeMastered> (tempList); List<ItemToBeMastered> tempList2 = new List<ItemToBeMastered> (); tempList2 = phaseTwoObjs.OrderBy (item => item.itemGameObject.name).ToList (); phaseTwoObjs = new List<ItemToBeMastered> (tempList2); List<ItemToBeMastered> tempList3 = new List<ItemToBeMastered> (); tempList3 = phaseThreeObjs.OrderBy (item => item.itemGameObject.name).ToList (); phaseThreeObjs = new List<ItemToBeMastered> (tempList3); totalTerms = phaseOneObjs.Count + phaseTwoObjs.Count + phaseThreeObjs.Count; // if (AppManager.s_instance != null) { // float previousMasteryData = AppManager.s_instance.pullAssignMastery (AppManager.s_instance.currentAssignments [AppManager.s_instance.currIndex]) / 100; //// thresholds of data will be objs.count over totalTerms // if (previousMasteryData < (phaseOneObjs.Count / totalTerms)) { // mastery.value = 0; // } else if (previousMasteryData > (phaseOneObjs.Count / totalTerms) && (previousMasteryData < (phaseOneObjs.Count + phaseTwoObjs.Count) / totalTerms)) { // mastery.value = (float)phaseOneObjs.Count / totalTerms; // curPhase = HotSpotPhase.Typing; // } else if (previousMasteryData > (phaseOneObjs.Count + phaseTwoObjs.Count) / totalTerms) { // mastery.value = (float)(phaseOneObjs.Count + phaseTwoObjs.Count) / totalTerms; // curPhase = HotSpotPhase.Groups; // } // } }