Commit a04db652 authored by Danial KordModanlou's avatar Danial KordModanlou

new saving data information

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