@@ -11,6 +11,14 @@ public sealed class PrototirExample : MonoBehaviour
1111
1212 private async void Start ( )
1313 {
14+ // This IMGUI-only scene has no camera in its hierarchy. A solid backdrop also keeps the
15+ // native pairing overlay free of Unity's "No cameras rendering" message.
16+ if ( FindFirstObjectByType < Camera > ( ) == null )
17+ {
18+ var camera = new GameObject ( "Example backdrop" ) . AddComponent < Camera > ( ) ;
19+ camera . clearFlags = CameraClearFlags . SolidColor ;
20+ camera . backgroundColor = new Color ( 0.059f , 0.059f , 0.067f ) ;
21+ }
1422#if UNITY_EDITOR
1523 PrototirSdk . MockAiHandler = options =>
1624 Task . FromResult ( $ "Editor mock: explore the signal hidden beyond the next door.") ;
@@ -31,7 +39,7 @@ private async void Start()
3139 private void OnGUI ( )
3240 {
3341 var width = Mathf . Min ( 560f , Screen . width - 40f ) ;
34- var height = Mathf . Min ( 520f , Screen . height - 40f ) ;
42+ var height = Mathf . Min ( 580f , Screen . height - 40f ) ;
3543 var area = new Rect ( ( Screen . width - width ) / 2f , ( Screen . height - height ) / 2f , width , height ) ;
3644 GUILayout . BeginArea ( area , GUI . skin . box ) ;
3745 GUILayout . Space ( 20 ) ;
@@ -42,12 +50,26 @@ private void OnGUI()
4250 GUI . enabled = ! busy ;
4351 if ( GUILayout . Button ( "Add 10 points" , GUILayout . Height ( 52 ) ) ) _ = AddPointsAsync ( ) ;
4452 if ( GUILayout . Button ( "Generate a quest hook" , GUILayout . Height ( 52 ) ) ) _ = GenerateQuestAsync ( ) ;
53+ #if ! UNITY_WEBGL || UNITY_EDITOR
54+ if ( GUILayout . Button ( PrototirSdk . IsPaired ? "Connection" : "Pair this build" , GUILayout . Height ( 52 ) ) )
55+ OpenPairing ( ) ;
56+ #endif
4557 GUI . enabled = true ;
4658 GUILayout . Space ( 16 ) ;
4759 GUILayout . Label ( status , GUI . skin . textArea , GUILayout . ExpandHeight ( true ) ) ;
4860 GUILayout . EndArea ( ) ;
4961 }
5062
63+ #if ! UNITY_WEBGL || UNITY_EDITOR
64+ private void OpenPairing ( )
65+ {
66+ // Hide the playground while the SDK overlay is open, then bring it back on dismissal.
67+ enabled = false ;
68+ var screen = Prototir . Native . PrototirPairingScreen . Show ( ) ;
69+ screen . Closed += ( ) => { if ( this != null ) enabled = true ; } ;
70+ }
71+ #endif
72+
5173 private async Task AddPointsAsync ( )
5274 {
5375 busy = true ;
0 commit comments