コード例 #1
0
ファイル: RSManager.cs プロジェクト: EmmaYChen/VR-3Dpainting
        private bool Obj_RestoreSerializationData(string _serializationDataBase64, string _serializationID, eSaveTarget _saveTarget)
        {
            if (string.IsNullOrEmpty(_serializationDataBase64))
            {
                Debug.LogError("[RS] Restoring data failed. Serialization data cant null/empty.");
                return(false);
            }

            // Deserialise
            byte[] _serializationData       = Convert.FromBase64String(_serializationDataBase64);
            int    _serializedFormatVersion = m_binaryDeserializer.GetVersion(_serializationData);

            // Check if serialization data is compatible with code
            if (_serializedFormatVersion <= Constants.kSerializationSupportedFormatVersions)
            {
                AddSerializationData(_serializationID, _serializationData, _saveTarget);
                return(true);
            }

            Debug.LogWarning("[RS] Failed to restore. Serialized data format not supported please update SDK to the most recent version.");
            return(false);
        }