Commit a04db652 authored by Danial KordModanlou's avatar Danial KordModanlou

new saving data information

parent 7bacb786
......@@ -19,6 +19,7 @@
<Path>.vs</Path>
<Path>Library</Path>
<Path>Logs</Path>
<Path>Temp</Path>
<Path>obj</Path>
</explicitExcludes>
</component>
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -13,6 +13,11 @@ public class DataSaver : MonoBehaviour
[SerializeField] public Transform pivot;
//set this
public static Vector3 pivotPos;
public static String pivotName = "startPoint";
// Start is called before the first frame update
private string path;
private GameObject[] players;
......@@ -21,14 +26,15 @@ public class DataSaver : MonoBehaviour
private menuSystem menu;
private String pName;
private String curentName;
// public static Action<String,Transform> OnCheckPoint;
private bool stable = false;
// Use this for initialization
void Start()
{
//OnCheckPoint += setNewChanges;
pivotPos = pivot.transform.position;
StartCoroutine(find());
......@@ -49,6 +55,12 @@ public class DataSaver : MonoBehaviour
}
public void setNewChanges(String input,Transform checkPoint)
{
pivotPos = checkPoint.transform.position;
}
void Save()
{
if(menu.activeSaving == 0)
......@@ -77,12 +89,13 @@ public class DataSaver : MonoBehaviour
if (timePassed > 0.1)
{
string[] rowDataTemp = new string[4];
rowDataTemp[0] = ""+myPlayer.speed;
rowDataTemp[1] = "" + (myPlayer.transform.position.x - pivot.transform.position.x);
rowDataTemp[2] = "" + (myPlayer.transform.position.y - pivot.transform.position.y);
rowDataTemp[3] = ""+(myPlayer.transform.position.z - pivot.transform.position.z);
rowDataTemp[0] = ""+ pivotName;
rowDataTemp[1] = "" + myPlayer.speed;
rowDataTemp[2] = "" + (myPlayer.transform.position.x - pivotPos.x);
rowDataTemp[3] = "" + (myPlayer.transform.position.y - pivotPos.y);
rowDataTemp[4] = ""+(myPlayer.transform.position.z - pivotPos.z);
rowData.Add(rowDataTemp);
string newLine = string.Format("{0},{1},{2},{3}", rowDataTemp[0], rowDataTemp[1], rowDataTemp[2], rowDataTemp[3]);
string newLine = string.Format("{0},{1},{2},{3},{4}", rowDataTemp[0], rowDataTemp[1], rowDataTemp[2], rowDataTemp[3],rowDataTemp[4]);
timePassed = 0;
csv.AppendLine(newLine);
}
......
......@@ -594,7 +594,8 @@ PlayerSettings:
scriptingRuntimeVersion: 1
gcIncremental: 0
gcWBarrierValidation: 0
apiCompatibilityLevelPerPlatform: {}
apiCompatibilityLevelPerPlatform:
Standalone: 3
m_RenderingPath: 1
m_MobileRenderingPath: 1
metroPackageName: Template_3D
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment