Skip to content

Instantly share code, notes, and snippets.

@eleventigers
Last active December 17, 2015 10:58
Show Gist options
  • Save eleventigers/5598167 to your computer and use it in GitHub Desktop.
Save eleventigers/5598167 to your computer and use it in GitHub Desktop.
(function() {
var SECTION = "date";
var NOW = "now";
Playtomic.Date = {
now: function(callback) {
sendAPIRequest(SECTION, NOW, dateComplete, callback);
}
};
function dateComplete(callback, postdata, data, response) {
if(callback == null) {
return;
}
if(response.success == false) {
callback(null, response);
return;
}
callback(data, response);
}
}());
using UnityEngine;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
public class PDate
{
private const string SECTION = "date";
private const string NOW = "now";
public void Now(Action<PResponse> callback)
{
Playtomic.API.StartCoroutine(SendRequest(SECTION, NOW, callback));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment