SmartlyDressedGames / Unturned-3.x-Community

Community portion of the Unturned-3.x repo. If you have access to the source code you can find it here:
https://github.com/SmartlyDressedGames/Unturned-3.x/
85 stars 18 forks source link

BarricadeRefComponent and StructureRefComponent are internal #4380

Closed QERT2002 closed 2 months ago

QERT2002 commented 2 months ago

I need to find out from the transform whether it is a barricade or a structure, but due to the fact that these classes are internal, I cannot do this. I tried to do this in a roundabout way, but nothing worked 100% and there is no way in the game to find out whether it is a barricade or a structure just by transform. Some barricades do not have the ability to select them, therefore there is no Interactable2SalvageStructure component and I cannot check what kind of transform it is, other barricades may not have the Barricade tag, please make these classes public, this is not a difficult update, but it will significantly help in writing plugins.

And since the game has 2 different Client/Server packages, you can make all the structure classes and so on in the server part public so that you don’t have to use reflection if you need to make, for example, some kind of code patch, it's annoying

SDGNelson commented 2 months ago

Hehe that's why the member is called tempNotSureIfBarricadeShouldBeAComponentYet. I didn't decide yet whether or how much to move into components on these. If you want to know whether they are a barricade or a structure you can use CompareTag with "Barricade" or "Structure" though long-term I'd like to get rid of the tag usage.