1
This commit is contained in:
35
Packages/Runtime/Google/GoogleSheelUtils.cs
Normal file
35
Packages/Runtime/Google/GoogleSheelUtils.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using Google.Apis.Sheets;
|
||||
namespace BITKit.Beegle
|
||||
{
|
||||
public class GoogleSheelUtils : MonoBehaviour
|
||||
{
|
||||
[Header(Constant.Header.Settings)]
|
||||
public string spreadsheetId;
|
||||
public string sheetName;
|
||||
[Header(Constant.Header.Settings)]
|
||||
[TextArea]
|
||||
public string json;
|
||||
[Header(Constant.Header.InternalVariables)]
|
||||
GoogleSheetsHelper helper;
|
||||
Google.Apis.Sheets.v4.SpreadsheetsResource.ValuesResource values;
|
||||
void Start()
|
||||
{
|
||||
DI.Register<GoogleSheelUtils>(this);
|
||||
DI.Register<GoogleSheetsHelper>(helper = new(json));
|
||||
values = helper.Service.Spreadsheets.Values;
|
||||
}
|
||||
public async void Request()
|
||||
{
|
||||
var range = $"{sheetName}!A:D";
|
||||
var request = values.Get(spreadsheetId, range);
|
||||
|
||||
var response = await request.ExecuteAsync();
|
||||
var _values = response.Values;
|
||||
|
||||
Debug.Log(request);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user