Hi,
Good catch. This is a little inconsistency in the code. I would disable the game object last because one cannot know what happens in Unity.
The best would be to test the code. If the outcome is the same, the order does not matter. In that case, the methods in the enemy object get called and executed independently from the state of our game object. However, if the outcome is not the same, it might be that gameObject.SetActive(false); terminated our coroutine.
Did this help?
See also:
- Forum User Guides : How to mark a topic as solved