internal static VariablesSettingsAsset LoadOrCreate()
        {
            if (!System.IO.Directory.Exists(VARIABLES_PATH))
            {
                System.IO.Directory.CreateDirectory(VARIABLES_PATH);
            }

            if (!System.IO.Directory.Exists(VARIABLES_PATH_RESOURCES))
            {
                System.IO.Directory.CreateDirectory(VARIABLES_PATH_RESOURCES);
            }

            if (_settings == null)
            {
                _settings = ExAssets.FindAssetsByType <VariablesSettingsAsset>().First();
            }

            if (_settings == null)
            {
                _settings = Resources.FindObjectsOfTypeAll <VariablesSettingsAsset>().FirstOrDefault();
            }

            if (_settings == null)
            {
                _settings = ExAssets.CreateAsset <VariablesSettingsAsset>(VARIABLES_PATH_RESOURCES, VARIABLES_SETTINGS_FILENAME, true, true);
            }

            if (_settings)
            {
                _settings.variables = ExAssets.FindAssetsByType <Variable>();
            }

            return(_settings);
        }
Exemplo n.º 2
0
        internal static VariablesSettingsAsset LoadAsset()
        {
            if (_settings == null)
            {
                _settings = ExAssets.FindAssetsByType <VariablesSettingsAsset>().FirstOrDefault();
            }

            if (_settings == null)
            {
                _settings = Resources.FindObjectsOfTypeAll <VariablesSettingsAsset>().FirstOrDefault();
            }

            return(_settings);
        }