asset | The persistent asset to convert to an in-scene asset. |
gameObjectReferencingAsset | The GameObject that is referencing the asset either directly or through its children in its hierarchy. |
Object
An in-scene asset object referenced by gameObjectReferencingAsset
if successful, otherwise null.
Creates an in-scene asset object from the given project asset.
Given a project asset and a GameObject referencing it, the function clones the asset, makes it non-persistent and remaps the GameObject's references to the new in-scene asset object.
Additional resources: InSceneAssetUtility.CreateAssetFromInSceneAsset.