NoiseSettings CreateProfile(SerializedProperty property, string label, NoiseSettings copyFrom) { string path = InspectorUtility.GetVirtualCameraObjectName(property) + " " + label; path = EditorUtility.SaveFilePanelInProject( "Create Noise Profile asset", path, "asset", "This asset will generate a procedural noise signal"); if (!string.IsNullOrEmpty(path)) { NoiseSettings profile = null; if (copyFrom != null) { string fromPath = AssetDatabase.GetAssetPath(copyFrom); if (AssetDatabase.CopyAsset(fromPath, path)) { profile = AssetDatabase.LoadAssetAtPath( path, typeof(NoiseSettings)) as NoiseSettings; } } else { profile = ScriptableObjectUtility.CreateAt( typeof(NoiseSettings), path) as NoiseSettings; } AssetDatabase.SaveAssets(); AssetDatabase.Refresh(); return(profile); } return(null); }