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

◆ SetMain() [2/2]

static void SetMain ( [NotNull] Object subAsset,
[NotNull] Path path )
static

Sets (changes) an asset's 'main' object to one of its sub-assets.

Automatically imports the asset after changing the main type so that the change takes immediate effect.

Parameters
subAssetInstance of a sub-asset. Must be a sub-asset of the asset.
pathPath to the asset file.
See also

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

97 {
98 AssetDatabase.SetMainObject(subAsset, path);
99 File.Import(path);
100 }

References Asset.File.Import().

+ Here is the call graph for this function: