public static string GetFullSessionPath(VerticalSliceHeaderData header)
 {
     return rootSaveFolder + "/" + header.userNiceID + "/" + GetFolder_Date(header.dateTimeStamp) + "/" + GetFolder_CurrentSession(header.sessionNumber) + "/" + GetFolder_HoursMinutes(header.dateTimeStamp);
 }
 public VerticalActivitySlice(int frameNumber)
 {
     header = new VerticalSliceHeaderData(frameNumber);
 }
        public static VerticalSliceHeaderData Deserialize(byte[] input)
        {
            if (input == null || input.Length == 0)
                return null;

            ComposedByteStream stream = ComposedByteStream.FromByteArray(input);
            if (stream == null)
                return null;

            VerticalSliceHeaderData header = new VerticalSliceHeaderData();
            header.userUID = stream.ReadNextStream();
            header.userNiceID = stream.ReadNextStream();
            header.levelName = stream.ReadNextStream();

            ComposedPrimitives prims = ComposedPrimitives.FromByteArray(stream.ReadNextStream<byte>());
            if (prims != null) {
                header.screenWidth = prims.ReadNextValue<int>();
                header.screenHeight = prims.ReadNextValue<int>();
                header.frameNumber = prims.ReadNextValue<int>();
                header.sessionNumber = prims.ReadNextValue<int>();
                header.birthTimeStamp = prims.ReadNextValue<float>();
                header.dateTimeStamp = prims.ReadNextValue<double>();
            }
            stream.Dispose();
            return header;
        }
        //--------------- Serialize / Deserialize --------------------
        public static byte[] Serialize(VerticalSliceHeaderData input)
        {
            ComposedPrimitives prims = new ComposedPrimitives();
            prims.AddValue(input.screenWidth);
            prims.AddValue(input.screenHeight);
            prims.AddValue(input.frameNumber);
            prims.AddValue(input.sessionNumber);
            prims.AddValue(input.birthTimeStamp);
            prims.AddValue(input.dateTimeStamp);
            byte[] data = prims.Compose();

            ComposedByteStream stream = ComposedByteStream.FetchStream();
            stream.AddStream(input.userUID);
            stream.AddStream(input.userNiceID);
            stream.AddStream(input.levelName);
            stream.AddStream(data);
            return stream.Compose();
        }
        //Todo:Add material data and make all dispose calls recursive.
        public override void Dispose()
        {
            base.Dispose();

            if (header != null) header.Dispose();
            if (systemInfo != null) systemInfo.Dispose();
            if (debugLogs != null) debugLogs.Dispose();
            if (humanInput != null) humanInput.Dispose();
            if (meshData != null) meshData.Dispose();
            if (particleData != null) particleData.Dispose();
            if (materialData != null) materialData.Dispose();
            if (gameObjectsSnapshot != null) gameObjectsSnapshot.Dispose();

            header = null;
            systemInfo = null;
            debugLogs = null;
            humanInput = null;
            meshData = null;
            particleData = null;
            materialData = null;
            gameObjectsSnapshot = null;
            screenCapture = null;
        }