예제 #1
0
    public T GetComponent <T>() where T : new()
    {
        int   component_type = IEntityComponent.GetComponentID <T>();
        ulong ptr            = WComponent(handle, component_type, 3);
        T     result         = new T();

        ((InternalObject)(object)result).SetHandle(ptr);
        return(result);
    }
예제 #2
0
    public void AddComponent <T>()
    {
        int component_type = IEntityComponent.GetComponentID <T>();

        WComponent(handle, component_type, 1);
    }
예제 #3
0
    public void RemoveComponent <T>()
    {
        int component_type = IEntityComponent.GetComponentID <T>();

        WComponent(handle, component_type, 2);
    }