API reference
Every PadPlay type, member and setting on one page. Filter by name or meaning.
PadPlayHost
The PC side, one per scene. It listens for phones, receives their input and sends them button layouts, vibration and video. It also provides the URL in the QR code.
GetPad— Returns that player's PadPlayPad.PlayerReady— Raised when input starts to arrive, once per join or resume. From here on GetPad returns the pad, so spawn the character here. H.264 video appears about 0.1–0.3 s later (no need to wait for it before starting play).PlayerRemoved— Raised when the slot is free for good. The pad is already gone by then. Remove the character here.Pulse— One vibration of a fixed length. The phone times it, so a hitch in the game does not stretch it. A continuous vibration from SetHaptics resumes afterwards.SetHaptics— Keeps vibrating at this strength until the next call.SetLayout— Shows a different button layout to one player, sent on the next frame. It is kept per slot until StopHost, so a resumed player, or a later one on the same slot, gets it too.Recenter— Makes the player's current direction forward. The pad's attitude and the Gyro Camera / Gyro Pointer reading it are recentered together; they blend, so nothing jumps. Also raises Recentered.Touch.SetPlayerTarget— Makes that player's touches hit the given camera's view. For split screen or a second display. There is also SetPlayerTarget(slot, displayIndex, viewportRect), and ClearPlayerTarget(slot) to undo it.GetPlayerState— The slot's state now.PlayerSlots— Joined slots (ascending) and their count. Players waiting to reconnect are not included.PlayerJoined— Raised when a phone joins and gets a slot. No input yet.PlayerLeft— Raised when the phone disconnects. Whether the slot and the pad are kept depends on the reason.PlayerAway— Raised when the phone's app leaves the game's screen and when it comes back. The phone has already let go of every button and finger. The SDK does not pause the game: decide here (PadPlayAwayPause is a ready-made pause screen).GetPresence— Whether the player's phone app is on the game's screen (Here, Glance, Away). Same as pad.Presence and pad.IsAway.Recentered— Raised when the forward is reset. By then the pad and the Gyro Camera / Gyro Pointer are already blending.ConnectionQualityChanged— Raised when the link gets better or worse. The SDK lowers the video by itself but shows players nothing; show your own hint ("use 5 GHz Wi-Fi") from here.ScreenRotationChanged— Raised when the phone's screen rotation changes.JoinUriChanged— Raised when the URL for the QR code changes (StartHost, RenewToken, StopHost, or a new PC address). Not needed with QR View.ConnectionHintChanged— Raised when the hint under the QR code changes. Use it to show the hint in your own UI instead of QR View. Raised after CheckPcAsync even when Show Connection Hints is off.TouchReceived / AttitudeReceived / ButtonsReceived— Raised for each raw packet from the phone. uGUI events and PadPlayPad usually cover this. With Touch's Send Ui Events off, touches arrive only here.Settings— The Inspector values, from code.AcceptNewPlayers— Off: new phones are refused; players returning to a held slot still get in. For example, off during a match. Same value as Settings.Players.AcceptNewPlayers, effective at once.NetworkSettings— Low-level connection values, read on StartHost; usually left alone. The one people change is RenewGraceMs: how long joined phones may still come back with the old QR after RenewToken.SetPhoneOverlay— Sets text and boards the phone draws over the video. They do not move with the Gyro Camera's correction, so they suit scores and crosshairs. Kept per slot and resent on join and resume, so you may set it before the player arrives. Usually done through Phone Overlay.VideoStatus— How video is sent (graphics API path, encoder, each player's codec), or why it cannot be, as text for people. Empty without video.GetVideoChoice— Whether the player gets H.264 or JPEG, and why.RequestVideoStats— Collects the video sending numbers (fps, bitrate, loss, how often quality was lowered…) and passes them to callback on the main thread a frame or more later. The picture-repair numbers are included: every few seconds the phone compares its picture with the PC's and asks for a key frame when they differ (newer app versions only).GetConnectionQuality— The player's link quality now. Changes raise ConnectionQualityChanged.ConnectionHint— The hint under the QR code when this PC stops phones. The host checks the PC by itself when the QR appears, when the PC's address changes and after a fix (about 5 s, on another thread). IsCheckingPc is true while it checks.FixConnectionHintAsync— Does what the hint's button does. Call it only from a button the player pressed (QR View's button calls it). The game changes no setting; it only opens Windows' pages.CheckPcAsync— Checks whether Windows lets this program (the Unity Editor, in the Editor) receive. About 5 s on another thread; changes and shows nothing. The last result stays in PcCheck.GetConnectionDiagnosis— The most likely reason phones cannot connect. The SDK shows it nowhere; use it in your own help screen.Diagnostics— The host's record (PadPlayDiagnostics). Updated on the main thread in the host's Update.TryGetPoseView— What the phone reports about a Gyro Camera's picture: motion-to-photon time and the correction it applied.CreateSupportReport— One text to send with a support question: versions, PC and GPU driver, settings, video path, network and firewall, each phone's numbers, the event record, and a session code to match it with the phone app's report. User name, PC name, token and key, network names and the like are removed; the last line says what.AutoStart— On: listening starts in Start. Off: call StartHost() yourself.StartHost— Starts and stops listening. Stopping disconnects everyone (PlayerLeft, then PlayerRemoved with Stopped). When you stop Play in the Editor with Keep Phones Across Play on, phones wait and come back to the same numbers on the next Play.IsRunning— Whether it is listening, the UDP port in use, and the URL in the QR code.RenewToken— Makes a new token and key, so a new QR code. New phones cannot join with the old one; joined phones stay.Kick— Removes the phone without holding its slot (PlayerLeft and PlayerRemoved with Bye follow).TryGetPlayer— TryGetPlayer gives the joined player's info (as in PlayerReady); GetCapabilities gives what its app can do.GetScreenRotation— The phone's screen rotation in degrees, and the clock offset and round trip to the phone. When the layout locks the orientation and the phone reports something else, the rotation is corrected from gravity.KeepAcrossScenes— On: phones stay connected while you load other scenes. Read in Awake. A Host in a scene loaded later hands its settings to the kept Host and stays idle whatever this value is, so the scene also works on its own.ActiveHost— ActiveHost is the Host that holds the connection (the kept Host or this one). Every member of this Host already goes there; you need it only to subscribe from objects that outlive the scene. KeptHost is the Host kept across scenes.SdkVersion— The package version, the protocol version checked against the app, and the host clock.