public LocationVO SaveLocation(LocationConfig config) { if (config == null) { return(null); } List <string> incidents = new List <string>(); IncidentModel story = AmbitionApp.Story; IncidentVO incident = config.IntroIncidentConfig?.GetIncident(); if (incident != null) { story.Incidents[incident.ID] = incident; story.AddDependency(incident, config.name, IncidentType.Location); } if (config.StoryIncidentConfigs != null) { foreach (IncidentConfig iconfig in config.StoryIncidentConfigs) { incident = iconfig?.GetIncident(); if (incident != null) { incidents.Add(incident.ID); story.Incidents[incident.ID] = incident; story.AddDependency(incident, config.name, IncidentType.Location); } } } return(Locations[config.name] = new LocationVO() { ID = config.name, IntroIncident = config.IntroIncidentConfig?.name, StoryIncidents = incidents.ToArray(), SceneID = config.SceneID, IsOneShot = config.OneShot, IsDiscoverable = config.IsDiscoverable, IsRendezvous = config.IsRendezvous, Requirements = config.Requirements ?? new RequirementVO[0] }); }
public LocationVO GetLocation(string locationID) { if (string.IsNullOrEmpty(locationID)) { return(null); } Locations.TryGetValue(locationID, out LocationVO location); if (location != null && (string.IsNullOrEmpty(location.IntroIncident) || AmbitionApp.Story.Incidents.ContainsKey(location.IntroIncident)) && Array.TrueForAll(location.StoryIncidents, AmbitionApp.Story.Incidents.ContainsKey)) { return(location); } // If the Location isn't currently stored, load it LocationConfig config = UnityEngine.Resources.Load <LocationConfig>(ParisConsts.DIR + locationID); return(SaveLocation(config)); }
//To Do: Add in the fader (Still needs to be made) private void HandleSelect(LocationConfig location) { _selected = location; AmbitionApp.OpenDialog(DialogConsts.PARIS_LOCATION, _selected); }