コード例 #1
0
        public static HumanInputSnapshot Deserialize(byte[] input)
        {
            if (input == null || input.Length == 0)
                return null;

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

            int iMax = stream.streamCount;
            result.providersData = new HumanInputProviderData[iMax];
            for (int i = 0; i < iMax; i++)
                result.providersData[i] = HumanInputProviderData.Deserialize(stream.ReadNextStream<byte>());

            stream.Dispose();
            return result;
        }
コード例 #2
0
        //--------------- Serialize / Deserialize --------------------
        public static byte[] Serialize(HumanInputSnapshot input)
        {
            if (input == null)
                return null;

            ComposedByteStream stream = ComposedByteStream.FetchStream();
            foreach (HumanInputProviderData data in input.providersData)
                stream.AddStream(HumanInputProviderData.Serialize(data));

            return stream.Compose();
        }
コード例 #3
0
        //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;
        }