Show / Hide Table of Contents

Class AssetCreator

A helper class for creating assets, generally for unit testing.

Inheritance
System.Object
AssetCreator
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: AssetRipper.SourceGenerated.Extensions
Assembly: AssetRipper.SourceGenerated.Extensions.dll
Syntax
public static class AssetCreator

Methods

| Improve this Doc View Source

Create<T>(ClassIDType, UnityVersion)

Declaration
public static T Create<T>(ClassIDType classID, UnityVersion version)
    where T : IUnityObjectBase
Parameters
Type Name Description
AssetRipper.SourceGenerated.ClassIDType classID
UnityVersion version
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

Create<T>(ClassIDType, UnityVersion, Func<AssetInfo, T>)

Declaration
public static T Create<T>(ClassIDType classID, UnityVersion version, Func<AssetInfo, T> factory)
    where T : IUnityObjectBase
Parameters
Type Name Description
AssetRipper.SourceGenerated.ClassIDType classID
UnityVersion version
Func<AssetRipper.Assets.Metadata.AssetInfo, T> factory
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

CreateAsset<T>(ProcessedAssetCollection, ClassIDType)

Declaration
public static T CreateAsset<T>(this ProcessedAssetCollection collection, ClassIDType classID)
    where T : IUnityObjectBase
Parameters
Type Name Description
ProcessedAssetCollection collection
AssetRipper.SourceGenerated.ClassIDType classID
Returns
Type Description
T
Type Parameters
Name Description
T
| Improve this Doc View Source

CreateCollection(UnityVersion)

Declaration
public static ProcessedAssetCollection CreateCollection(UnityVersion version)
Parameters
Type Name Description
UnityVersion version
Returns
Type Description
ProcessedAssetCollection
| Improve this Doc View Source

CreateUnsafe(Type)

Create a new asset using reflection.

Declaration
public static UnityObjectBase CreateUnsafe(Type type)
Parameters
Type Name Description
Type type

The type of asset to create.

Returns
Type Description
UnityObjectBase

A new asset.

Remarks

The type must have a constructor which takes an AssetRipper.Assets.Metadata.AssetInfo as its only parameter.

| Improve this Doc View Source

CreateUnsafe<T>()

Create a new asset using reflection.

Declaration
public static T CreateUnsafe<T>()
    where T : UnityObjectBase
Returns
Type Description
T

A new asset.

Type Parameters
Name Description
T

The type of asset to create.

Remarks

The type must have a constructor which takes an AssetRipper.Assets.Metadata.AssetInfo as its only parameter.

  • Improve this Doc
  • View Source
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾