コード例 #1
0
    private void OnDataRecieved(string data)
    {
        if (player.kills <= lastKills && player.death <= lastDeaths)
        {
            return;
        }

        int killsSinceLast = player.kills - lastKills;
        int deathSinceLast = player.death - lastDeaths;

        //if (killsSinceLast <= 0 && deathSinceLast <= 0)
        //{
        //    return;
        //}

        int kills  = DataTranslator.DataToKills(data);
        int deaths = DataTranslator.DataToDeath(data);

        int totalKills  = killsSinceLast + kills;
        int totalDeaths = deathSinceLast + deaths;

        string newData = DataTranslator.ValuesToData(totalKills, totalDeaths);

        Debug.Log("Syncing: " + newData);

        lastKills  = player.kills;
        lastDeaths = player.death;

        UserAccountManager.instance.SendData(newData);
    }
コード例 #2
0
    void OnDataRecieved(string data)
    {
        if (player.kills <= lastKills && player.death <= lastDeath)
        {
            return;
        }

        int killsSinceLastTime = player.kills - lastKills;
        int deathSinceLastTime = player.death - lastDeath;

        //récupère les morts et les kills du joueurs dans la base de donnée
        int kills = DataTranslator.DataToKills(data);
        int death = DataTranslator.DataToDeath(data);

        int newKills = killsSinceLastTime + kills;
        int newDeath = deathSinceLastTime + death;

        string newData = DataTranslator.ValueToData(newKills, newDeath);

        lastKills = player.kills;
        lastDeath = player.death;

        Debug.Log("Syncing : " + newData);

        UserAccountManager.instance.SendData(newData);
    }
コード例 #3
0
    void OnReceivedData(string data)
    {
        if (killCount == null || deathCount == null)
        {
            return;
        }

        killCount.text  = "Kills: " + DataTranslator.DataToKills(data);
        deathCount.text = "Deaths: " + DataTranslator.DataToDeath(data);
    }
コード例 #4
0
ファイル: PlayerStat.cs プロジェクト: DocJesus/FPS_Multi
 public void OnReceivedData(string data)
 {
     KillCount.text  = DataTranslator.DataToKills(data).ToString();
     DeathCount.text = DataTranslator.DataToDeath(data).ToString();
 }
 void OnReceivedData(string data)
 {
     killCount.text  = DataTranslator.DataToKills(data).ToString() + " Kills";
     deathCount.text = DataTranslator.DataToDeath(data).ToString() + " Deaths";
 }