ConditionalMembers Class

public abstract class ConditionalMembers : ScriptableObject

A Scriptable Object class used to store members (methods, properties, etc.) that rely on Unity Conditional Compilation.

The actual implementation is stored outside this DLL in a scriptable assets stored in the Deep Space Labs/SAM/Resources folder, so that it can "see" the Unity Conditional Defines (#UNITY_EDITOR, DEVELOPMENT_BUILD, etc.), and is accessible at runtime. Members inside of the SAM DLL can thus access conditionally compiled code in this way, and if for some reason the asset is deleted, a fall-back implementation is used.

Methods

GetConditionalMembers()

public static ConditionalMembers GetConditionalMembers()

Can be used to retrieve the Conditional Members asset. Using this method is preferred over manually retrieving the asset from Resources because the instance will be cached for future calls.

This method will also create an instance of a default implementation if no Conditional Members asset was found in the resources folder.

Returns

ConditionalMembers
The Conditional Members asset, if found, or a default instance if one was not found in Resources.


OnAssetChunkActiveStateSet(WorldCell, int, bool)

public abstract void OnAssetChunkActiveStateSet(WorldCell worldCellOfChunk, int chunkIndex, bool isActive)

Called after an Asset Chunk's active state is changed.

You should not call this method, unless you are writing a custom Chunk Manager that overrides the SetChunkActiveState method, in which case it MUST be called in the same frame as OnSettingAssetChunkActiveState.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.

isActive

The state that the chunk was just set to.


OnAssetChunkConfigured(WorldCell, int)

public abstract void OnAssetChunkConfigured(WorldCell worldCellOfChunk, int chunkIndex)

Called after an Asset Chunk is configured.

You should not call this method unless you are writing a custom Chunk Streamer, in which case you MUST call it in the same frame as OnConfiguringAssetChunk.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkHandleReleased(WorldCell, int)

public abstract void OnAssetChunkHandleReleased(WorldCell worldCellOfChunk, int chunkIndex)

Called after an Asset Chunk Handle is released (currently only used with Addressable Chunk Streamers).

You should not call this method unless you are writing a custom Chunk Streamer, in which case it MUST be called in the same frame as OnReleasingAssetChunkHandle.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkLoadInitiated(WorldCell, int)

public abstract void OnAssetChunkLoadInitiated(WorldCell worldCellOfChunk, int chunkIndex)

Called right after the Streamer has initiated the loading of an asset chunk. Used to time how long the call to start loading took.

You should not call this method unless you are writing a custom Chunk Streamer, in which case this method MUST be called in the same frame that OnInitiatingAssetChunkLoad is called.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkLoaded(WorldCell, int)

public abstract void OnAssetChunkLoaded(WorldCell worldCellOfChunk, int chunkIndex)

Called after an Asset Chunk (or its source asset) has been loaded into main memory (i.e., after the itegration step completes). This is called before the Asset Chunk has been configured, which if using prefabs, involves the instantiation of the asset chunk.

You should not call this method unless you are writing a custom Chunk Streamer.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkLoadedInBackground(WorldCell, int)

public abstract void OnAssetChunkLoadedInBackground(WorldCell worldCellOfChunk, int chunkIndex)

Called right after the Streamer has completed background loading of the Asset Chunk. Depending on the streamer, this method may only be called after the Asset Chunk has been integrated into the main thread, in which case it will be called at the same time as OnAssetChunkLoaded. If the streamer requires manual activation/integration of the Asset Chunk however, this method will be called after the chunk has been loaded in the background but before it has been integrated into the main thread.

You should not call this method unless you are writing a custom Chunk Streamer, in which case this method MUST be called in the same frame that OnInitiatingAssetChunkLoad is called.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkOrChildrenDestroyed(WorldCell, int)

public abstract void OnAssetChunkOrChildrenDestroyed(WorldCell worldCellOfChunk, int chunkIndex)

Called after an Asset Chunk or any of its children are destroyed in a given frame. If using a ChunkDestroyer, this method may be called multiple times for a single Asset Chunk, if the destruction of that asset chunk is carried out over multiple frames.

You should not call this method unless you are writing a custom Chunk Streamer, in which case it MUST be called in the same frame as OnDestroyingAssetChunkOrChildren.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkUnloadInitiated(WorldCell, int)

public abstract void OnAssetChunkUnloadInitiated(WorldCell worldCellOfChunk, int chunkIndex)

Called right after the Streamer has initiated the unloading of an asset chunk. Used to time how long the call to start unloading took. Only called by streamers that use an async operation to unload the asset chunks.

You should not call this method unless you are writing a custom Chunk Streamer, in which case it MUST be called in the same frame as OnInitiatingAssetChunkUnload.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnAssetChunkUnloaded(WorldCell, int)

public abstract void OnAssetChunkUnloaded(WorldCell worldCellOfChunk, int chunkIndex)

Called after an Asset Chunk (or its source asset) has completely been unloaded from main memory (i.e., after the deitegration step completes). Only called by streamers that use an async operation to unload the asset chunks.

You should not call this method unless you are writing a custom Chunk Streamer.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnConfiguringAssetChunk(WorldCell, int)

public abstract void OnConfiguringAssetChunk(WorldCell worldCellOfChunk, int chunkIndex)

Called before an Asset Chunk is configured.

You should not call this method unless you are writing a custom Chunk Streamer, in which case you MUST call it in the same frame as OnAssetChunkConfigured.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnDestroyingAssetChunkOrChildren(WorldCell, int)

public abstract void OnDestroyingAssetChunkOrChildren(WorldCell worldCellOfChunk, int chunkIndex)

Called before the destruction of an Asset Chunk or any of its children in a given frame. If using a ChunkDestroyer, this method may be called multiple times for a single Asset Chunk, if the destruction of that asset chunk is carried out over multiple frames.

You should not call this method unless you are writing a custom Chunk Streamer, in which case it MUST be called in the same frame as OnAssetChunkOrChildrenDestroyed.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnInitiatingAssetChunkDeintegrate(WorldCell, int)

public abstract void OnInitiatingAssetChunkDeintegrate(WorldCell worldCellOfChunk, int chunkIndex)

Called right before the Streamer has initiated the deintegration of an asset chunk, which is typically the final step of the unloading process. Used to time how long the call to deintegrate took, although it should be noted that this is done by combining this call with the call to OnAssetChunkUnloaded, which itself may not be called immediately after the deintegration completes.

Only called by streamers that use an async operation to unload the asset chunks.

You should not call this method unless you are writing a custom Chunk Streamer.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnInitiatingAssetChunkIntegrate(WorldCell, int)

public abstract void OnInitiatingAssetChunkIntegrate(WorldCell worldCellOfChunk, int chunkIndex)

Called right before the Streamer has initiated the integration of an asset chunk, which is typically the final step of the loading process. Used to time how long the call to integrate took, although it should be noted that this is done by combining this call with the call to OnAssetChunkLoaded, which itself may not be called immediately after the integration completes.

This method is not called by all streamers, specifically the Addressable Prefab Chunk Streamer, as it's not possible to control the integration step (it happens automatically during the load).

You should not call this method unless you are writing a custom Chunk Streamer.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnInitiatingAssetChunkLoad(WorldCell, int)

public abstract void OnInitiatingAssetChunkLoad(WorldCell worldCellOfChunk, int chunkIndex)

Called right before an Asset Chunk's loading process is started.

You should not call this method unless you are writing a custom Chunk Streamer, in which case this method must be called in the same frame that OnAssetChunkLoadInitiated is called.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnInitiatingAssetChunkUnload(WorldCell, int)

public abstract void OnInitiatingAssetChunkUnload(WorldCell worldCellOfChunk, int chunkIndex)

Called right before an Asset Chunk's unloading process is started. Only called by streamers that use an async operation to unload the asset chunks.

You should not call this method unless you are writing a custom Chunk Streamer, in which case it MUST be called in the same frame as OnAssetChunkUnloadInitiated.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnReleasingAssetChunkHandle(WorldCell, int)

public abstract void OnReleasingAssetChunkHandle(WorldCell worldCellOfChunk, int chunkIndex)

Called before an Asset Chunk Handle is released (currently only used with Addressable Chunk Streamers).

You should not call this method unless you are writing a custom Chunk Streamer, in which case it MUST be called in the same frame as OnAssetChunkHandleReleased.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.


OnSAMInitializing()

public abstract void OnSAMInitializing()

Called before SAM is initialized.


OnSettingAssetChunkActiveState(WorldCell, int, bool)

public abstract void OnSettingAssetChunkActiveState(WorldCell worldCellOfChunk, int chunkIndex, bool isActive)

Called before an Asset Chunk's active state is changed.

You should not call this method, unless you are writing a custom Chunk Manager that overrides the SetChunkActiveState method, in which case it MUST be called in the same frame as OnAssetChunkActiveStateSet.

Parameters

Name Type Description
worldCellOfChunk WorldCell

The World Cell the chunk belongs to.

chunkIndex int

The index of the chunk in relation to other chunks belonging to the World Cell.

isActive

The state that the chunk will be set to.