agones.dev/agones@v1.53.0/examples/unity-simple/README.md (about)

     1  # Simple Unity Example
     2  
     3  This is a very simple "unity server" that doesn't do much other than show how the SDK works in Unity.
     4  
     5  ## Prerequisites
     6  This example is working on
     7  ```
     8  Unity Editor: Unity 2018.4.2f1 or later
     9  OS: Windows 10 Pro or MacOS
    10  ```
    11  
    12  ## Running a Server
    13  There are a few steps.
    14  
    15  ### Install and configure Agones on Kubernetes
    16  Check out [these instructions](https://agones.dev/site/docs/installation/).
    17  
    18  ### Building a Server
    19  * Open this folder with UnityEditor.
    20  * Click on the `Build Tool/Build Server` menu item in the menu bar.
    21    * The Builds are created in a `Builds/Server` Folder.
    22  
    23  ### Building a Docker Image and Running it
    24  ```
    25  $ make build-image
    26  $ kubectl create -f gameserver.yaml
    27  ```
    28  
    29  ## Calling an SDK API via a Client
    30  
    31  ### Building a Client
    32  * Open this folder with UnityEditor.
    33  * Click on the `Build Tool/Build Client` menu item in the menu bar.
    34  
    35  ### How to use a Client
    36  * Run `Builds/Client/UnitySimpleClient.exe`.
    37  * Set `Address` and `Port` text fields to GameServer's one. You can see these with the following command.
    38      ```
    39      $ kubectl get gs 
    40      NAME                        STATE   ADDRESS         PORT   NODE       AGE
    41      unity-simple-server-z7nln   Ready   192.168.*.*     7854   node-name  1m
    42      ```
    43  * Click on the `Change Server` Button.
    44  * Set any text to a center text filed and click the `Send` button.
    45    * The Client will send the text to the Server.
    46  
    47    When a Server receives a text, it will send back "Echo : $text" as an echo.
    48    And an SDK API will be executed in a Server by the following rules.
    49  
    50      | Sending Text(Client) | SDK API(Server) |
    51      | ---- | ---- |
    52      | Allocate | Allocate() |
    53      | Label $1 $2 | SetLabel($1, $2) |
    54      | Annotation $1 $2 | SetAnnotation($1, $2) |
    55      | Shutdown | Shutdown() |
    56      | GameServer | GameServer() |