我在阅读spine ue4 运行时的代码时发现
似乎运行时并没有一个判断atlas与skeletonData数据是否匹配的机制 :think:
导致 在已经选择了互相匹配的AtlasAsset与SkeletonDataAsset之后,将其中的一个切换成其他的spine Asset
将会导致数据访问上的冲突 严重甚至会导致引擎崩溃(这常见使用于Binary导入方式的Asset时, 使用Json导入方式的Asset时会有引擎警告阻止,我看了下代码发现 Json的方式是用类似字典的默认值去读取数据的 这是安全的 而二进制的数据访问上并不是安全的 更多的可能会发生数组越界的问题)
是否需要增加异常去判定阻止
When I read the code of spine ue4 runtime, I found
It seems that there is no mechanism for judging whether the atlas and skeletonData data match at runtime :think:
As a result, after the AtlasAsset and SkeletonDataAsset that match each other have been selected, one of them is switched to the other spine Asset
It will cause serious conflicts in data access and even cause engine crashes (this is commonly used in Binary-imported Assets. When using Json-imported Assets, there will be engine warnings to prevent them. I looked at the code and found that the Json method is to use Similar to the dictionary default value to read the data, this is safe, but the binary data access is not safe, and the problem of array out of bounds may occur)
Do you need to add exceptions to determine and prevent