- Home /
Build problem
Hey guys. My game was working perfect on editor. but I cant build :(
Now what I do ?
Are you sure the file is in a folder called Editor?
Otherwise, you will have to add
#if UNITY_EDITOR
// your code
#endif
around your code
Answer by TanselAltinel · Apr 26, 2018 at 01:51 PM
Unity cannot build Editor related scripts to standalone player.
You need to move your Editor scripts to a folder called Editor. You can see more information here: https://docs.unity3d.com/Manual/SpecialFolders.html
If your scripts are being used by game objects and they incorporate editor scripting and game scripting together, you can do it like this:
#if UNITY_EDITOR
using UnityEditor;
#endif
// your game scripting code
#if UNITY_EDITOR
// your editor scripting codecode
#endif
// your game scripting code
thank you for answer. I move script to editor folder and this problem fixed :)
Your answer
Follow this Question
Related Questions
Initialising List array for use in a custom Editor 1 Answer
Confused about custom GameObjects,Custom GameObject confusion 0 Answers
myObjetc..GetType().GetCustomAttributes(typeof(RequireComponent) not working correctly 1 Answer
Get callback when assets loading or deserialization finished? 1 Answer
Multiple Cars not working 1 Answer