/// <summary> /// Load the set of default layer definitions from the file system; if it does not exist, then /// the default asset will be re-created /// </summary> /// <returns></returns> public static LayerDefinitionSet LoadDefaultLayerDefinitionSet() { LayerDefinitionSet lDefinitionSet = AssetDatabase.LoadAssetAtPath <LayerDefinitionSet>(DefaultLayerDefinitionSetPath); if (lDefinitionSet == null) { // Create the asset lDefinitionSet = AssetHelper.GetOrCreateAsset <LayerDefinitionSet>(DefaultLayerDefinitionSetPath); // Add the defaut layer definitions for (int i = 0; i < DefaultLayers.Names.Length; i++) { if (!(string.IsNullOrEmpty(DefaultLayers.Names[i]))) { lDefinitionSet.LayerDefinitions.Add(new LayerDefinition { Index = i, Name = DefaultLayers.Names[i] }); } } // Ensure the changes are saved AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); } return(lDefinitionSet); }
/// <summary> /// Create a new profile at the specified path /// </summary> /// <param name="rPath"></param> /// <returns></returns> public static CharacterWizardProfile Create(string rPath) { string lPath = AssetHelper.GetNewAssetPath(rPath); return(AssetHelper.GetOrCreateAsset <CharacterWizardProfile>(lPath)); }