dimanche 10 février 2019

Prevent Unity Editor Inspector Checkbox from having any action in-game

To sum this up the best I can: I have some code that sets a boolean value to true. When this little checkbox is enabled, it works as intended, allowing the game to function normally. When set to true it does as expected

However, later on the code at some point sets this boolean to false (remember, it is a public boolean). Unfortunately, when this checkbox enabled. The console reads "true, false, true, false" etc. which prevents the desired outcome. You can see that the output is true, false, true, false when the checkbox is enabled

If I disable this checkbox, then the output reads "false, true, false, true" etc. which prevents anything from working. Nothing works!!!

Is there a way of disabling this stupid checkbox from having any effect in the game? I have tried [system.nonserialized] to no effect. At least, is there a way to disable and enable this checkbox in code?

Thanks! I hope this was clear enough.




Aucun commentaire:

Enregistrer un commentaire