BrokenBricksECS icon indicating copy to clipboard operation
BrokenBricksECS copied to clipboard

ComponentGroup API naming

Open acoppes opened this issue 6 years ago • 2 comments

This is both a question and a proposal, the current ComponentGroup API is GetComponent<T> but it returns a ComponentArray. Shouldn't it be GetComponentArray<T> or GetComponents<T>?

For example, if you read:

var inputs = g.GetComponent<InputComponent> ();

it is not clear, I believe it could be better to identify you want a component array and not a component

I know this could be solved also on the user side buy changing it to:

ComponentArray<InputComponent> inputArray = group.GetComponent<InputComponent> ();

But still the ECS API could help.

acoppes avatar Jan 14 '18 15:01 acoppes

Well what else should a componentGroup return ;)

Well I could change this but I want to be close to unity's upcoming api

Spy-Shifty avatar Jan 14 '18 17:01 Spy-Shifty

When it comes out, I will suggest them to change it also ;)

acoppes avatar Jan 14 '18 18:01 acoppes