コード例 #1
0
        /// <summary>
        /// Requests game parameters at a <code>decisionPoint</code>.
        /// </summary>
        /// <param name="decisionPoint">the decision point</param>
        /// <param name="parameters">an optional set of real-time parameters</param>
        /// <param name="callback">the callback to handle the result</param>
        /// <exception cref="ArgumentException">if the <code>decisionPoint</code> is null or empty</exception>
        public void RequestGameParameters(string decisionPoint, Params parameters, Action <JSONObject> callback)
        {
            Engagement engagement = BuildEngagement(decisionPoint, parameters);

            ddna.RequestEngagement(engagement,
                                   (response) =>
            {
                callback(response.JSON != null && response.JSON.ContainsKey("parameters") ? response.JSON["parameters"] as JSONObject : new JSONObject());
            }, (exception) =>
            {
                callback(new JSONObject());
            });
        }
コード例 #2
0
ファイル: DDNA.cs プロジェクト: Rogue-Harbour/unity-sdk
 /// <summary>
 /// Makes an Engage request.  The result of the engagement will be passed as a dictionary object to your callback method. The dictionary
 /// will be empty if engage couldn't be reached on a campaign is not running.
 /// A cache is maintained that will return the last valid response if available.
 /// </summary>
 /// <param name="engagement">The engagement the request is for.</param>
 /// <param name="callback">Method called with the response from Engage.</param>
 /// <exception cref="System.Exception">Thrown if the SDK has not been started, and if the Engage URL has not been set.</exception>
 public void RequestEngagement(Engagement engagement, Action <Dictionary <string, object> > callback)
 {
     delegated.RequestEngagement(engagement, callback);
 }