public static Globals Create() { // Setup object. Globals container = SetupContainerObject(); // Load data object. GlobalsSettings data = GlobalsSettings.Load(); // Create dictionary, if GlobalsDataContainer exists. Dictionary <Type, ScriptableObject> dataElementsDictionary = null; if (data.DataContainer != null) { dataElementsDictionary = CreateDataElementsDictionary(data.DataContainer.Elements); } // Unload data object. // UnloadSettings(data); // Construct GlobalsContainer instance. container.Construct(dataElementsDictionary); return(container); }
private void OnEnable() { _settings = GlobalsSettings.Load(); }