Setup
Add PlayAI Component to Your Project
Add PlayAI Component:
Add the PlayAI component to your game’s main character or a central game object (such as a GameManager). This component will handle recording and other PlayAI functionalities.
Add the Opt-In Prompt UI:
Create a UI Canvas in Unity and design a UI panel that will serve as the opt-in prompt. The panel should include buttons for "Opt In", "Learn More", and "Ignore".
Implement the Recording Control Logic
Recording on Game Start:
Use Unity’s scripting (C#) to automatically start recording when the game instance begins if the player has opted in.
Stopping Recording on Game End:
Use Unity’s scripting to stop recording when the game session ends.
Opt-In Controls Implementation
Display Opt-In Prompt:
On game start, check if the player has opted in using a saved preference (e.g., PlayerPrefs).
If the player has not opted in, display the opt-in UI.
Calling the Opt-In Method:
When the player selects "Opt In", save their decision using
PlayerPrefs
, share the player information, and start recording the gameplay session.If "Ignore" is selected, dismiss the prompt without recording, and re-prompt after a specified time or event.
Last updated