/// <summary> /// Loads all locational objective info onto Objectives Overlay /// </summary> private void loadSecondaryObjectives() { //Retrieve list of secondary objectives for current location List <LO.Objective> secondaries = LO.SecondaryObjectives[GameManager.Sector]; //Only run if secondary objective list is populated if (LO.SecondaryObjectives.Count > 0) { //Loop through the main secondary objectives for (int index = 0; index < 2; index++) { LO.Objective tempObjective = secondaries[index]; if (tempObjective.Name != "") { if (tempObjective.IconPath != null) { SecondaryIcons[index].sprite = Resources.Load <Sprite>(tempObjective.IconPath); } SecondaryHeaders[index].text = tempObjective.Name + tempObjective.CheckCompletion(); SecondaryDescriptions[index].text = tempObjective.Description; } else { SecondaryIcons[index].gameObject.SetActive(false); SecondaryHeaders[index].gameObject.SetActive(false); SecondaryDescriptions[index].gameObject.SetActive(false); } } } }
/// <summary> /// Loads all locational objective info onto Objectives Overlay /// </summary> private void loadLocationalObjectives() { //Retrieve list of secondary objectives for current location List <LO.Objective> secondaries = LO.SecondaryObjectives[GameManager.Sector]; const int OFFSET = 2; foreach (SecondaryObjectives objectiveNum in Enum.GetValues(typeof(SecondaryObjectives))) { int index = (int)objectiveNum + OFFSET; LO.Objective tempObjective = secondaries[index]; string modifier = tempObjective.CheckCompletion(); SmallObjectiveNames[index - OFFSET].text = tempObjective.Name + modifier; SmallObjectiveNames[index - OFFSET].color = modifier.Equals("[DONE]") ? completed : unCompleted; } }