Giter Site home page Giter Site logo

lenscast-unity-sdk's People

Contributors

jaytoday avatar welens avatar

Watchers

 avatar  avatar  avatar

lenscast-unity-sdk's Issues

Prototype of LensCast SDK delegate function support

Simulate a JSON object being received through a network interface. Initially, these objects can be hard-coded for testing purposes. The data contained within the object is then passed to a delegate function defined by the client application.

The JSON object will either just contain an action object like in the first example below, or will contain an action object with a nested value object contained within it, like the second example.


{
  "remoteCommand": {
                                       "timestamp": 1529103309,
                                        "action": {
                                                          "id": "reset_level",
                                                          "name": "Reset Level"
                                                        }
                                     }
}

{
  "remoteCommand": {
                                       "timestamp": 1529103309,
                                        "action": {
                                                          "id": "change_difficulty",
                                                          "name": "Change Difficulty",
                                                          "value": {
                                                                          "id": "medium",
                                                                          "name": "Medium Mode"
                                                                        }
                                                        }
                                     }
}

The client application using the SDK should be able to import it, and then be able to do something approximating the following, where it assigns a delegate function to a LensCast.onRemoteCommand event that accepts an action param that can be examined and resulting in specified events firing as seen in the example below:

void OnInit() {
 // This code only needs to be run once when the app is initialized
 LensCast.onRemoteCommand += CustomHandlerFunction;
}

void CustomHandlerFunction(object action)
    {
      if (action.id == "set_level"){
          SetLevel(action.value.id); // example integration with app-specific logic
      }
      if (action.id == "set_difficulty"){
	  SetDifficulty(action.value.id); // example integration with app-specific logic
      }
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.