IndieGame/client/Assets/Ether/Scripts/Module/UI/FrameData.cs
DOBEST\zhaoyingjie f242607587 初始化工程
2024-10-11 10:12:15 +08:00

36 lines
707 B
C#

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace Ether
{
public class FrameData
{
private DictionaryEx<string, object> allDataDic = new DictionaryEx<string, object>();
public bool Add(string name, object value)
{
if (allDataDic.ContainsKey(name))
{
return false;
}
allDataDic.Add(name, value);
return true;
}
public T Get<T>(string name)
{
if (allDataDic.TryGetValue(name, out object value))
{
return (T)value;
}
return default;
}
}
}