Unity3d Error---Build failed : Asset is marked as don't save

来源:互联网 发布:c语言是怎么开发出来的 编辑:程序博客网 时间:2024/06/15 05:08

In a script I had:

  1. public class RoadManager : MonoBehaviour{
  2.  
  3. public GUIStyle centerStyle;
  4. public GUIStyle RCP_LabelStyle;
  5. public GUIStyle RCP_PlusStyle;
  6. }

and in and Editor Script I did something like this

  1. roadmanger.centerstyle = EditorStyles.bold;
  2. //Modified some attributes, etc etc

this saved editor information into a the object, and internal graphics, and referances to other editor info. I still want to keep these referances for my Custom inspector, so I did this to make it so the info doesn't come into a build

  1. public class RoadManager : MonoBehaviour{
  2.  
  3. #if UNITY_EDITOR
  4. public GUIStyle centerStyle;
  5. public GUIStyle RCP_LabelStyle;
  6. public GUIStyle RCP_PlusStyle;
  7. #endif
  8. }

Hopes this saves someone the headache i went through :)