public float[] callGetPlayerInfo() { playerInformation temp = getPlayerInfo(); float[] hello = { temp.hitAccuracy, temp.numberOfChargedAttacks, temp.numberOfTimesHit, temp.numberOfKills, temp.healthHealed, temp.numberOfDeaths }; return(hello); }
public void callSaveNewPlayerInfo(string filePath, float hitAccuracy, float numberOfChargedAttacks, float numberOfTimesHit, float numberOfKills, float healthHealed, float numberOfDeaths) { playerInformation hello = new playerInformation(); hello.hitAccuracy = hitAccuracy; hello.numberOfChargedAttacks = numberOfChargedAttacks; hello.numberOfTimesHit = numberOfTimesHit; hello.numberOfKills = numberOfKills; hello.healthHealed = healthHealed; hello.numberOfDeaths = numberOfDeaths; saveNewPlayerInfo(filePath, hello); }
/// <summary> /// 游戏结束判定,返回1为胜利,0为未结束,-1为失败 /// </summary> /// <param name="score"></param> /// <returns></returns> public int isWin(playerInformation player) { switch (gameType) { case ARRIVAL_VERSUS: { if (player.score >= missionScore) { //发送游戏结束消息 UnityEventCenter.SendMessage <GameOverEvent>(new GameOverEvent(player.playerNum, ScoreBoard.getInstance().getScoreData())); } return(0); } default: return(-1000); } }
private static extern void saveNewPlayerInfo(string filePath, playerInformation theInfo);
// Use this for initialization void Start() { playerI = GameObject.FindGameObjectWithTag("playerInfo").GetComponent <playerInformation>(); playername = playerI.nameInfo.text; }