public T GetComponent <T>() where T : IRenderComponent { if (components == null) { return(default(T)); } Type type = typeof(T); IRenderComponent c = components[type, type]; return(c as T); }
public void RemoveComponent <T>() where T : IRenderComponent { if (components == null) { return; } Type type = typeof(T); IRenderComponent c = components[type, type]; if (c != null) { c.Destroy(); components[type, type] = null; tempComponents.Remove(c); } }