30 if (_instance !=
null)
44 if (_instance ==
null)
47 if (!AssetDatabase.IsValidFolder(
"Assets/" + _settingsName))
49 AssetDatabase.CreateFolder(
"Assets", _settingsName);
52 if (!AssetDatabase.IsValidFolder(
"Assets/" + _settingsName +
"/Resources"))
54 AssetDatabase.CreateFolder(
"Assets/" + _settingsName,
"Resources");
59 string[] instanceGUIDS = AssetDatabase.FindAssets(typeString);
63 if (instanceGUIDS.Length > 0)
65 if (instanceGUIDS.Length > 1)
67 Debug.LogWarning(
"Found multiple CesiumRuntimeSettings assets " +
68 "in the project folder. The first asset found will be used.");
71 string oldPath = AssetDatabase.GUIDToAssetPath(instanceGUIDS[0]);
77 string result = AssetDatabase.MoveAsset(oldPath, _filePath);
78 AssetDatabase.Refresh();
79 if (
string.IsNullOrEmpty(result))
81 Debug.LogWarning(
"A CesiumRuntimeSettings asset was found outside " +
82 "the Assets/" + _settingsName +
"/Resources folder and has been moved " +
89 Debug.LogWarning(
"A CesiumRuntimeSettings asset was found outside " +
90 "the Assets/" + _settingsName +
"/Resources folder, but could not " +
91 "be moved to the appropriate location. A new settings asset will be " +
97 Debug.LogWarning(
"An invalid CesiumRuntimeSettings asset was found " +
98 "outside the Assets/" + _settingsName +
"/Resources folder. " +
99 "A new settings asset will be created instead.");
105 if (_instance ==
null)
111 AssetDatabase.CreateAsset(_instance, _filePath);
112 AssetDatabase.Refresh();
114 Debug.LogError(
"Cannot find a CesiumRuntimeSettings asset. " +
115 "Any assets that use the project's default token will not load.");