-
Notifications
You must be signed in to change notification settings - Fork 9
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
feat: add unity grpc client #105
Conversation
Signed-off-by: D4ryl00 <[email protected]>
Signed-off-by: D4ryl00 <[email protected]>
4dd0ce6
to
7bef0eb
Compare
examples/UnityClient/README.md
Outdated
go run . tcp -addr 127.0.0.1:7042 | ||
``` | ||
|
||
In Unity Hab, import this folder. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Hab" should be "Hub".
examples/UnityClient/README.md
Outdated
`Assets/Scenes/SampleScene.unity` is the Unity scene we use for the demo. We | ||
implemented a button to start an action, and a text object to print the result. | ||
|
||
`Assets/GnoClient.cs` is the script where lives the gRPC client. The `Start()` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small grammar fix:
"is the script where lives the gRPC client"
should be
"is the script where the gRPC client lives"
Signed-off-by: D4ryl00 <[email protected]>
3a40d97
to
d13730b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Works great. Minor comments.
examples/UnityClient/README.md
Outdated
|
||
We will copy the generated GnoNative API files and gRPC C# stubs in `Assets/Gno`. | ||
|
||
In a terminal, write this command (remplace ${gnonative} by the location where is gnonative in your filesystem): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"remplace" should be "replace"
examples/UnityClient/README.md
Outdated
|
||
## Copy API dependencies | ||
|
||
We will copy the generated GnoNative API files and gRPC C# stubs in `Assets/Gno`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"in" should be "into"
examples/UnityClient/README.md
Outdated
|
||
We will copy the generated GnoNative API files and gRPC C# stubs in `Assets/Gno`. | ||
|
||
In a terminal, write this command (remplace ${gnonative} by the location where is gnonative in your filesystem): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I suggest: "write this command" should be "cd to your Unity project folder and write this command"
examples/UnityClient/README.md
Outdated
|
||
``` | ||
In the `Start()` function, we initialize the gRPC client with the gRPC Web protocol and use the default GnoNative port. | ||
In the `OnHello()` function, we do the `Hello` gRPC call and set the result into the `Text` object. This function can be trigger by a button for example. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"can be trigger" should be "can be triggered"
examples/UnityClient/README.md
Outdated
|
||
Now we have to attach these two objects to the script we wrote. | ||
|
||
In the `Hierarchy` panel, select the button. Scroll down on the `Inspector` (right panel) to find the `On Click` section and click on `+` to add a new action. Drag and drop the `UI Script` object to the `None (Object)` in this action, and replace `No Function` by `Hello` -> `OnHello ()`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For me, Hello
-> OnHello ()
should be
Hello.OnHello()
Signed-off-by: D4ryl00 <[email protected]>
Signed-off-by: D4ryl00 <[email protected]>
A gRPC .NET client with Unity.
It is part of #104