Class AssetWalker
Abstract base class for traversing objects that implement IUnityAssetBase.
Inherited Members
Namespace: AssetRipper.Assets.Traversal
Assembly: AssetRipper.Assets.dll
Syntax
public abstract class AssetWalker
Methods
| Improve this Doc View SourceDivideAsset(IUnityAssetBase)
Called between two fields of an asset node during traversal.
Declaration
public virtual void DivideAsset(IUnityAssetBase asset)
Parameters
Type | Name | Description |
---|---|---|
IUnityAssetBase | asset | The asset having its fields divided. |
DivideDictionary<TKey, TValue>(IReadOnlyCollection<KeyValuePair<TKey, TValue>>)
Called between two pairs of a dictionary node during traversal.
Declaration
public virtual void DivideDictionary<TKey, TValue>(IReadOnlyCollection<KeyValuePair<TKey, TValue>> dictionary)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<KeyValuePair<TKey, TValue>> | dictionary | The dictionary having its pairs divided. |
Type Parameters
Name | Description |
---|---|
TKey | The type of dictionary keys. |
TValue | The type of dictionary values. |
DivideDictionaryPair<TKey, TValue>(KeyValuePair<TKey, TValue>)
Called between the key and value of a dictionary pair during traversal.
Declaration
public virtual void DivideDictionaryPair<TKey, TValue>(KeyValuePair<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, TValue> | pair | The dictionary pair having its key and value divided. |
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the pair. |
TValue | The type of the value in the pair. |
Remarks
This calls DividePair<TKey, TValue>(KeyValuePair<TKey, TValue>) by default.
DivideList<T>(IReadOnlyList<T>)
Called between two elements of a list node during traversal.
Declaration
public virtual void DivideList<T>(IReadOnlyList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<T> | list | The list having its elements divided. |
Type Parameters
Name | Description |
---|---|
T | The type of the list elements being divided. |
DividePair<TKey, TValue>(KeyValuePair<TKey, TValue>)
Called between the key and value of a key-value pair node during traversal.
Declaration
public virtual void DividePair<TKey, TValue>(KeyValuePair<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, TValue> | pair | The key-value pair having its key and value divided. |
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the pair. |
TValue | The type of the value in the pair. |
EnterAsset(IUnityAssetBase)
Called when entering an asset node during traversal.
Declaration
public virtual bool EnterAsset(IUnityAssetBase asset)
Parameters
Type | Name | Description |
---|---|---|
IUnityAssetBase | asset | The asset being entered. |
Returns
Type | Description |
---|---|
System.Boolean |
|
EnterDictionary<TKey, TValue>(IReadOnlyCollection<KeyValuePair<TKey, TValue>>)
Called when entering a dictionary node during traversal.
Declaration
public virtual bool EnterDictionary<TKey, TValue>(IReadOnlyCollection<KeyValuePair<TKey, TValue>> dictionary)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<KeyValuePair<TKey, TValue>> | dictionary | The dictionary being entered. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
TKey | The type of dictionary keys. |
TValue | The type of dictionary values. |
EnterDictionaryPair<TKey, TValue>(KeyValuePair<TKey, TValue>)
Called when entering a dictionary pair during traversal.
Declaration
public virtual bool EnterDictionaryPair<TKey, TValue>(KeyValuePair<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, TValue> | pair | The dictionary pair being entered. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the pair. |
TValue | The type of the value in the pair. |
Remarks
This calls EnterPair<TKey, TValue>(KeyValuePair<TKey, TValue>) by default.
EnterField(IUnityAssetBase, String)
Called when entering a field node during traversal.
Declaration
public virtual bool EnterField(IUnityAssetBase asset, string name)
Parameters
Type | Name | Description |
---|---|---|
IUnityAssetBase | asset | |
System.String | name | The name of the field being entered. |
Returns
Type | Description |
---|---|
System.Boolean |
|
EnterList<T>(IReadOnlyList<T>)
Called when entering a list node during traversal.
Declaration
public virtual bool EnterList<T>(IReadOnlyList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<T> | list | The list being entered. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
T | The type of the list elements. |
EnterPair<TKey, TValue>(KeyValuePair<TKey, TValue>)
Called when entering a key-value pair node during traversal.
Declaration
public virtual bool EnterPair<TKey, TValue>(KeyValuePair<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, TValue> | pair | The key-value pair being entered. |
Returns
Type | Description |
---|---|
System.Boolean |
|
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the pair. |
TValue | The type of the value in the pair. |
ExitAsset(IUnityAssetBase)
Called when exiting an asset node during traversal.
Declaration
public virtual void ExitAsset(IUnityAssetBase asset)
Parameters
Type | Name | Description |
---|---|---|
IUnityAssetBase | asset | The asset being exited. |
ExitDictionary<TKey, TValue>(IReadOnlyCollection<KeyValuePair<TKey, TValue>>)
Called when exiting a dictionary node during traversal.
Declaration
public virtual void ExitDictionary<TKey, TValue>(IReadOnlyCollection<KeyValuePair<TKey, TValue>> dictionary)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyCollection<KeyValuePair<TKey, TValue>> | dictionary | The dictionary being exited. |
Type Parameters
Name | Description |
---|---|
TKey | The type of dictionary keys. |
TValue | The type of dictionary values. |
ExitDictionaryPair<TKey, TValue>(KeyValuePair<TKey, TValue>)
Called when exiting a dictionary pair during traversal.
Declaration
public virtual void ExitDictionaryPair<TKey, TValue>(KeyValuePair<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, TValue> | pair | The dictionary pair being exited. |
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the pair. |
TValue | The type of the value in the pair. |
Remarks
This calls ExitPair<TKey, TValue>(KeyValuePair<TKey, TValue>) by default.
ExitField(IUnityAssetBase, String)
Called when exiting a field node during traversal.
Declaration
public virtual void ExitField(IUnityAssetBase asset, string name)
Parameters
Type | Name | Description |
---|---|---|
IUnityAssetBase | asset | |
System.String | name | The name of the field being exited. |
ExitList<T>(IReadOnlyList<T>)
Called when exiting a list node during traversal.
Declaration
public virtual void ExitList<T>(IReadOnlyList<T> list)
Parameters
Type | Name | Description |
---|---|---|
IReadOnlyList<T> | list | The list being exited. |
Type Parameters
Name | Description |
---|---|
T | The type of the list elements. |
ExitPair<TKey, TValue>(KeyValuePair<TKey, TValue>)
Called when exiting a key-value pair node during traversal.
Declaration
public virtual void ExitPair<TKey, TValue>(KeyValuePair<TKey, TValue> pair)
Parameters
Type | Name | Description |
---|---|---|
KeyValuePair<TKey, TValue> | pair | The key-value pair being exited. |
Type Parameters
Name | Description |
---|---|
TKey | The type of the key in the pair. |
TValue | The type of the value in the pair. |
VisitPPtr<TAsset>(IPPtr<TAsset>)
Visits a generic PPtr (Serialized Pointer) node with a specified PPtr type and target Unity object type.
Declaration
public void VisitPPtr<TAsset>(IPPtr<TAsset> pptr)
where TAsset : IUnityObjectBase
Parameters
Type | Name | Description |
---|---|---|
IPPtr<TAsset> | pptr | The generic PPtr instance representing the serialized pointer. |
Type Parameters
Name | Description |
---|---|
TAsset | The type of the Unity object pointed to by the PPtr. |
Remarks
This method is called when encountering a generic PPtr node during asset traversal. A generic PPtr is a serialized pointer to a Unity object within the asset file.
VisitPPtr<TAsset>(PPtr<TAsset>)
Visits a Unity PPtr (Serialized Pointer) node.
Declaration
public virtual void VisitPPtr<TAsset>(PPtr<TAsset> pptr)
where TAsset : IUnityObjectBase
Parameters
Type | Name | Description |
---|---|---|
PPtr<TAsset> | pptr | The PPtr instance representing the serialized pointer. |
Type Parameters
Name | Description |
---|---|
TAsset | The type of the Unity object pointed to by the PPtr. |
Remarks
This method is called when encountering a Unity PPtr node during asset traversal. A PPtr is a serialized pointer to a Unity object within the asset file.
VisitPrimitive<T>(T)
Visit a primitive leaf node.
Declaration
public virtual void VisitPrimitive<T>(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The primitive value. |
Type Parameters
Name | Description |
---|---|
T | The type of the primitive. |
Remarks
byte[] is treated as a primitive.