API reference
Every PadPlay type, member and setting on one page. Filter by name or meaning.
PadPlayTestPhone
A phone for your game's automated tests (Unity Test Framework, Play Mode). It joins the PadPlayHost inside this PC the way the app does, sends buttons, sticks, touches and tilt, and reads the layout, vibration and recenters the game sends. No phone or Wi-Fi needed. Namespace and assembly: PadPlay.Testing; add it to your test assembly's references. Never in a built game.
Connect— Joins and waits until the host raises PlayerReady (yield it in a [UnityTest]); it also waits for the host to start. Then check IsConnected; Error says why not. After Drop it comes back to the same slot.Disconnect— Disconnect = the app leaves: PlayerRemoved (Bye) at once. Drop = Wi-Fi drops: PlayerLeft, and the slot is held. Call Dispose at the end of the test.Press— Presses or releases a button; it stays pressed until Release. Unlike a real phone, it can press buttons that are not on the layout.SetStick— Moves LeftStick or RightStick (x right, y up, length up to 1). Vector2.zero centers it.TryPressAt— Presses what a finger at that position on the phone would press, decided as the app does (hit margin included). For a stick it only returns the id. false when nothing is there.TouchDown— Puts a finger (0 to 31) down, moves it, lifts it. Positions are 0 to 1 of the display area, (0, 0) at the top left. They arrive as uGUI pointer events, even over a button.SetAttitude— Sets how the phone is held, as pad.attitude reads it before recentering. The first attitude after joining becomes forward (Calibrate Yaw On Connect), so compare changes. RequestRecenter = the corner long-press.LayoutButtons— What the game sent: the last layout (LayoutButtons, LayoutCount, LayoutOrientation, LayoutHitSlopMm), the vibration now (HapticStrength, 0 = still) and counts (HapticCount, PulseCount), and recenter notices (RecenterCount).GoAway— Acts like the app leaving the game's screen: GoAway = screen off or another app (Away; the host keeps it connected for holdSeconds), LookAway = the notification shade (Glance), ComeBack = back. Each lets go of every input first. For an iPhone, which stops the app, call Drop after GoAway. ReportsAway = false before Connect acts like an app that does not report it.WaitUntil— Waits until condition is true or the time runs out (yield it in a [UnityTest]).