Ejemplo n.º 1
0
    //返回应该出多少礼品
    public int AddScoresAndGivePlayerAward(InsertCoinsAlu.PlayerPosition p, int scores, UniInsertCoinsOptionsFile opfile, UniInsertCoinsRecord recordFile)
    {
        totalScores[(int)p]   += scores;
        currentScores[(int)p] += scores;
        int ret = 0;

        while (currentScores[(int)p] >= opfile.awardNeedScore)
        {
            ret += opfile.awardCount;
            currentScores[(int)p] -= opfile.awardNeedScore;
        }
        if (ret != 0)
        {
            GivePlayerAward(p, opfile, recordFile);
        }
        return(ret);
    }
 //玩家投币触发
 public void PlayerInsertCoins(PlayerPosition p, int conis, UniInsertCoinsRecord recordFile)
 {
     currentInsertCoins[(int)p] += conis;
     recordFile.PlayerInsertCoins(conis);
 }
 public static void LoadAllRecord(UniGameResources gameresources)
 {
     //投币统计信息
     insertCoinsRecord = new UniInsertCoinsRecord(FTLibrary.Text.IStringPath.ConnectPath(UniGameResources.PersistentDataPath, "GameRecord\\InsertCoinsRecord.dat"),
                                                  gameresources);
 }
Ejemplo n.º 4
0
 //奖励礼品
 public void GivePlayerAward(InsertCoinsAlu.PlayerPosition p, UniInsertCoinsOptionsFile opfile, UniInsertCoinsRecord recordFile)
 {
     recordFile.PlayerAward(opfile.awardCount);
 }