Code: Select all
public class DanceMove{
[SerializedField] public string name;
[SerializedField] public int startBeat;
[SerializedField] public List<Pose> poses;
}
// poses is a list of a custom data type that contains custom data types.
public class Pose{
[SerializedField] public int beat;
[SerializedField] public bool isSet;
[SerializedField] public Dictionary<LimbClassifier, TranslationData> limbPositions;
}
// limbPositions is made of a enum as a key and a pos rot dataset
public enum LimbClassifier{
leftArm,
rightArm,
leftFoot,
rightFoot
}
public class TranslationData{
public Vector3 Position;
public Quaternion Rotation;
}
Code: Select all
ES3.Save("danceMove",theDanceMove);
Code: Select all
theDanceMove = ES3.Load<DanceMove>("danceMove");
I assume that I will need to create another like "saveDanceMoveData" class that first dumps all the nested content of DanceMove into it before saving and then translating it back but that is an undertaking so I just wanted to check here first.
Code: Select all
// Do I have to do something like this? I am assuming so but I just hope there is a simpler way.
public class DanceMoveSaveData{
public string danceMoveName;
public int poseOneBeat;
public int poseTwoBeat;
public int poseThreeBeat;
public int poseFourBeat;
public TranslationData poseOneLeftArm;
public TranslationData poseTwoLeftArm;
public TranslationData poseThreeLeftArm;
// and so on. with a constructor
public DanceMoveSaveData(DanceMove move){
danceMoveName = move.name;
poseOneBeat = move.poses[0].beat;
poseOneLeftArm = move.pose[0].limbPositions[LimbClassifier.leftArm];
// and so on.
}
}