-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSaveData.cs
More file actions
50 lines (46 loc) · 998 Bytes
/
SaveData.cs
File metadata and controls
50 lines (46 loc) · 998 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
using System.Collections.Generic;
using UnityEngine;
namespace Emptybraces
{
[System.Serializable]
public class SaveData
{
public string Version;
public int SaveCount;
public string OverrideBindingJson;
public List<ProjectileData> ProjectileDataList = new();
[SerializeReference] public List<TestDataBase> TestDataList = new();
public void Init()
{
Version = Application.version;
}
public void AddPolymList<T>() where T : TestDataBase, new()
{
TestDataList.Add(new T());
}
}
[System.Serializable]
public class ProjectileData
{
public string AASKey;
public Vector3 Position;
public Vector3 Rotation;
public Vector3 Velocity;
public Vector3 AngularVelocity;
}
[System.Serializable]
public abstract class TestDataBase
{
public int BaseData;
}
[System.Serializable]
public class TestDataClass1 : TestDataBase
{
public int Child1Data;
}
[System.Serializable]
public class TestDataClass2 : TestDataBase
{
public int Child2_Data;
}
}