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

Add handling of functions for Unity method invocations #123

Merged
merged 3 commits into from Dec 28, 2023

Conversation

Danand
Copy link
Contributor

@Danand Danand commented Dec 5, 2023

Changes

  • Add MessageReceived public event for handling simple calls with single string argument
  • Add HandleInvocation() private utility method for handling calls with custom arguments

Example

Here is example usage of UnityPoco.invoke()

Poco-side

poco = UnityPoco()
poco.invoke(listener="say_hello", name="anonymous", year=2024)

Unity-side

  1. Derive some new class from PocoListenerBase

  2. Add method:

    [PocoMethod("say_hello")]
    public void SayHello(string name, int year)
    {
        Debug.Log("Hi, ${name}! {year} is coming soon!");
    }
  3. Add reference at PocoManager to ancestor of PocoListenerBase

Dependencies

Depends on AirtestProject/Poco#607

@Danand Danand changed the title Feature/unity invoke Add handling functions for Unity method invocations Dec 5, 2023
@Danand Danand changed the title Add handling functions for Unity method invocations Add handling of functions for Unity method invocations Dec 5, 2023
@yimelia yimelia self-requested a review December 28, 2023 07:47
@yimelia yimelia merged commit aa8a0de into AirtestProject:master Dec 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants