Ejemplo n.º 1
0
    public float[] callGetPlayerInfo()
    {
        playerInformation temp = getPlayerInfo();

        float[] hello = { temp.hitAccuracy, temp.numberOfChargedAttacks, temp.numberOfTimesHit, temp.numberOfKills, temp.healthHealed, temp.numberOfDeaths };
        return(hello);
    }
Ejemplo n.º 2
0
    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);
    }
Ejemplo n.º 3
0
    /// <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);
        }
    }
Ejemplo n.º 4
0
 private static extern void saveNewPlayerInfo(string filePath, playerInformation theInfo);
Ejemplo n.º 5
0
 // Use this for initialization
 void Start()
 {
     playerI    = GameObject.FindGameObjectWithTag("playerInfo").GetComponent <playerInformation>();
     playername = playerI.nameInfo.text;
 }