pCis2ad.png

介绍

整个桌面端基于WPF实现的,主要作用能够分析Unity项目工程的资源使用情况,方便快速定位资源使用情况,以及资源的优化,Shader,纹理,动画,C#脚本等等…以及对于AB资源重复依赖应用检测关系链

对于检测规则

这部分是逆向UPR提取Rule文件,大体就是开发者模式找相应关键字对应代码断点,这部分要多尝试.跟踪获取到规则文件

这部分需要做数据清理不然用不了另一个就是,反序列化规则数据结构后续解析会用到,然后通过对应的规则进行匹配,然后AssetChecker检测对应项目匹配对应规则

清理后的数据结构 局部

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
"data": [
{
"category": "Animation",
"rules": [
{
"id": 1001,
"name": "Animation Precision",
"platform": "All",
"description": {
"en": "Animation curves precision should be less than 5",
"zh": "动画曲线精度应小于5"
},
"longDescription": {
"zh": "动画曲线精度过高会增加动画占用内存; 此规则仅面向以文本格式序列化的*.anim文件中的浮点精度",
"en": "High animation curve precision may cause more memory. Only plain-text serialized *.anim files could be handled by this rule."
},
"nameDescription": {
"en": "Check animation precision",
"zh": "检查动画曲线精度"
},
"hint": {
"en": "Open the .anim file with text editor, modify the precision of float values under m_EditorCurves::curve::m_Curve. It s recommend to correct all float values precision in this file to under 5 by script.",
"zh": "用文本编辑器打开.anim动画文件,修改m_EditorCurves::curve::m_Curve下的float值的精度。建议用脚本直接将此文件中所有float精度都调整为5位小数以下。"
},
"advices": [
{
"id": 1001001,
"description": {
"en": "Animation curves precision should be less than 5",
"zh": "动画曲线精度应小于5"
}
}
]
},
{
"id": 1002,
"name": "Animation Scale",
"platform": "All",
"description": {
"en": "Animation should not have scale curves",
"zh": "动画不应具有缩放曲线"
},
"longDescription": {
"zh": "动画中的缩放曲线会增加动画占用内存",
"en": "Scale curves in animation may cause more memory"
},
"nameDescription": {
"en": "Check animation scale curves",
"zh": "检查动画缩放曲线"
},
"hint": {
"en": "Open the .anim file with text editor, make no curve object with attribute equals m_Scale under m_EditorCurves or m_FloatCurves.",
"zh": "用文本编辑器打开.anim动画文件,确认m_EditorCurves和m_FloatCurves下不包括attribute为m_Scale的curve子对象。"
},
"advices": [
{
"id": 1002001,
"description": {
"en": "Animation should not have scale curves",
"zh": "动画不应具有缩放曲线"
}
}
]
},
{
"id": 1003,
"name": "Animation Precision",
"platform": "All",
"description": {
"en": "Animation curves precision should not be less than a certain value, default is 5",
"zh": "动画曲线精度应小于某个值, 默认为5"
},
"longDescription": {
"zh": "动画曲线精度过高会增加动画占用内存; 此规则仅面向以文本格式序列化的*.anim文件中的浮点精度",
"en": "High animation curve precision may cause more memory. Only plain-text serialized *.anim files could be handled by this rule."
},
"nameDescription": {
"en": "Check animation precision",
"zh": "检查动画曲线精度"
},
"hint": {
"en": "Open the .anim file with text editor, modify the precision of float values under m_EditorCurves::curve::m_Curve. It s recommend to correct all float values precision in this file to under 5 by script.",
"zh": "用文本编辑器打开.anim动画文件,修改m_EditorCurves::curve::m_Curve下的float值的精度。建议用脚本直接将此文件中所有float精度都调小。"
},
"customParameters": [
{
"name": "precision",
"defaultValue": "5",
"description": {
"en": "precision Limit for Animation curves",
"zh": "动画曲线精度限制"
}
}
],
"advices": [
{
"id": 1003001,
"description": {
"en": "Animation curves precision should be less than %s",
"zh": "动画曲线精度应小于%s"
}
}
]
}
]
},
}

反序列化数据结构 局部

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class Description
{
public string en { get; set; }
public string zh { get; set; }
}

public class Advice
{
public int id { get; set; }
public Description description { get; set; }
}

public class CustomParameter
{
public string name { get; set; }
public string defaultValue { get; set; }
public Description description { get; set; }
}

public class Rule
{
public int id { get; set; }
public string name { get; set; }
public string platform { get; set; }
public Description description { get; set; }
public Description longDescription { get; set; }
public Description nameDescription { get; set; }
public Description hint { get; set; }
public List<Advice> advices { get; set; }
public List<CustomParameter> customParameters { get; set; }
}

public class Data
{
public string category { get; set; }
public List<Rule> rules { get; set; }
}

public class AssetAnylizeConfigData
{
public List<Data> data { get; set; }
}

展示

pCiryAs.png

检测配置设置

pCir5B4.png
pCirXjO.png

资源检测结果-部分

pCispEd.png

C#检测

pCisF8P.png

AB重复引用检测排查

pCis4RP.png
pCisTsS.png