Show / Hide Table of Contents

Class AssetWalker

Abstract base class for traversing objects that implement IUnityAssetBase.

Inheritance
System.Object
AssetWalker
DefaultJsonWalker
YamlWalker
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.Assets.Traversal
Assembly: AssetRipper.Assets.dll
Syntax
public abstract class AssetWalker

Methods

| Improve this Doc View Source

DivideAsset(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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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

true to continue visiting the children of the asset node, false to skip visiting the children and not call the exit method.

| Improve this Doc View Source

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

true to continue visiting the children of the dictionary node, false to skip visiting the children and not call the exit method.

Type Parameters
Name Description
TKey

The type of dictionary keys.

TValue

The type of dictionary values.

| Improve this Doc View Source

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

true to continue visiting the key and value of the dictionary pair, false to skip visiting the children and not call the exit method.

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.

| Improve this Doc View Source

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

true to continue visiting the children of the field node, false to skip visiting the children and not call the exit method.

| Improve this Doc View Source

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

true to continue visiting the children of the list node, false to skip visiting the children and not call the exit method.

Type Parameters
Name Description
T

The type of the list elements.

| Improve this Doc View Source

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

true to continue visiting the children of the key-value pair node, false to skip visiting the children and not call the exit method.

Type Parameters
Name Description
TKey

The type of the key in the pair.

TValue

The type of the value in the pair.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

| Improve this Doc View Source

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.

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