I am using a point system that has categories of points. I am looking for a way to access both the value of an int and the name of the int to be printed on what will ultimately be a “high score” page. Not sure if I am approaching with the right angle on this problem.
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class Int_SortScript : MonoBehaviour
{
public Text Project;
public int junk;
public int trash;
public int waste;
public int prize;
public int PrintMax;
public List<int> PointList = new List<int>();
int GetMax()
{
PointList.Sort();
int max = PointList[PointList.Count - 1];
return max;
}
void Start()
{
PointList.Add(junk);
PointList.Add(trash);
PointList.Add(waste);
PointList.Add(prize);
}
void Update()
{
PrintMax = GetMax();
Project.text = PrintMax.ToString();
}
}