void OnControllerAdded(ControllerAssignmentChangedEventArgs obj) { #if (UNITY_IOS || UNITY_TVOS || UNITY_STANDALONE_OSX) // if you don't remove the "actual" controller you'll get input twice if (obj.controller.type == ControllerType.Joystick) { player.controllers.RemoveController(obj.controller); ConnectAppleController(); return; } else if (appleVirtualController != null) { InitializeLayout(appleVirtualController); } #endif }
void OnControllerDisconnected(ControllerAssignmentChangedEventArgs args) // is called when a controller is disconnected { //ebug.Log("A controller was disconnected! Name = " + args.name + " Id = " + args.controllerId + " Type = " + args.controllerType); }