using System.Linq;
using UnityEngine;
public class DictionaryExample : MonoBehaviour
{
private Dictionary<int, string> myDictionary = new Dictionary<int, string>()
{
{1, "One"},
{2, "Two"},
{3, "Three"}
};
void Start()
{
KeyValuePair<int, string> lastElement = myDictionary.Last();
int lastKey = lastElement.Key;
string lastValue = lastElement.Value;
Debug.Log($"Last Key: {lastKey}, Last Value: {lastValue}");
}
}