Forum rules - please read before posting.

BUG: CursorIcon (de)serialization on Windows Phone

Although it is actually a Unity bug IMHO, I have encountered an issue with deserialization of CursorIcon on Windows Phone 8. In a rudimentary effort to fix this issue without the need of a fix of the Unity engine - 5.0.1 - I encountered the following.

CursorIcon, marked with System.Serializable, inherits from CursorIconBase, also marked with System.Serializable. The CursorManager maintains a List of CursorIcon instances, and it also marked with System.Serializable.

Since the issue occurs in deserialization my first hint was to merge CursorIconBase into CursorIcon as a single class, marked with System.Serializable. Now running the demo on the Windows Phone is without deserialization error(s).

I noticed CursorIconBase is used in one other place, MenuGraphic. I am going to file a bug report at Unity as well, but in the mean time, is MenuGraphic dependent on it's graphic field being a CursorIconBase, or is it possible to use CursorIcon directly without any issues in MenuGraphic?

I believe it is of interest inheriting Serializable classes from Serializable classes (although I also read inheriting from not marked as such classes) can cause issues in the Windows mobile/metro area.

Cheers!
Jorrit


Comments

  • You're right, that does seem to be a Unity bug - I'd appreciate you filing that report with Unity.

    You should be able to use a CursorIcon in MenuGraphic, but that's just a hunch.
  • edited April 2015
    Bug report with the demo project is submitted, see http://fogbugz.unity3d.com/default.asp?693275_hjv3ev46belfvcno
  • I got response from Unity, and the error should be in Adventure Creator. A lot of code is guarded by #if UNITY_EDITOR define checks, most of this code is for editor purposes. See comments in thread.

    Why have you put all the editor code mixed with all the runtime code, btw?

    It is still not clear to me why there is any difference between the iOS and Android platforms regarding the serialization of CursorIcons, since I don't see specific cases for these platforms regarding serialization.
  • So that they can be called upon by both the editor and runtime.

    But you're right: there is no difference at all when it comes to CursorIcons on iOS/Android.  As the Unity dev said, Unity's serialization method is different on WP8 - I think this is more of a case of Unity / AC just working differently in this case, and not so much a bug.

    AC has never been Windows Phone compatible, though I try to offer advice when I can.  In this case, there's nothing more I can do - if you bought AC on the basis that it was WP8-ready, then please email/PM me your invoice number and I'll issue you a refund.
  • An updated reply from the Unity devs can be found in the thread. It is a performance issue for WinRT/WP8.

    The best option is to fully separate editor and runtime code in projects and plugins. Most editor code is not required to be present in the runtime, and creates quite some cluttering. By the way Adventure Creator is implemented this seems to be a tough nut to crack.

    Fortunately we can overcome the issue, so a refund is absolutely not necessary. Maybe you can put that into a Windows Phone fund? :)
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.