mirror of
https://github.com/ConjureETS/MTI860_VR_Multi_Controller.git
synced 2026-03-24 12:31:15 +00:00
49 lines
1.1 KiB
C#
49 lines
1.1 KiB
C#
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace Assets.Scripts.Utilities
|
|
{
|
|
public class PositionManager : MonoBehaviour
|
|
{
|
|
public GameObject player;
|
|
private List<Position> data;
|
|
public bool dataSend = false;
|
|
|
|
// Start is called before the first frame update
|
|
void Start()
|
|
{
|
|
data = new List<Position>();
|
|
StartCoroutine("TackerExecute");
|
|
gameObject.tag = "Djigby";
|
|
}
|
|
|
|
// Update is called once per frame
|
|
void Update()
|
|
{
|
|
|
|
}
|
|
|
|
IEnumerator TackerExecute()
|
|
{
|
|
while (!dataSend)
|
|
{
|
|
data.Add(new Position(player.transform.position.x, player.transform.position.z));
|
|
yield return new WaitForSeconds(1.0f);
|
|
}
|
|
}
|
|
|
|
public void StopSavingPosition()
|
|
{
|
|
dataSend = true;
|
|
}
|
|
|
|
public List<Position> SendData()
|
|
{
|
|
dataSend = true;
|
|
return data;
|
|
}
|
|
|
|
}
|
|
}
|