how to set a score from 2 individual game.

Now i have 2 individual game in a project, this 2 game have its own score system.

i have a main menu for this 2 game, this main menu have 2 button for entering the game and 2 text for high score and current score.

High score is change the lowest score to the highest score from the 2 game. example game A score is 5 and game B score is 10, so game B score will replace the oldest score. vice versa. it will only can increase.

current score is change the score every time back to main menu. it dun care which score bigger, just want the current score of the game that was playing. it will change every time either the score is big or small.

now i would like to ask how to set the current score?

using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using StrikeFree.Game;
using UnityEngine.UI;
using UnityEngine.SceneManagement;

using System.Runtime.Serialization.Formatters.Binary;
using System;
using System.IO;
using CodeStage.AntiCheat.ObscuredTypes;

public class HighScore : MonoBehaviour {


	public Text HighScoreText;
	public Text CurrentScoreText;
	static public int highScore;
	static public int currentScore;

	int tempScore = 0;

	void Awake()
		Load ();
		//ObscuredPrefs.DeleteAll ();

	void Update(){
		HighScoreDisplay ();
		CurrentScoreDisplay ();

		if (ObscuredPrefs.HasKey ("highScore")) {
			highScore = ObscuredPrefs.GetInt ("highScore");

		if (tempScore < Score.score && highScore < Score.score) {
			tempScore = Score.score;
			highScore = tempScore;
			Save ();
		} else if (tempScore < ScoreManager.score && highScore < ScoreManager.score) {
			tempScore = ScoreManager.score;
			highScore = tempScore;
			Save ();

	void HighScoreDisplay () {
		HighScoreText.text = "High Score: " + highScore;

	void CurrentScoreDisplay()
		CurrentScoreText.text = "Current Score: " + currentScore;

	public void Save()
		CodeStage.AntiCheat.ObscuredTypes.ObscuredPrefs.SetInt ("highScore", highScore);
		CodeStage.AntiCheat.ObscuredTypes.ObscuredPrefs.Save ();

	public void Load()
		highScore = CodeStage.AntiCheat.ObscuredTypes.ObscuredPrefs.GetInt ("highScore");


Well, since this is present in your scene, you can simply add a prefix to all game specific prefs.

[SerializeField] string prefix;

highScore = PlayerPrefs.GetInt (prefix+"highScore");

Then you set the prefix to a different key in every game.