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 SourceCreate<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 |
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 |
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 |
CreateCollection(UnityVersion)
Declaration
public static ProcessedAssetCollection CreateCollection(UnityVersion version)
Parameters
Type | Name | Description |
---|---|---|
UnityVersion | version |
Returns
Type | Description |
---|---|
ProcessedAssetCollection |
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.
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.