스피드핵 감지해서 구글 설문지에 기록하기



HackManager.cs 소스입니다

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Networking;

public class HackManager : MonoBehaviour
{
float time;
    DateTime now;
bool trigger;

const string FORM_URL = "https://docs.google.com/forms/u/0/d/e/1FAIpQLSfxh3V9iBPINr8-G9jWUwJFM9EnGUPfpfUhdE0_dNcW2oHedQ/formResponse";


void Start()
{
time = Time.time;
now = DateTime.Now;
}

void Update()
    {
float timeSpan = Mathf.Abs((Time.time - time) - (float)(DateTime.Now - now).TotalSeconds);
if (timeSpan > 5 && !trigger)
{
trigger = true;
HackReport("스피드핵 " + timeSpan);
}
}

public void HackReport(string report)
{
WWWForm form = new WWWForm();
form.AddField("entry.1208349426", report);

UnityWebRequest www = UnityWebRequest.Post(FORM_URL, form);
www.SendWebRequest();
}
}