Ejemplo n.º 1
0
    public IEnumerator Load(MonoBehaviour caller)
    {
        parseCommandLine();

        if (isHost)
        {
            circlevr.serverIp = "127.0.0.1";

            cloudVRClient = new CloudVRClient(circlevr.serverIp, CloudVRClient.config.groupServerPort);
            yield return(caller.StartCoroutine(cloudVRClient.GetTrackers(caller,
                                                                         (trackers) =>
            {
                setTrackers(trackers);
            },
                                                                         (errorCode, error) =>
            {
                Debug.Log("CloudVRClient.GetTrackers failed : " + errorCode + " : " + error);
            }
                                                                         )));
        }
        else
        {
            AirVRServer.LoadOnce();

            circlevr.serverIp = CloudVRClient.config.groupServerAddress;
            JsonUtility.FromJsonOverwrite(CloudVRClient.config.userData, circlevr);
        }
    }
Ejemplo n.º 2
0
    // handle engine events
    private void Awake()
    {
        _title       = transform.Find("Title").GetComponent <Text>();
        _description = transform.Find("Description").GetComponent <Text>();
        _thumbnail   = transform.Find("Thumbnail").GetComponentInChildren <RawImage>();
        _screenshots = transform.Find("Screenshots").GetComponentsInChildren <RawImage>();

        _cloudVrClient = new CloudVRClient(_hostname, _port);
    }
Ejemplo n.º 3
0
    // handle engine events
    private void Awake()
    {
        _title       = transform.Find("Title").GetComponent <Text>();
        _description = transform.Find("Description").GetComponent <Text>();
        _thumbnail   = transform.Find("Thumbnail").GetComponentInChildren <RawImage>();
        _screenshots = transform.Find("Screenshots").GetComponentsInChildren <RawImage>();

        _cloudVrClient  = new CloudVRClient(_hostname, _port);
        _commandChannel = new CloudVRCommandChannel(_cloudVrClient, "content");
        _commandChannel.CommandReceived += onCloudVRCommandReceived;
    }
Ejemplo n.º 4
0
    public static UnityWebRequest Post(CloudVRClient client, string path, string body)
    {
        UnityWebRequest  result = new UnityWebRequest("http://" + client.host + ":" + client.port + path, UnityWebRequest.kHttpVerbPOST);
        UploadHandlerRaw uh     = new UploadHandlerRaw(new System.Text.UTF8Encoding().GetBytes(body));

        uh.contentType         = "application/json";
        result.uploadHandler   = uh;
        result.downloadHandler = new DownloadHandlerBuffer();

        return(result);
    }
Ejemplo n.º 5
0
 private void Awake()
 {
     CloudVRClient.Initialize();
 }
Ejemplo n.º 6
0
 public CloudVRContent(CloudVRClient owner, string json)
 {
     _owner = owner;
     init(MiniJSON.Json.Deserialize(json) as Dictionary <string, object>);
 }
Ejemplo n.º 7
0
 public CloudVRContent(CloudVRClient owner, Dictionary <string, object> jsonParsed)
 {
     _owner = owner;
     init(jsonParsed);
 }
 public CloudVRCommandChannel(CloudVRClient client, string type)
 {
     _client = client;
     _type   = type;
 }
Ejemplo n.º 9
0
 public static UnityWebRequest GetTexture(CloudVRClient client, string path)
 {
     return(UnityWebRequestTexture.GetTexture("http://" + client.host + ":" + client.port + path));
 }