private void TryToAssignDefaultDevice(UserDevice userDevice)
 {
     if (defaultDevicesExpected == null || defaultDevicesExpected.Count == 0)
     {
         return;
     }
     for (int i = defaultDevicesExpected.Count - 1; i >= 0; i--)
     {
         if (!InputManager.Instance.IsDeviceUsed(userDevice.deviceIndex) && userDevice.deviceType == defaultDevicesExpected[i].deviceType)
         {
             var skin         = characterSkins.GetSkinData(defaultDevicesExpected[i].characterSkinIndex);
             var devotionName = characterNames.GetDevotionName(defaultDevicesExpected[i].devotionNameIndex);
             var spiritName   = characterNames.GetSpiritName(defaultDevicesExpected[i].spiritNameIndex);
             var charToolType = defaultDevicesExpected[i].charToolType;
             if (InputManager.Instance.RegisterPlayer(userDevice.deviceIndex, skin, devotionName, spiritName, charToolType))
             {
                 PlayerSessionData psData = InputManager.Instance.GetPlayerByDevice(userDevice.deviceIndex);
                 charAssembler.CreateCharacter(psData);
                 defaultDevicesExpected.RemoveAt(i);
                 return;
             }
         }
     }
     return;
 }
Beispiel #2
0
 private void RecordPlayerSessionData()
 {
     for (int i = 0; i < selectScreenPlayerDatas.Length; i++)
     {
         if (selectScreenPlayerDatas[i] != null && selectScreenPlayerDatas[i].playerActive)
         {
             var sspData = selectScreenPlayerDatas[i];
             sspData.playerSessionData.skin         = characterSkins.GetSkinData(sspData.skinIndex);
             sspData.playerSessionData.devotionName = characterNames.GetDevotionName(sspData.devotionNameIndex);
             sspData.playerSessionData.spiritName   = characterNames.GetSpiritName(sspData.spiritNameIndex);
             sspData.playerSessionData.charToolType = sspData.charTool;
         }
     }
 }