I’m trying to build my game to an executable. Whenever I try to do so, Unity keeps throwing an error at me during compilation: “‘UnityEngine.Resources’ does not contain a definition for ‘LoadAssetAtPath’”. This is coming from the “Dialoguer” extension/plugin/tool I got from the Asset Store. According to another answer for another question, ‘LoadAssetAtPath’ is meant only for extending the Unity editor and will not compile into your game when building. So my question is; is there a way to build my game IGNORING the editor scripts from Dialoguer? I’m running Unity5, if that makes a difference.
You can wrap the call with a directive checking whether this is in the editor or not.
#if UNITY_EDITOR
//Code here
#endif
This will tell the compiler to ignore the code between the #if and #endif when you build the game to executable.