public bool AddNewVirtualController(VirtualController virtualController) { if (pendingSmartPhoneControllers.Count > 0) { virtualController.ConnectVirtualControllerToGame(this); smartphoneController = smartphoneControllers[pendingSmartPhoneControllers[0]]; smartphoneControllers.Remove(pendingSmartPhoneControllers[0]); pendingSmartPhoneControllers.RemoveAt(0); if (!smartphoneControllers.ContainsKey(virtualController.controllerID)) { smartphoneControllers.Add(virtualController.controllerID, smartphoneController); } //if (PlayerManager.PlayTime != null) //{ // OnMidSessionControllerConnect(virtualController); //} OnControllerStateChanged(ControllerStateChange.Connected); //controllerTextTween.InitiateTweenIn(ControllerStateChange.Connected); return(true); } else if (currentSmartPhoneController < maxSmartphoneConroller) { currentSmartPhoneController++; virtualController.ConnectVirtualControllerToGame(this); smartphoneController = new SmartphoneController(); InputManager.AttachDevice(smartphoneController); if (!smartphoneControllers.ContainsKey(virtualController.controllerID)) { smartphoneControllers.Add(virtualController.controllerID, smartphoneController); } OnControllerStateChanged(ControllerStateChange.Connected); //controllerTextTween.InitiateTweenIn(ControllerStateChange.Connected); return(true); } return(false); }