How to detect if unity build scene for target platform or editor player

I am using PostProcessScene attribute to hook script build

I want to know if it is building for playing just in editor or it is building for running in target platform

What class or method I could use to specify this information?

Try using BuildPipeline.isBuildingPlayer, Unity - Scripting API: BuildPipeline.isBuildingPlayer

@Thaina, you can use the pragma like below.

"#if UNITY_EDITOR
print(“Hello”);
#endif "

The code written inside the above pragma will only execute in editor not on the targeted platform.