public MissionObjective CreateObjectiveFromState(ObjectiveState state, Transform parent) { GameObject newObjectiveGameObject = parent.gameObject.CreateChild(state.Name).gameObject; MissionObjective newObjective = newObjectiveGameObject.AddComponent <MissionObjective> (); newObjective.State = state; state.ParentObjective = newObjective; mObjectiveLookup.Add(newObjective.State.FileName, newObjective); return(newObjective); }
public bool GetObjectiveState(string objectiveName, out ObjectiveState objectiveState) { objectiveState = null; MissionObjective objective = null; if (mObjectiveLookup.TryGetValue(objectiveName, out objective)) { objectiveState = objective.State; } return(objectiveState != null); }