/// <summary> /// Gets the registered <see cref="MessagePackSerializer{T}"/> from this repository with specified provider parameter. /// </summary> /// <typeparam name="T">Type of the object to be marshaled/unmarshaled.</typeparam> /// <param name="context">A serialization context.</param> /// <param name="providerParameter">A provider specific parameter. See remarks section of <see cref="SerializationContext.GetSerializer{T}(Object)"/> for details.</param> /// <returns> /// <see cref="MessagePackSerializer{T}"/>. If no appropriate mashalers has benn registered, then <c>null</c>. /// </returns> /// <see cref="SerializationContext.GetSerializer{T}(Object)"/> public MessagePackSerializer <T> Get <T>(SerializationContext context, object providerParameter) { if (context == null) { throw new ArgumentNullException("context"); } var result = this._repository.Get(context, typeof(T)); var asProvider = result as MessagePackSerializerProvider; #if !UNITY return((asProvider != null ? asProvider.Get(context, providerParameter) : result) as MessagePackSerializer <T>); #else var asSerializer = (asProvider != null ? asProvider.Get(context, providerParameter) : result) as MessagePackSerializer; return(asSerializer != null?MessagePackSerializer.Wrap <T>(context, asSerializer) : null); #endif // !UNITY }