DefaultEcs icon indicating copy to clipboard operation
DefaultEcs copied to clipboard

Add public property Id to world.

Open AustinSmith13 opened this issue 1 year ago • 3 comments

Added a public accessor to the internal world id. This is needed by our project so our extension methods can operate in a non global way.

AustinSmith13 avatar Feb 29 '24 16:02 AustinSmith13

Probably better to make it as GetHashCode() override instead of standalone property, the same way its done on entities.

nrader95 avatar Mar 01 '24 06:03 nrader95

@nrader95 I've updated this to use GetHashCode(), It also makes me wonder if this is really needed. I'm pretty new to this Library and so it wasn't obvious to me that I could add a world component to achieve the same thing. Although it may be useful to newcomers to have a simple way to grab a unique id without having to create a component that must be managed by them.

AustinSmith13 avatar Mar 01 '24 16:03 AustinSmith13

I mean, standalone property is not needed. At all. You just return World-Id when calculating GetHashCode and call it a day.

nrader95 avatar Mar 02 '24 14:03 nrader95