//--------------------------------------------------------------------- public T addComponent <T>() where T : IComponent, new() { string type_name = EntityMgr.getComponentName <T>(); T component = (T)_addComponent(type_name, null, true); return(component); }
//--------------------------------------------------------------------- public void removeComponent(IComponent component) { if (component == null) { return; } string type_name = EntityMgr.getComponentName(component); removeComponent(type_name); }
//--------------------------------------------------------------------- public T getComponent <T>() where T : IComponent { string type_name = EntityMgr.getComponentName <T>(); if (mMapComponent.ContainsKey(type_name)) { return((T)mMapComponent[type_name]); } else { return(default(T)); } }