WeaverEditorUtilities.

SaveSubAssets(Object, Object) Method

Summary

[Editor-Only] After you save the scene object `obj` as an asset file and load it as `asset`, this method goes through all the serialized UnityEngine.Object fields which weren't saved and adds them as sub-assets. Returns true if any sub-assets were saved.

For example, creating a procedural UnityEngine.Mesh, assigning it to a UnityEngine.MeshFilter, and saving the object as a prefab would not save the mesh anywhere unless you call this method or UnityEditor.AssetDatabase.AddObjectToAsset(UnityEngine.Object,UnityEngine.Object).
Assembly
Weaver.dll
Namespace
Weaver.Editor
Containing Type
WeaverEditorUtilities

Syntax

public static bool SaveSubAssets(Object obj, Object asset)

Parameters

Name Type Description
obj Object
asset Object

Return Value

Type Description
bool