Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: AOT autogenerator hangs Unity editor + other issues #66

Open
robotink opened this issue Sep 25, 2019 · 2 comments
Open

Bug: AOT autogenerator hangs Unity editor + other issues #66

robotink opened this issue Sep 25, 2019 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@robotink
Copy link

robotink commented Sep 25, 2019

Followed the Unity guide, using latest 2019.2.6f1. Cloned the repo and copied the folders in as per instructions.

  • conflict with System.Runtime.CompilerServices.Unsafe.dll (also used by Unity.Mathematics i believe). deleted the one in Ceras, and was able to continue
  • compiler errors with Color in formatter class. replaced with UnityEngine.Color since i wasnt planning on using colors, was able to finally compile

I was able to run the AOT auto formatter once in another project. updating anything in the custom class has its own set of issues, which i wont get into here.

Now when i modify the custom data class (simple class with a public int and bool) or add a new class with [GenerateFormatter], the autoformatter stalls and hangs the Unity editor. have to force quit.

my SerializerConfig is set up like this as per documentation for Unity + IL2CPP:

 var config = new SerializerConfig();
config.Advanced.AotMode = AotMode.Enabled;
GeneratedFormatters.UseFormatters(config);// Also add this line when creating your SerializerConfig if you use IL2CPP
CerasUnityFormatters.ApplyToConfig(config); // Formatters from the UnityExtension for Vector3 etc...
ceras = new CerasSerializer(config);
@robotink robotink added the bug Something isn't working label Sep 25, 2019
@robotink
Copy link
Author

just tried setting up v5 from source as per #56 to see if it made any difference

after modifying the editor script to only run autogeneration manually (via a button) I was able to debug a bit more - it seems to hang the editor only if i include an array. List<> is ok.

 [GenerateFormatter]
    public class NetworkData
    {
        //public ulong[] compressedPositions; //causes editor hang
        public ulong compressedPosition;
        public uint compressedRotation;
        public ulong compressedPosition2;
        public uint compressedRotation2;
        public List<ulong> positions; //works!
        public List<uint> rotations;
    }

(btw the Autogenerator always includes an extra bracket in the Serialize and Deserialize functions)

@U3dDevTom
Copy link

HI , I want to know how to find if unity use System.Runtime.CompilerServices.Unsafe.dll?
I use ceras version is 4.17 ,i have not throw conflict about you say,
But i build andriod package throw a null exception in Unsafe code..I guess it ignore the original version.maybe it export unsafe.dll version is Unity.

But I am not confirm if true.. could you tell me how to find if the unity use Unsafe.dll?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants