Ejemplo n.º 1
0
    public int AIBattleCount;           //AI对战次数

    public static void Serialize()
    {
        if (ConstantData.gameStatisticsData == null)
        {
            return;
        }
        StreamTools.SerializeObject(ConstantData.gameStatisticsData, ConstantData.gameStatisticsDataPath);
    }
Ejemplo n.º 2
0
    protected void GameOver(IPlayer player)
    {
        string name = LevelDataIndex.CurrentLevel.FileName;

        m_PlayerData.HitRate = m_PlayerData.ShotCount == 0 ? 0 : (float)m_PlayerData.PottedCount / (float)m_PlayerData.ShotCount;
        int star = 0;

        if (player != null && player.playerID == playerID)
        {
            AddScore(ShotsRemain * 200, null);
            m_PlayerData.Star = LayoutConfiguration.instance[name].GetStarWithScore(m_PlayerData.Score);
            int starRecord = ConstantData.missionRecords.GetStar(name);
            GameStatistics.MarkMissionStars(Mathf.Max(0, m_PlayerData.Star - starRecord));
            star = Mathf.Max(starRecord, m_PlayerData.Star);
            ConstantData.missionRecords.Record(name, star, m_PlayerData.HighScore);
            StreamTools.SerializeObject(ConstantData.missionRecords, ConstantData.missionLevelDataRecordPath);
            BaseUIController.MSettlement.MissionComplete(m_PlayerData);
            string nextMission = ConstantData.LevelDatas.Next(LevelDataIndex.CurrentLevel).FileName;
            if (ConstantData.LevelDatas.Comp(PlayerPrefs.GetString(ConstantData.MissionProgressKeyName), nextMission) == -1)
            {
                PlayerPrefs.SetString(ConstantData.MissionProgressKeyName, nextMission);
            }

            //about achieve
            if (GameManager.Rules.firstRound)
            {
                ConstantData.achieveRecords.Mark(name, AchieveType.FinishWithTriangularPole);
            }
            else
            {
                ConstantData.achieveRecords.Mark(name, AchieveType.Finish);
            }
        }
        else
        {
            BaseUIController.MSettlement.MissionFail(m_PlayerData);
        }
        //BaseUIController.MSettlement.SetMissionData(m_PlayerData);
    }
Ejemplo n.º 3
0
 private void SerPool()
 {
     StreamTools.SerializeObject(m_DataAssetTemp, StreamTools.GetStreamingAssetsPath() + ConstantData.PoolDataAssetsFile);
 }