public setResource ( string name, float fill, float max ) : void | ||
name | string | |
fill | float | |
max | float | |
리턴 | void |
public void setResource(string name, float fill, float max)
{
if (max == 0) { removeResource(name); return; }
if (fill > max) { fill = max; }
if (resourceList.ContainsKey(name))
{
ResourceListEntry entry = resourceList[name];
entry.fill = fill;
entry.max = max;
}
else
{
ResourceListEntry entry = new ResourceListEntry(name, fill, max);
resourceList.Add(entry.name, entry);
}
}