- Import package.
- Go to tab MFPS > Addons > Challenges > Enable.
- Add this snippet to bl_UserMetaData.cs in RawData class:
public SeasonInfo SeasonData = new SeasonInfo();
- Run integration by going MFPS > Addons > Challenges > Integrate and follow the steps.
- Now add this snippet to bl_GameFinish.cs at the end of CollectData() to track missions:
if (!bl_PhotonNetwork.OfflineMode)
{
MissionProgress missionProgress = new MissionProgress();
missionProgress.Kills = kills;
missionProgress.Deaths = deaths;
missionProgress.Headshots = bl_GameManager.Instance.Headshots;
missionProgress.PlayTime = timePlayed;
missionProgress.Map = bl_GameData.Instance.AllScenes.FindIndex(x => x.RealSceneName == bl_PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey].ToString());
if (winner)
missionProgress.Wins = 1;
else
missionProgress.Loses = 1;
MissionsData.Instance.UpdateMissionProgress(missionProgress);
}
If you use Game Resume Pro
- Add this to bl_GameResumeProUI.cs at the end of CalculateStats() to update mission progress.
if (!bl_PhotonNetwork.OfflineMode)
{
MissionProgress missionProgress = new MissionProgress();
missionProgress.Kills = kills;
missionProgress.Deaths = deaths;
missionProgress.Headshots = headShots;
missionProgress.PlayTime = secondsPlayed;
missionProgress.Map = bl_GameData.Instance.AllScenes.FindIndex(x => x.RealSceneName == bl_PhotonNetwork.CurrentRoom.CustomProperties[PropertiesKeys.SceneNameKey].ToString());
if (bl_GameManager.Instance.isLocalPlayerWinner())
missionProgress.Wins = 1;
else
missionProgress.Loses = 1;
MissionsData.Instance.UpdateMissionProgress(missionProgress);
}