public void SetPlayerTwo(string name) { if (name == null) { playerTwo = null; playerData.PlayerTwoName = null; playerData.PlayerTwoDetails = null; return; } playerTwo = name; playerData.PlayerTwoName = playerTwo; playerData.IsSinglePlayer = false; tempPlayer = GetPlayerInfoFromPlayerName(playerTwo); playerTwoDetails.userId = PlayerSession.Instance.currentYipliConfig.userId; //playerTwoDetails.matId = PlayerSession.Instance.currentYipliConfig.matInfo.matId; //playerTwoDetails.matMacAddress = PlayerSession.Instance.currentYipliConfig.matInfo.macAddress; playerTwoDetails.gameId = PlayerSession.Instance.currentYipliConfig.gameId; playerTwoDetails.playerId = tempPlayer.playerId; playerTwoDetails.playerAge = tempPlayer.playerAge; playerTwoDetails.playerHeight = tempPlayer.playerHeight; playerTwoDetails.playerWeight = tempPlayer.playerWeight; playerTwoDetails.playerActionCounts = new Dictionary <YipliUtils.PlayerActions, int>(); playerTwoDetails.playerGameData = new Dictionary <string, string>(); playerData.PlayerTwoDetails = playerTwoDetails; isSinglePlayer = false; }
public static void SavePlayerToDevice(YipliPlayerInfo playerInfo) { Debug.Log("Saving player to device with properties : " + playerInfo.playerId + " " + playerInfo.playerName + " " + playerInfo.playerDob + " " + playerInfo.playerHeight + " " + playerInfo.playerWeight); SavePropertyValue("player-id", playerInfo.playerId); SavePropertyValue("player-name", playerInfo.playerName); SavePropertyValue("player-dob", playerInfo.playerDob); SavePropertyValue("player-height", playerInfo.playerHeight); SavePropertyValue("player-weight", playerInfo.playerWeight); SavePropertyValue("player-tutDone", playerInfo.isMatTutDone.ToString()); if (playerInfo.profilePicUrl != null) { SavePropertyValue("player-profilePicUrl", playerInfo.profilePicUrl); } PlayerPrefs.Save(); }
public void SetPlayerOne(string name) { playerOne = name; playerData.PlayerOneName = playerOne; tempPlayer = GetPlayerInfoFromPlayerName(playerOne); playerOneDetails.userId = PlayerSession.Instance.currentYipliConfig.userId; //playerOneDetails.matId = PlayerSession.Instance.currentYipliConfig.matInfo.matId; //playerOneDetails.matMacAddress = PlayerSession.Instance.currentYipliConfig.matInfo.macAddress; playerOneDetails.playerId = tempPlayer.playerId; playerOneDetails.gameId = PlayerSession.Instance.currentYipliConfig.gameId; playerOneDetails.playerAge = tempPlayer.playerAge; playerOneDetails.playerHeight = tempPlayer.playerHeight; playerOneDetails.playerWeight = tempPlayer.playerWeight; playerOneDetails.playerActionCounts = new Dictionary <YipliUtils.PlayerActions, int>(); playerOneDetails.playerGameData = new Dictionary <string, string>(); playerData.PlayerOneDetails = playerOneDetails; }