Closed Danand closed 8 months ago
hi @Danand
Thank you very much for your PR! I have added a documentation description for this change. https://github.com/AirtestProject/Poco/pull/608/commits/22bf600bcf5c23f0fdedb964e26c33b3716d4680
Please help me check whether this content is correct. If there is no problem, these changes will be updated in the next version.
Please help me check whether this content is correct.
@yimelia
Hi! Everything is correct, but it's also worth to mention how to utilize UnityPoco.sendMessage()
on Unity-side:
PocoManager.MessageReceived += OnPocoMessageReceived;
@yimelia
Also do not forget about PR at Poco-SDK
respectively! 😉
https://github.com/AirtestProject/Poco-SDK/pull/123
hi @Danand
I have updated the document description, but my English is not good and I am not sure whether I have expressed the intended meaning correctly. Please help me confirm the content again. Thank you very much!
https://github.com/AirtestProject/Poco/commit/f229be9738292fa96b37d073e26aa92f107401d2
@yimelia Everything is clear!
HI @Danand Some of our users have encountered errors after updating the code, can you please help to see how to modify the code to be compatible with this issue?
how to modify the code to be compatible with this issue?
@yimelia Hi!
I guess, simple null check goes here:
if (listeners == null)
{
return;
}
at before PocoListenerUtils.cs:14
Sorry for the inconvenience. I didn't test properly so far. This functionality must be optional (no assigned PocoListenersBase
), but I missed that somehow.
When users update their SDK code, this error seems to be triggered if they do nothing.. @Danand
@yimelia
It's because no object assigned to PocoManager.pocoListenersBase
by default, it's my bad.
Users could fix error for now, that way: add component PocoListenersBase
and assign it to field pocoListenersBase
of PocoManager
component. Error should be gone.
Can the code be changed so that users can run it smoothly without any operations, if they don't need this new feature?
@yimelia Yes, I suggested fix here: https://github.com/AirtestProject/Poco/pull/607#issuecomment-1983095687
Changes
UnityPoco.sendMessage()
function for handling simple calls with singlestring
argumentUnityPoco.invoke()
function for handling calls with custom argumentsExample
Here is example usage of
UnityPoco.invoke()
Poco-side
Unity-side
Derive some new class from
PocoListenerBase
Add method:
Add reference at
PocoManager
to ancestor ofPocoListenerBase
Dependencies
This is dependency for https://github.com/AirtestProject/Poco-SDK/pull/123