我想将数据发送到Google表格,并且信息来自Unity 3D中的文本字段
我已经调试,添加和更改了组件,但是它不起作用。
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class SendToGoogle : MonoBehaviour
{
public GameObject name;
public GameObject age;
public GameObject gender;
private string Name;
private string Age;
private string Gender;
[SerializeField]
private string BASE_URL = "https://docs.google.com/forms/d/e/1FAIpQLSdbTmAtbsh0ncTM26_K5hlByPhCuRQeybFMTlRtx6ZRNLzaWw/viewform";
IEnumerator Post(string name, string age, string gender)
{
WWWForm form = new WWWForm();
form.AddField("entry.1339012952",name);
form.AddField("entry.1515905473",age);
form.AddField("entry.1659404311",gender);
byte[] rawData = form.data;
WWW www = new WWW(BASE_URL,rawData);
yield return www;
}
public void Send()
{
Name = name.GetComponent<InputField>().text;
Gender = gender.GetComponent<InputField>().text;
Age = age.GetComponent<InputField>().text;
StartCoroutine(Post(Name, Age, Gender));
}
}
我希望Google工作表获取我输入到文本框中的数据。