InvexGames / MaterialUI

MaterialUI is a UI kit for Unity that follows Google's official material design guidelines.
http://invexgames.com/materialUI.html
Other
771 stars 199 forks source link

Web build code doesn't compile #35

Closed tbillington closed 9 years ago

tbillington commented 9 years ago

When making a web build, this error occurs Assets/MaterialUI/Scripts/ShadowGen.cs(292,40): error CS0117: 'System.IO.File' does not contain a definition for 'WriteAllBytes'.

From cursory investigation it's because I'm in web build mode and web builds don't have that method defined. I see that file is Unity Editor only, I have just commented that line out as a temporary solution.

InvexGames commented 9 years ago

Hey there,

I'll make that section platform-dependant so it won't have that issue, when I can. Thanks for bringing it to my attention.

nah0y commented 9 years ago

Not 100% sure but I think you can just call AssetDatabase.CreateAsset(destTex, textureFileName); Of course you will lose the byte[] bytes = destTex.EncodeToPNG(); so it will not be encoded to PNG. But it may be enough ;)

tbillington commented 9 years ago

It almost seems like a bug in Unity to complain about the platform of the code when it is editor only.

nah0y commented 9 years ago

Yes also :)

InvexGames commented 9 years ago

Fixed in the latest commit :)