Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using UnityEngine.Networking;
- /// <summary>
- /// Defines the <see cref="InventoryWindow" />
- /// </summary>
- public class InventoryWindow : MonoBehaviour {
- /// <summary>
- /// The startCo
- /// </summary>
- public void startCo()
- {
- StartCoroutine(UploadInventoryToWebServer());
- }
- /// <summary>
- /// The UploadInventoryToWebServer
- /// </summary>
- /// <returns>The <see cref="IEnumerator"/></returns>
- internal IEnumerator UploadInventoryToWebServer()
- {
- string url = "http://localhost/tictacttoe/inventory/publishinventory.php";
- string filePath = Application.dataPath + "/Editor/coreInventoryData.json";
- if (System.IO.File.Exists(filePath)) {
- WWWForm form = new WWWForm();
- form.AddField("fileName", filePath);
- WWW w = new WWW(url, form);
- yield return w;
- if (!string.IsNullOrEmpty(w.error))
- {
- print(w.error);
- }
- else
- {
- print(w.text);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement