Skip to content

Conversation

antimundo
Copy link

I encapsulated some variables that never need to be accessed outside of the script, so the code has less public variables exposed.

@MarcoFazioRandom
Copy link
Owner

Hello @antimundo,
(I know I'm very late but I had to pause this project)

I made them public to be able to change them externally, for example from a Setting menu. Maybe it's not the cleanest solution, but I don't think making them private is better. Do you have an alternative idea?

@antimundo
Copy link
Author

@MarcoFazioRandom you can still change the variables in the editor since I added the [SerializeField] tag to the elements that were public.

If someone was using this plugin and really needed to make something public it could do so anyways, but making something private assures the people using this, that no external scripts are accessing it, and many other benefits related to encapsulation.

Code should be as encapsulated as posible: https://youtu.be/pD27YuJG3L8?si=QxpXC5eW6EjCQ0EI

But if you prefer it private it's your project anyways, so feel free to close this PR if you don't want it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants