Untitled

mail@pastecode.io avatar
unknown
plain_text
a year ago
576 B
1
Indexable
Never
using UnityEngine;

[System.Serializable]
public class UpgradeableData
{
    public int maxLevel;
    public float sizeIncrement;
}

public class UpgradeableRepository : MonoBehaviour
{
    public UpgradeableData[] upgradeableDataList;

    public UpgradeableData GetUpgradeableData(int currentLevel)
    {
        if (currentLevel >= 0 && currentLevel < upgradeableDataList.Length)
        {
            return upgradeableDataList[currentLevel];
        }

        Debug.LogError("Invalid currentLevel: " + currentLevel);
        return null;
    }
}