Open ajboni opened 9 years ago
The problem is that webPlayer donsn't have permission for files in System.IO. Is there a way to "disable" all FastSave related when in Webplayer platform? maybe add a condition #if(!UNITY_WEBPLAYER)
That's weird cause that call is wrapped with #if UNITY_EDITOR. Maybe try add && !UNITY_WEBPLAYER?
Made a really diry fix for now on BetterPrefs.cs will return null, but since im not using any for the moment it just let me buil to webplayer,.
#if (UNITY_EDITOR && !UNITY_WEBPLAYER)
static BetterPrefs instance;
public static BetterPrefs GetEditorInstance()
...
...
#if (UNITY_WEBPLAYER)
static BetterPrefs instance;
public static BetterPrefs GetEditorInstance() {
return instance;
}
#endif
What does that have to do with AssetStorage.cs? Are you saying there's another error?
Ah yes sorry, I also change on AssetsStorage on the line where it calls for GetDirectories
string directory = null;
#if (!UNITY_WEBPLAYER)
directory = Directory.GetDirectories("Assets", "FastSave", SearchOption.AllDirectories).FirstOrDefault();
#endif
if (directory == null)
Debug.LogError("Couldn't find FastSave directory!");
else
...
Please be more elaborate. 1- What issues did you have with BetterPrefs.cs? I always test for build before publishing. Was it also only Webplayer related? 2- There was a #if UNITY_EDITOR wrapping the whole code snippet not just the GetDirectories call, add the && !UNITY_WEBPLAYER to it and not around the call line alone.
Do those and do a pull request for quick merging.
Sorry! Yes they all are webPlayer Related. 1-there was several calls to BetterPrefs.GetEditorInstance, so I added the condtion there, BUT it is probably better to add the condition on each call. 2- Done
Ill do a PR as soon as I get n°1 tidier.
Thank you!!!
About 1. Switching platform to WebPlayer give me same error in BetterPrefs:
Assets/Plugins/Vexe/Runtime/Types/Others/BetterPrefs.cs(58,38): error CS1501: No overload for method `GetDirectories' takes `3' arguments
I was able to compile adding !UNITY_WEBPLAYER and return null for GetEditorInstance but then again rabitGUI and BaseEditor use BetterPrefs so It would fail to show the component.
Note this only happens when you Switch Platform to WebPlayer.
Yes, you are right, UNITY_EDITOR is set to true during the build, that is why you need UNITY_WEBPLAYER. I realized it after reading http://answers.unity3d.com/questions/604503/if-unity-editor-stuff-getting-called-at-runtime-as.html which was actually a question from vexe himself!
I think that to solve the problem, we need to make clear what is needed when working inside the editor, when building and when playing. Apparently you need BetterPrefs' GetEditorInstance() even in other build modes. For instance, I tried to replace #if UNITY_EDITOR
with #if (UNITY_EDITOR && !UNITY_STANDALONE)
above public static BetterPrefs GetEditorInstance()
, and I got the same build / compile error as described above. (When a build mode is selected, the same config seems to be used for the editor player so build errors become normal compile errors.)
Since I can't find a property that is true/false only when building/playing, I guess the the possible solutions are:
@rodobodolfo are you still having this issue or did you resolve it somehow?
@vexe Sorry I couldnt fix it.
What I did though, to be able to build to webplayer:
Hi,
it would be great if there was a fix for this. Everything works great except the webplayer compilation... I've tried adding the #if (!UNITY_WEBPLAYER) statements but even though I have no build errors there is some null reference error in editor.
Thanks
I tried another strategy for one of my projects: remove Vexe files and all their dependencies down from BetterPrefs.cs until all errors disappear.
And it works.
However, you should not use VexeDrawers, Vexe GUIs and other classes relying on BetterPrefs. Don't forget to remove examples too.
If the dependency on BetterPrefs is loose, you can also cut them inside the code by placing some #if !UNITY_WEBPLAYER at the right place, so that you can use a little more classes.
If it helps, I just stopped using webplayer (Which is dying btw) and switch to HMTL5 and its working flawlessly. I recommend to switch to HTML5 build as its becoming more and more stable lately.
After upgrading to vfw134
Assets/Plugins/Vexe/Runtime/FastSave/Storage/AssetStorage.cs(87,39): error CS1501: No overload for method
GetDirectories' takes
3' argumentsI think It only happens when you swtich platform to WebPlayer.