Question by
eubrunomiguel · Mar 14, 2016 at 02:54 AM ·
functioncallcallbackcalling
What is the recommend practice to check condition? Before calling a function or on the function?
Example:
if(_objToInteract != null && isPlayerCloseToTarget()) doInteract(); // interact with objects public void doInteract() { if (_objToInteract = null) return; }
What would be the best practice to do it?
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612071725im_/https://answers.unity.com/themes/thub/images/avi.jpg)