- Home /
Can't use System.IO.FileInfo.Delete
I'm trying to make a level editor that uses XML, so I started with this script on the Unify Wiki. But it won't compile as-is--it says 'Delete' is not a member of 'System.IO.FileInfo'.
What's up? That's the only error it throws and if I take that line out it compiles, but it's a pretty important feature.
Answer by yoyo · Apr 14, 2011 at 03:45 AM
There are some .NET features that you can't use from a Web Player build, and System.IO.FileInfo.Delete seems to be one of them. If you switch your build settings (File > Build Settings ... > Switch Platform) to Mac or PC Standalone then it should work.
Have a look at the C# preprocessor options to allow your codebase to compile in multiple contexts.
Thanks, great answer. I was on Web and was planning to use the level editor to create the levels via Editor Preview then package them with the game for Web. Thanks again!
Your answer
Follow this Question
Related Questions
Editor split scene 1 Answer
Creating a Level using XML 1 Answer
Event or Callback for when Files are moved. 1 Answer
Using static members vs normal ones for exp,lvl, health ect.. 1 Answer