If you work with the old Gui, the ‘OnGUI’ method, in MonoBehaviour’s you can skip this part.
But if you work with the new Gui system please keep reading.
The new Gui systems connects the Gui and and its functionality through the editor.
Here you see some Canvas and a Button. The button has an OnClick Component. There you can connect an MonoBehaviour method with the button’s ‘on click’ event. Unity saves this connection intern, where the obfuscator has no access too. So what you have to do is, adding an ‘DoNotRenameAttribute’ to this OnClick Method.
Could look like this. This will make the obfuscator to do not rename this method, so Unity and the Game knows which method is meant by the on click.
The Obfuscator provides an option that tries to find all gui methods. But sometimes you have to add the ‘DoNotRenameAttribute’ at your own.
The same is with Animation methods. The editor allows to connect methods from the source code with Animation events. These methods should not be renamed trough the Obfuscator.
The Obfuscator provides an option that tries to find all animation methods. But sometimes you have to add the ‘DoNotRenameAttribute’ at your own.
Unity adds, at the Game building, some additional functionallity to the source code . The networking belongs to this too. The obfuscator recognises NetworkBehaviour RPC’s/CMD’s/… depending on the name. So please do not use methods, in NetworkBehaviours, thats name starts with either: