Unity and UE4 are two different engines, independently created, with two different codebases, and two different APIs (the functions that you as a user of those engines/libraries call).
Header files usually do not contain much logic by themselves (though they can, e.g. templates). Usually, header files simply declare the functions that are implemented elsewhere, so that your program knows that those functions exist, and can call them. The actual functions might be in an implementation file, or a statically or dynamically linked library that EU4 or Unity must provide.
If you're using Unity's development environment, you're most likely writing C# or Javascript scripts, in which case things like header files don't apply. But if you're writing C++ for Unreal Engine 4, then you'll most likely still be using header files.
__________________________________
Edit:
so am I right to conclude from this that I will have to learn how to program in unity separate from learning in VS, which is also different then learning to program in UE4. |
Unity and Unreal Engine have their own IDEs that internally use their pre-made engine, and you'll be writing code that goes on top of that existing engine layer. Visual Studio is more general; you're writing code for any purpose.
As far as the code itself goes, it's just text. Doesn't matter whether you write that in Visual Studio, or in Notepad.