Skip to main content

IProjectVGameplayDataConsumer interface

Implement on one MonoBehaviour in the mission scene to receive the run's data. When the scene loads for a started run, the SDK calls BindGameplayData on the Unity main thread; the scene must contain exactly one such component.

Namespace: SilverTiger.ProjectV.Unity.Presentation.Gameplay

public interface IProjectVGameplayDataConsumer

Methods​

BindGameplayData(IProjectVGameplayDataPresenter presenter, ProjectVGameplayStartingDataView startingData)​

Called once per run with the run's presenter and starting data. Set up the character, skills and reward enemies here. If it throws, the run is cancelled and UnbindGameplayData is called.

void BindGameplayData(IProjectVGameplayDataPresenter presenter, ProjectVGameplayStartingDataView startingData);

Parameters

NameTypeDescription
presenterIProjectVGameplayDataPresenterKeep it to report skill uses and send the result. Cast it to IProjectVGameplayDataPolicy for the helpers.
startingDataProjectVGameplayStartingDataViewThe data to start the run with.

UnbindGameplayData(IProjectVGameplayDataPresenter presenter)​

Called when the scene unloads or the run ends. Stop using the presenter: its calls fail from now on.

void UnbindGameplayData(IProjectVGameplayDataPresenter presenter);

Parameters

NameTypeDescription
presenterIProjectVGameplayDataPresenterThe presenter passed to BindGameplayData.