Open
Description
We need a method to query singleton components. We will use this method in many scenarios, such as Player Input, making the code look more concise and readable.
private QueryDescription mDescription = new QueryDescription{Any = new ComponentType[]{typeof(C_PlayerInput)}};
public void Query()
{
world.Query(mDescription, (ref C_PlayerInput input) =>
{
if (input.IsClicked)
{
//Query another entity....
}
});
}
public void QueryUnique()
{
var playerInput = world.QueryUnique<C_PlayerInput>();
//Query another entity...
}
Metadata
Metadata
Assignees
Labels
Projects
Status
Todo