Class AssetPack | Unity Runtime Scene Serialization | 0.1.4-preview
docs.unity3d.com
    Show / Hide Table of Contents

    Class AssetPack

    Inheritance
    Object
    Object
    ScriptableObject
    AssetPack
    Inherited Members
    ScriptableObject.SetDirty()
    ScriptableObject.CreateInstance(String)
    ScriptableObject.CreateInstance(Type)
    ScriptableObject.CreateInstance<T>()
    Object.GetInstanceID()
    Object.GetHashCode()
    Object.Equals(Object)
    Object.Instantiate(Object, Vector3, Quaternion)
    Object.Instantiate(Object, Vector3, Quaternion, Transform)
    Object.Instantiate(Object)
    Object.Instantiate(Object, Transform)
    Object.Instantiate(Object, Transform, Boolean)
    Object.Instantiate<T>(T)
    Object.Instantiate<T>(T, Vector3, Quaternion)
    Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
    Object.Instantiate<T>(T, Transform)
    Object.Instantiate<T>(T, Transform, Boolean)
    Object.Destroy(Object, Single)
    Object.Destroy(Object)
    Object.DestroyImmediate(Object, Boolean)
    Object.DestroyImmediate(Object)
    Object.FindObjectsOfType(Type)
    Object.DontDestroyOnLoad(Object)
    Object.DestroyObject(Object, Single)
    Object.DestroyObject(Object)
    Object.FindSceneObjectsOfType(Type)
    Object.FindObjectsOfTypeIncludingAssets(Type)
    Object.FindObjectsOfType<T>()
    Object.FindObjectOfType<T>()
    Object.FindObjectsOfTypeAll(Type)
    Object.FindObjectOfType(Type)
    Object.ToString()
    Object.name
    Object.hideFlags
    Namespace: Unity.RuntimeSceneSerialization
    Syntax
    public class AssetPack : ScriptableObject, ISerializationCallbackReceiver

    Fields

    CurrentAssetPack

    Declaration
    public static AssetPack CurrentAssetPack
    Field Value
    Type Description
    AssetPack

    Properties

    AssetCount

    Declaration
    public int AssetCount { get; }
    Property Value
    Type Description
    Int32

    SceneAsset

    Declaration
    public Object SceneAsset { get; set; }
    Property Value
    Type Description
    Object

    Methods

    Clear()

    Clear all asset references in this AssetPack

    Declaration
    public void Clear()

    GetAsset(String, Int64)

    Declaration
    public Object GetAsset(string guid, long fileId)
    Parameters
    Type Name Description
    String guid
    Int64 fileId
    Returns
    Type Description
    Object

    GetAssetMetadata(Object, out String, out Int64, AssetPack)

    Get the guid and sub-asset index for a given asset Also adds the asset to the asset pack in the editor

    Declaration
    public static void GetAssetMetadata(Object obj, out string guid, out long fileId, AssetPack assetPack = null)
    Parameters
    Type Name Description
    Object obj

    The asset object

    String guid
    Int64 fileId
    AssetPack assetPack

    OnAfterDeserialize()

    Declaration
    public void OnAfterDeserialize()
    Implements
    ISerializationCallbackReceiver.OnAfterDeserialize()

    OnBeforeSerialize()

    Declaration
    public void OnBeforeSerialize()
    Implements
    ISerializationCallbackReceiver.OnBeforeSerialize()

    RegisterPrefabFactory(IPrefabFactory)

    Declaration
    public static void RegisterPrefabFactory(IPrefabFactory factory)
    Parameters
    Type Name Description
    IPrefabFactory factory

    TryInstantiatePrefab(String, Transform, AssetPack)

    Declaration
    public static GameObject TryInstantiatePrefab(string prefabGuid, Transform parent, AssetPack assetPack = null)
    Parameters
    Type Name Description
    String prefabGuid
    Transform parent
    AssetPack assetPack
    Returns
    Type Description
    GameObject

    UnregisterPrefabFactory(IPrefabFactory)

    Declaration
    public static void UnregisterPrefabFactory(IPrefabFactory factory)
    Parameters
    Type Name Description
    IPrefabFactory factory
    Back to top
    Copyright © 2023 Unity Technologies — Terms of use
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX on 18 October 2023