I give up and don't understand how to fix the code, I ask for help. Return does not return anything in my case. In the console, it really gives a result, but it is not needed in it. How do I make a working code out of this? All variables are taken from unity. To understand, the condition of such a "tool moves 3 pins depending on the values of the parameters of the tool (tools - 3)", I shortened as much as I could and reached the return, but there was no response from him. Drill/Hammer/Lockpick Click - Buttons
private int PinsOnInstrumentClick(int param, int pin) { pin += param; if ((param > 0 && pin <= 10) || (param < 0 && pin >= 0)) { return pin; } else { return 0; } } private void PinsOnDrillClick() { PinsOnInstrumentClick(drillParam1, pin1); PinsOnInstrumentClick(drillParam2, pin2); PinsOnInstrumentClick(drillParam3, pin3); } private void PinsOnHammerClick() { PinsOnInstrumentClick(hammerParam1, pin1); PinsOnInstrumentClick(hammerParam2, pin2); PinsOnInstrumentClick(hammerParam3, pin3); } private void PinsOnLockpickClick() { PinsOnInstrumentClick(lockpickParam1, pin1); PinsOnInstrumentClick(lockpickParam2, pin2); PinsOnInstrumentClick(lockpickParam3, pin3); } public void DrillClick() { PinsOnDrillClick(); GameWin(); } public void HammerClick() { PinsOnHammerClick(); GameWin(); } public void LockpickClick() { PinsOnLockpickClick(); GameWin(); }