UnityGameProjectsCode / RelianceGame / GetEXPInfo.cs
GetEXPInfo.cs
Raw
using TMPro;
using UnityEngine;

public class GetEXPInfo : MonoBehaviour
{
    private int leadBotEXP;
    private int blueBotEXP;
    private int greenBotEXP;
    private int orangeBotEXP;
    public TextMeshProUGUI leadText;
    public TextMeshProUGUI blueText;
    public TextMeshProUGUI greenText;
    public TextMeshProUGUI orangeText;

    HUBTracker tracker;

    private void Awake()
    {
        tracker = GameObject.Find("Persistent Object").GetComponent<HUBTracker>();
    }

    private void Start()
    {
        GetEXPValues();
        AssignTextValues();
    }

    public void GetEXPValues()
    {
        int[] expValues = tracker.GetTempEXPValues();

        leadBotEXP = expValues[0];

        for (int i = 0; i < expValues[1]; i++)
        {
            leadBotEXP += 100;
        }

        blueBotEXP = expValues[2];

        for (int i = 0; i < expValues[3]; i++)
        {
            blueBotEXP += 100;
        }

        greenBotEXP = expValues[4];

        for (int i = 0; i < expValues[5]; i++)
        {
            greenBotEXP += 100;
        }

        orangeBotEXP = expValues[6];

        for (int i = 0; i < expValues[7]; i++)
        {
            orangeBotEXP += 100;
        }
    }

    public void AssignTextValues()
    {
        leadText.text = leadBotEXP.ToString();
        blueText.text = blueBotEXP.ToString();
        greenText.text = greenBotEXP.ToString();
        orangeText.text = orangeBotEXP.ToString();
    }
}