UniversalViewer/Assets/Scripts/ModelViewerBase/UI/TimelineControllerSerializa...

25 lines
694 B
C#

[System.Serializable]
public class TimelineControllerSerializable
{
public int FrameCount;
public float FrameDelay;
public int CurrentFrame;
public TimelineControllerSerializable() { }
public TimelineControllerSerializable(TimelineController tc)
{
FrameCount = tc.FrameCount;
FrameDelay = tc.FrameDelayMS;
CurrentFrame = tc.CurrentFrame;
}
public void Deserialize(TimelineController tc)
{
tc.FrameCount = FrameCount;
tc.SetFrameDelay(FrameDelay.ToString());
tc.CurrentFrame = CurrentFrame;
tc.FillTimeline(TimelineController.Instance.FrameCount);
TimelineController.UpdateTimeline();
}
}