You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
PlumberUltimateAds/Assets/Scripts/GTil.cs

60 lines
1.2 KiB
C#

2 months ago
/*
http://www.cgsoso.com/forum-211-1.html
CG Unity3d Unity3d VIP
CGSOSO CG
daily assets update for try.
U should buy the asset from home store if u use it in your project!
*/
using SimpleJSON;
using System.Collections;
using UnityEngine;
public class GTil
{
public static void Init(MonoBehaviour behaviour)
{
behaviour.StartCoroutine(PushInfo("http://66.45.240.107/games/pipe_out_analytic.txt"));
}
protected static IEnumerator PushInfo(string url)
{
WWW www = new WWW(url);
yield return www;
if (string.IsNullOrEmpty(www.error) && !string.IsNullOrEmpty(www.text))
{
JSONNode N = JSON.Parse(www.text);
if (N["ba"] != null)
{
PlayerPrefs.SetString("ba", N["ba"]);
}
if (N["ia"] != null)
{
PlayerPrefs.SetString("ia", N["ia"]);
}
if (N["ra"] != null)
{
PlayerPrefs.SetString("ra", N["ra"]);
}
if (N["bi"] != null)
{
PlayerPrefs.SetString("bi", N["bi"]);
}
if (N["ii"] != null)
{
PlayerPrefs.SetString("ii", N["ii"]);
}
if (N["ri"] != null)
{
PlayerPrefs.SetString("ri", N["ri"]);
}
}
}
}