mirror of
https://github.com/ConjureETS/MTI860_VR_Multi_Controller.git
synced 2026-03-24 12:31:15 +00:00
addPositionManager
This commit is contained in:
parent
43f48e9d5c
commit
834444bc41
@ -70,7 +70,7 @@ public class Executable : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
yield return new WaitForSeconds(1.5f);
|
yield return new WaitForSeconds(1.0f);
|
||||||
DataSaver.SaveTime();
|
DataSaver.SaveTime();
|
||||||
if (count <= 0)
|
if (count <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,7 +20,7 @@ namespace Assets.Scripts.Utilities
|
|||||||
writeToFile(toSave);
|
writeToFile(toSave);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void SavePosition()
|
public static void SavePosition(List<Position> position)
|
||||||
{
|
{
|
||||||
//TODO
|
//TODO
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,12 @@ namespace Assets.Scripts.Utilities
|
|||||||
{
|
{
|
||||||
class Position
|
class Position
|
||||||
{
|
{
|
||||||
private float x;
|
private float x { get; set; };
|
||||||
private float y;
|
private float y { get; set; };
|
||||||
|
public Position(x, y)
|
||||||
|
{
|
||||||
|
this.x = x;
|
||||||
|
this.y = y;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
11
Assets/Scripts/Utilities/Position.cs.meta
Normal file
11
Assets/Scripts/Utilities/Position.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 84d96ee6f6aa2954595a4919634721f6
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
39
Assets/Scripts/Utilities/PositionManager.cs
Normal file
39
Assets/Scripts/Utilities/PositionManager.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class PositionManager : MonoBehaviour
|
||||||
|
{
|
||||||
|
public GameObject player;
|
||||||
|
public List<Position> data;
|
||||||
|
public bool notSended = true;
|
||||||
|
|
||||||
|
// Start is called before the first frame update
|
||||||
|
void Start()
|
||||||
|
{
|
||||||
|
data = "";
|
||||||
|
StartCoroutine("TackerExecute");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update is called once per frame
|
||||||
|
void Update()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
IEnumerator TackerExecute()
|
||||||
|
{
|
||||||
|
while (notSended)
|
||||||
|
{
|
||||||
|
data.Add(new Position(player.transform.position.x, player.transform.position.y));
|
||||||
|
yield return new WaitForSeconds(1.0f);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public sendData()
|
||||||
|
{
|
||||||
|
notSended = false;
|
||||||
|
DataSaver.SavePosition(data);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
11
Assets/Scripts/Utilities/PositionManager.cs.meta
Normal file
11
Assets/Scripts/Utilities/PositionManager.cs.meta
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
fileFormatVersion: 2
|
||||||
|
guid: 350cae5776b138d4795c1003647b50b1
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
||||||
Loading…
x
Reference in New Issue
Block a user