コード例 #1
0
ファイル: YApi.cs プロジェクト: yin307/MyUnityPackage
    public static void POST(string url,
                            Dictionary <string, string> data = null,
                            Action <string> onSuccess        = null,
                            Action <string> onFail           = null,
                            float timeOut             = 10,
                            Action <string> onTimeOut = null)
    {
        YApi yApi = FindObjectOfType <YApi> ();

        if (yApi == null)
        {
            GameObject obj = new GameObject("YApi");
            yApi = obj.AddComponent <YApi> ();
        }
        yApi.post(url, data, onSuccess, onFail);
    }