36 lines
707 B
C#
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;
|
|
}
|
|
}
|
|
}
|