CodeSmile AssetDatabase 1.9
Unity's AssetDatabase in enjoyable, consistent, concise, convenient, comprehensible, safe, documented form.
Loading...
Searching...
No Matches

◆ Extract()

static Boolean Extract ( [NotNull] Object subAsset,
[NotNull] Path destinationPath )
static

Extracts a sub-object of an asset as an asset of its own.

This is the same as dragging a sub-asset outside the containing asset in the project view. For example an animation or material dragged from a FBX asset.

Only visible sub assets are extractable.

Parameters
subAssetInstance of a sub-asset.
destinationPathPath to the extracted asset file.
Returns
True if extraction succeeded. False otherwise, in that case CodeSmileEditor.Asset.GetLastErrorMessage provides the error message.
See also

Definition at line 39 of file Asset.SubAsset.cs.

40 {
41 ThrowIf.ArgumentIsNull(subAsset, nameof(subAsset));
42 ThrowIf.ArgumentIsNull(destinationPath, nameof(destinationPath));
43
44 return Succeeded(AssetDatabase.ExtractAsset(subAsset, destinationPath));
45 }