RESTful-Unity aims to provides a simple RESTful HTTP server for Unity3d.
Access and capsule the state of game objects from a Unity scene over http requests.
This project was created during prototyping a 3D simulation where game objects could be accessed and controlled by openHAB.
It's a proof of concept side project, therefore the functionality of the server was kept to a minimum.
GET Example
for requesting the color of a game object. Path: /color/{game object name}
POST Example
for changing the color of a game object by a POST request. Path: /color/{game object name}
- Supported HTTP tpyes: GET, POST, PUT and DELETE
- Store and configure the routes within a configuration class
- Create parameterize routing paths
- Access the query string variables from a request
- Support for basic authentication
- Capsule the executed operation within static invoker classes and methods
- Define the response content, HTTP status code and MIME type
- This project contains a demo scene for controlling the color of a cube and two light sources
Attach the Unity main thread involker and the server init script to the main camera.
Define the routing table inside the server init script.
Write a the referenced invoker class and method.
And define the HTTP response the the request
Copyright 2016, Tim F. Rieck
Licensed under the GLP, Version 3.0 (the "License"); you may not use this work except in compliance with the License. You may obtain a copy of the License in the LICENSE file, or at:
https://www.gnu.org/licenses/gpl-3.0.en.html
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.