浏览代码

Adding a fix for ReportAsyncAnnotationResult to support il2cpp. LINQ is not supported on il2cpp which is used by newtonsoft library

/priyesh-urp-dist-render
Priyesh Wani 4 年前
当前提交
4bc3d3af
共有 1 个文件被更改,包括 18 次插入8 次删除
  1. 26
      com.unity.perception/Runtime/GroundTruth/SimulationState.cs

26
com.unity.perception/Runtime/GroundTruth/SimulationState.cs


string m_OutputDirectoryPath;
JsonSerializer m_AnnotationSerializer;
public bool IsRunning { get; private set; }
public string OutputDirectory

m_AnnotationSerializer = JsonSerializer.CreateDefault();
m_AnnotationSerializer.Converters.Add(new Vector3Converter());
m_AnnotationSerializer.Converters.Add(new QuaternionConverter());
m_OutputDirectoryName = outputDirectory;
IsRunning = true;
}

{
var q = Quaternion.identity;
reader.Read(); // open [ token
q.x = (float)reader.ReadAsDecimal();
q.x = (float)reader.ReadAsDecimal();
q.y = (float)reader.ReadAsDecimal();
q.z = (float)reader.ReadAsDecimal();
q.w = (float)reader.ReadAsDecimal();

}
[SuppressMessage("ReSharper", "PossibleInvalidOperationException")]
public class Vector3Converter : JsonConverter<Vector3>
{

return outVector;
}
}
var jArray = values == null ? null : JArray.FromObject(values, m_AnnotationSerializer);
JArray jArray = null;
if (values != null)
{
jArray = new JArray();
foreach (var value in values)
{
if (value != null)
jArray.Add(new JRaw(DatasetJsonUtility.ToJToken(value)));
}
}
ReportAsyncAnnotationResult<T>(asyncAnnotation, filename, jArray);
}

正在加载...
取消
保存