示例#1
0
    public void SaveGameResult(int updateScore, int getCoin, int[] useItems)
    {
        _userData.AddCoin(getCoin);
        if (_userData.UpdateScore(updateScore))
        {
            //Upload Score rank.
            NetworkManager.Instance.SetScoreToLeaderBorad(updateScore);
        }

        ItemUseCountInfo    itemUseCountInfo    = ItemUseCountInfo.GetInstance(useItems);
        AnalyticsEventParam analyticsEventParam = new AnalyticsEventParam()
                                                  .AddParam("Score", updateScore)
                                                  .AddParam("Coin", getCoin)
                                                  .AddParam("Item_Recycle", itemUseCountInfo.GetCount(ItemType.TRASH))
                                                  .AddParam("Item_Hammer", itemUseCountInfo.GetCount(ItemType.BREAK))
                                                  .AddParam("Item_Rewind", itemUseCountInfo.GetCount(ItemType.UNDO));;

        AnalyticsManager.Instance.EventLog(GameConstants.EVENTLOG_BASICMODE_RESULT, analyticsEventParam);

        DeletePlayData();
        SaveUserDataFile();
    }