- Home /
EditorGUI Error when building to iPhone
I am using the 'EditorGUI.DropShadowLabel' function to draw a drop shadow on a few of my labels.
More info here if you don't no about it: http://docs.unity3d.com/Documentation/ScriptReference/EditorGUI.DropShadowLabel.html
It runs wonderfully when testing on my Mac. But when I attempt to build it out to my iPhone, I receive an "Unknown identifier: 'EditorGUI'" error.
Does anybody have any idea why?
Thank you in advance!
Is this an editor script? That is, does it extend Editor and is it in a folder called Editor?
Editor folders should be stripped out of the build automatically for you.
@ZenithCode - I have a script named 'Game', and inside that I have my OnGUI function. I also do have an Editor folder, and in that, I have the code from the Script Reference link I posted with my question.
O$$anonymous$$ that's good. So what exactly to you need?
The DropShadowLabel is not something you can see in the game itself. It can be used in the editor/inspector only.
@ZenithCode - But I have the following line in my 'Game' script:
EditorGUI.DropShadowLabel(Rect(0,0,100,100), "Final Score: " + finalScore, labelStyle);
And it shows perfectly in the game window when running on my $$anonymous$$ac, with the correct drop shadow.
Yet, refuses to build to iPhone...
Answer by ZenithCode · Oct 29, 2012 at 02:53 PM
OK so what you need to do is remove that DropShadowLabel and use this:
void OnGUI()
{
GUI.Label("Final score: " + finalscore, labelStyle);
}
Add your visual preferences in the style only. Remove the editor folder and the script in there.
@ZenithCode - Not to sure how to add that drop shadow to the actual style though?
This is a bit of a problem. You can't do shadow using GUIStyle or Skin. :(
I would suggest you create an image in Photoshop or similar and use that. If you do this, then you would need to create a font as well though.