vovgou / loxodon-framework

An MVVM & Databinding framework that can use C# and Lua to develop games
MIT License
1.86k stars 363 forks source link

Related to enter play mode settings #27

Closed ApprenticeGC closed 1 year ago

ApprenticeGC commented 1 year ago

Check "Enter Play Mode Settings" with no Reload domain will result error. Is there any setting necessary to be adjusted? This is the doc from Unity, Configurable Enter Play Mode. The errors I receive are

ArgumentException: An item with the same key has already been added.

DuplicateRegisterServiceException: Duplicate key IBinder Loxodon.Framework.Services.ServiceContainer.Register[T]

I guess it is the use of static variable causing such errors? I am just wonering if there is a way to work with Loxodon framework as nowadays, turning on Enter Player Mode Settings speed up the development.

vovgou commented 1 year ago

I don't understand what your problem is

vovgou commented 1 year ago

BindingServiceBundle bundle = new BindingServiceBundle(context.GetContainer()); bundle.Start();

The class “ApplicationContext” is static, it holds the service container, so an error will occur when the above code is run multiple times.

I tested the problem you mentioned, you need to check the reload domain option.

image

vovgou commented 1 year ago

Loxodon.Framework2.4.2.zip

@ApprenticeGC I modified the code to be compatible with the “Configurable Enter Play Mode” feature, please download the attachment

ApprenticeGC commented 1 year ago

Thanks for the modification. Everything works as expected after replacing with version 2.4.2.

ApprenticeGC commented 1 year ago

Hello Clark,

This is a general question which I don't think firing issues on GitHub will be a good idea. Basically, I see that Loxodon has a message system(publish, subscribe). I am just curious, is there any benchmark I can reference so that I could understand how it compares to, signal bus of Zenject, UniRx subject, C# event?

Regards Ray

On Fri, Jul 15, 2022 at 11:25 AM Clark Yang @.***> wrote:

Closed #27 https://github.com/vovgou/loxodon-framework/issues/27 as completed.

— Reply to this email directly, view it on GitHub https://github.com/vovgou/loxodon-framework/issues/27#event-6998902725, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHTVYBRXDXDHRPNOAURRFLVUDKZLANCNFSM53NVJTAQ . You are receiving this because you were mentioned.Message ID: @.***>

vovgou commented 1 year ago

@ApprenticeGC It's an alternative to C# event.

Recently I added Loxodon.Framework.Fody, I recommend you to use it.