Commit 1ffbb99c authored by 李维's avatar 李维

加长绳子适配竖屏

parent ce0e330e
......@@ -84,25 +84,22 @@
"__id__": 18
},
{
"__id__": 28
},
{
"__id__": 36
"__id__": 30
},
{
"__id__": 43
"__id__": 38
},
{
"__id__": 50
"__id__": 45
},
{
"__id__": 56
"__id__": 52
},
{
"__id__": 62
"__id__": 58
},
{
"__id__": 63
"__id__": 64
},
{
"__id__": 65
......@@ -111,52 +108,55 @@
"__id__": 67
},
{
"__id__": 70
"__id__": 69
},
{
"__id__": 73
"__id__": 72
},
{
"__id__": 75
},
{
"__id__": 78
"__id__": 77
},
{
"__id__": 81
"__id__": 80
},
{
"__id__": 84
"__id__": 83
},
{
"__id__": 87
"__id__": 86
},
{
"__id__": 90
"__id__": 89
},
{
"__id__": 94
"__id__": 92
},
{
"__id__": 96
},
{
"__id__": 98
}
],
"_active": true,
"_components": [
{
"__id__": 98
"__id__": 100
},
{
"__id__": 99
"__id__": 101
},
{
"__id__": 100
"__id__": 102
},
{
"__id__": 101
"__id__": 103
},
{
"__id__": 102
"__id__": 104
}
],
"_prefab": null,
......@@ -912,12 +912,15 @@
},
{
"__id__": 25
},
{
"__id__": 27
}
],
"_active": true,
"_components": [
{
"__id__": 27
"__id__": 29
}
],
"_prefab": null,
......@@ -1218,7 +1221,7 @@
},
{
"__type__": "cc.Node",
"_name": "bg_book",
"_name": "rope",
"_objFlags": 0,
"_parent": {
"__id__": 18
......@@ -1239,6 +1242,100 @@
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 300,
"height": 1920
},
"_anchorPoint": {
"__type__": "cc.Vec2",
"x": 0.5,
"y": 0.5
},
"_trs": {
"__type__": "TypedArray",
"ctor": "Float64Array",
"array": [
-10,
1580,
0,
0,
0,
0,
1,
1,
1,
1
]
},
"_eulerAngles": {
"__type__": "cc.Vec3",
"x": 0,
"y": 0,
"z": 0
},
"_skewX": 0,
"_skewY": 0,
"_is3DNode": false,
"_groupIndex": 0,
"groupIndex": 0,
"_id": "dc6enb50xDYboU3KVmOXsw"
},
{
"__type__": "cc.Sprite",
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
},
"_enabled": true,
"_materials": [
{
"__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
}
],
"_srcBlendFactor": 770,
"_dstBlendFactor": 771,
"_spriteFrame": {
"__uuid__": "6b92e645-ccfd-4fec-a742-1889ddd3ca19"
},
"_type": 0,
"_sizeMode": 0,
"_fillType": 0,
"_fillCenter": {
"__type__": "cc.Vec2",
"x": 0,
"y": 0
},
"_fillStart": 0,
"_fillRange": 0,
"_isTrimmedMode": true,
"_atlas": null,
"_id": "4467F0TGpDhrdE2IO2AWa9"
},
{
"__type__": "cc.Node",
"_name": "bg_book",
"_objFlags": 0,
"_parent": {
"__id__": 18
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 28
}
],
"_prefab": null,
"_opacity": 255,
"_color": {
"__type__": "cc.Color",
"r": 255,
"g": 255,
"b": 255,
"a": 255
},
"_contentSize": {
"__type__": "cc.Size",
"width": 998,
......@@ -1283,7 +1380,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 25
"__id__": 27
},
"_enabled": true,
"_materials": [
......@@ -1346,19 +1443,19 @@
},
"_children": [
{
"__id__": 29
"__id__": 31
},
{
"__id__": 31
"__id__": 33
}
],
"_active": false,
"_components": [
{
"__id__": 34
"__id__": 36
},
{
"__id__": 35
"__id__": 37
}
],
"_prefab": null,
......@@ -1414,13 +1511,13 @@
"_name": "574",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 30
"__id__": 32
}
],
"_prefab": null,
......@@ -1476,7 +1573,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 29
"__id__": 31
},
"_enabled": true,
"_materials": [
......@@ -1508,16 +1605,16 @@
"_name": "$labTitle",
"_objFlags": 0,
"_parent": {
"__id__": 28
"__id__": 30
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 32
"__id__": 34
},
{
"__id__": 33
"__id__": 35
}
],
"_prefab": null,
......@@ -1573,7 +1670,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 33
},
"_enabled": true,
"_materials": [
......@@ -1608,7 +1705,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 31
"__id__": 33
},
"_enabled": true,
"_color": {
......@@ -1626,7 +1723,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 30
},
"_enabled": true,
"alignMode": 1,
......@@ -1653,7 +1750,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 28
"__id__": 30
},
"_enabled": true,
"_normalMaterial": null,
......@@ -1714,7 +1811,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 28
"__id__": 30
},
"_id": "46LJCCnWxFOLNfxTrbMLFA"
},
......@@ -1726,14 +1823,14 @@
"__id__": 2
},
"_children": [
{
"__id__": 37
},
{
"__id__": 39
},
{
"__id__": 41
},
{
"__id__": 43
}
],
"_active": true,
......@@ -1791,13 +1888,13 @@
"_name": "rectangle-21",
"_objFlags": 0,
"_parent": {
"__id__": 36
"__id__": 38
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 38
"__id__": 40
}
],
"_prefab": null,
......@@ -1853,7 +1950,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 37
"__id__": 39
},
"_enabled": true,
"_materials": [
......@@ -1885,13 +1982,13 @@
"_name": "rectangle-21",
"_objFlags": 0,
"_parent": {
"__id__": 36
"__id__": 38
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 40
"__id__": 42
}
],
"_prefab": null,
......@@ -1947,7 +2044,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 39
"__id__": 41
},
"_enabled": true,
"_materials": [
......@@ -1979,13 +2076,13 @@
"_name": "group",
"_objFlags": 0,
"_parent": {
"__id__": 36
"__id__": 38
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 42
"__id__": 44
}
],
"_prefab": null,
......@@ -2041,7 +2138,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 41
"__id__": 43
},
"_enabled": true,
"_materials": [
......@@ -2076,14 +2173,14 @@
"__id__": 2
},
"_children": [
{
"__id__": 44
},
{
"__id__": 46
},
{
"__id__": 48
},
{
"__id__": 50
}
],
"_active": false,
......@@ -2141,13 +2238,13 @@
"_name": "rectangle-21",
"_objFlags": 0,
"_parent": {
"__id__": 43
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 45
"__id__": 47
}
],
"_prefab": null,
......@@ -2203,7 +2300,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 44
"__id__": 46
},
"_enabled": true,
"_materials": [
......@@ -2235,13 +2332,13 @@
"_name": "rectangle-22",
"_objFlags": 0,
"_parent": {
"__id__": 43
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 47
"__id__": 49
}
],
"_prefab": null,
......@@ -2297,7 +2394,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 46
"__id__": 48
},
"_enabled": true,
"_materials": [
......@@ -2329,13 +2426,13 @@
"_name": "rectangle-4",
"_objFlags": 0,
"_parent": {
"__id__": 43
"__id__": 45
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 49
"__id__": 51
}
],
"_prefab": null,
......@@ -2391,7 +2488,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 48
"__id__": 50
},
"_enabled": true,
"_materials": [
......@@ -2427,16 +2524,16 @@
},
"_children": [
{
"__id__": 51
"__id__": 53
},
{
"__id__": 53
"__id__": 55
}
],
"_active": false,
"_components": [
{
"__id__": 55
"__id__": 57
}
],
"_prefab": null,
......@@ -2492,13 +2589,13 @@
"_name": "btnLast_1",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 52
"__id__": 54
}
],
"_prefab": null,
......@@ -2554,7 +2651,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 51
"__id__": 53
},
"_enabled": true,
"_materials": [
......@@ -2586,13 +2683,13 @@
"_name": "btnLast_2",
"_objFlags": 0,
"_parent": {
"__id__": 50
"__id__": 52
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 54
"__id__": 56
}
],
"_prefab": null,
......@@ -2648,7 +2745,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 53
"__id__": 55
},
"_enabled": true,
"_materials": [
......@@ -2680,7 +2777,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 50
"__id__": 52
},
"_enabled": true,
"_normalMaterial": null,
......@@ -2753,7 +2850,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 50
"__id__": 52
},
"_id": "84eQK/qulOz42YGXGM+m+t"
},
......@@ -2766,16 +2863,16 @@
},
"_children": [
{
"__id__": 57
"__id__": 59
},
{
"__id__": 59
"__id__": 61
}
],
"_active": false,
"_components": [
{
"__id__": 61
"__id__": 63
}
],
"_prefab": null,
......@@ -2831,13 +2928,13 @@
"_name": "btnLast_1",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 58
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 58
"__id__": 60
}
],
"_prefab": null,
......@@ -2893,7 +2990,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 57
"__id__": 59
},
"_enabled": true,
"_materials": [
......@@ -2925,13 +3022,13 @@
"_name": "btnNext_2",
"_objFlags": 0,
"_parent": {
"__id__": 56
"__id__": 58
},
"_children": [],
"_active": false,
"_components": [
{
"__id__": 60
"__id__": 62
}
],
"_prefab": null,
......@@ -2987,7 +3084,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 59
"__id__": 61
},
"_enabled": true,
"_materials": [
......@@ -3019,7 +3116,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 56
"__id__": 58
},
"_enabled": true,
"_normalMaterial": null,
......@@ -3092,7 +3189,7 @@
"__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
},
"_N$target": {
"__id__": 56
"__id__": 58
},
"_id": "84o8difAxAKKbDqQxd9mpJ"
},
......@@ -3165,7 +3262,7 @@
"_active": true,
"_components": [
{
"__id__": 64
"__id__": 66
}
],
"_prefab": null,
......@@ -3221,7 +3318,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 63
"__id__": 65
},
"_enabled": false,
"_materials": [
......@@ -3259,7 +3356,7 @@
"_active": true,
"_components": [
{
"__id__": 66
"__id__": 68
}
],
"_prefab": null,
......@@ -3315,7 +3412,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 65
"__id__": 67
},
"_enabled": false,
"_materials": [
......@@ -3353,10 +3450,10 @@
"_active": true,
"_components": [
{
"__id__": 68
"__id__": 70
},
{
"__id__": 69
"__id__": 71
}
],
"_prefab": null,
......@@ -3412,7 +3509,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
"__id__": 69
},
"_enabled": true,
"_materials": [
......@@ -3444,7 +3541,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 67
"__id__": 69
},
"_enabled": true,
"alignMode": 1,
......@@ -3477,10 +3574,10 @@
"_active": false,
"_components": [
{
"__id__": 71
"__id__": 73
},
{
"__id__": 72
"__id__": 74
}
],
"_prefab": null,
......@@ -3536,7 +3633,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 70
"__id__": 72
},
"_enabled": true,
"_materials": [
......@@ -3568,7 +3665,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 70
"__id__": 72
},
"_enabled": true,
"_normalMaterial": null,
......@@ -3629,7 +3726,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 70
"__id__": 72
},
"_id": "b8KezmrbtFuZsqqhRUKzjM"
},
......@@ -3644,7 +3741,7 @@
"_active": false,
"_components": [
{
"__id__": 74
"__id__": 76
}
],
"_prefab": null,
......@@ -3700,7 +3797,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 73
"__id__": 75
},
"_enabled": true,
"_materials": [
......@@ -3738,10 +3835,10 @@
"_active": false,
"_components": [
{
"__id__": 76
"__id__": 78
},
{
"__id__": 77
"__id__": 79
}
],
"_prefab": null,
......@@ -3797,7 +3894,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 75
"__id__": 77
},
"_enabled": false,
"_materials": [
......@@ -3829,7 +3926,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 75
"__id__": 77
},
"_enabled": true,
"_normalMaterial": null,
......@@ -3890,7 +3987,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 75
"__id__": 77
},
"_id": "09RdL+CVVAQLq1FX8fAQ/A"
},
......@@ -3905,10 +4002,10 @@
"_active": true,
"_components": [
{
"__id__": 79
"__id__": 81
},
{
"__id__": 80
"__id__": 82
}
],
"_prefab": null,
......@@ -3964,7 +4061,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 80
},
"_enabled": false,
"_materials": [
......@@ -3996,7 +4093,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 78
"__id__": 80
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4057,7 +4154,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 78
"__id__": 80
},
"_id": "fcFimVhvNDwKkLk+TeMmp6"
},
......@@ -4072,10 +4169,10 @@
"_active": true,
"_components": [
{
"__id__": 82
"__id__": 84
},
{
"__id__": 83
"__id__": 85
}
],
"_prefab": null,
......@@ -4131,7 +4228,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
"__id__": 83
},
"_enabled": false,
"_materials": [
......@@ -4163,7 +4260,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 81
"__id__": 83
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4224,7 +4321,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 81
"__id__": 83
},
"_id": "93mSgNedhB+LuRYDSgJfhP"
},
......@@ -4239,10 +4336,10 @@
"_active": true,
"_components": [
{
"__id__": 85
"__id__": 87
},
{
"__id__": 86
"__id__": 88
}
],
"_prefab": null,
......@@ -4298,7 +4395,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
"__id__": 86
},
"_enabled": true,
"_materials": [
......@@ -4330,7 +4427,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 84
"__id__": 86
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4391,7 +4488,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 84
"__id__": 86
},
"_id": "d9xvch6rJOcZj7JdYyHh6R"
},
......@@ -4406,10 +4503,10 @@
"_active": true,
"_components": [
{
"__id__": 88
"__id__": 90
},
{
"__id__": 89
"__id__": 91
}
],
"_prefab": null,
......@@ -4465,7 +4562,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
"__id__": 89
},
"_enabled": true,
"_materials": [
......@@ -4497,7 +4594,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 87
"__id__": 89
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4558,7 +4655,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 87
"__id__": 89
},
"_id": "96olvnlAdGb4lss5DPZ18s"
},
......@@ -4571,13 +4668,13 @@
},
"_children": [
{
"__id__": 91
"__id__": 93
}
],
"_active": true,
"_components": [
{
"__id__": 93
"__id__": 95
}
],
"_prefab": null,
......@@ -4633,13 +4730,13 @@
"_name": "btn_mao",
"_objFlags": 0,
"_parent": {
"__id__": 90
"__id__": 92
},
"_children": [],
"_active": true,
"_components": [
{
"__id__": 92
"__id__": 94
}
],
"_prefab": null,
......@@ -4695,7 +4792,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 91
"__id__": 93
},
"_enabled": true,
"_normalMaterial": null,
......@@ -4756,7 +4853,7 @@
"hoverSprite": null,
"_N$disabledSprite": null,
"_N$target": {
"__id__": 91
"__id__": 93
},
"_id": "d4PIMf95NKFr9INO7F75xO"
},
......@@ -4765,7 +4862,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 90
"__id__": 92
},
"_enabled": true,
"_materials": [
......@@ -4811,7 +4908,7 @@
"_active": false,
"_components": [
{
"__id__": 95
"__id__": 97
}
],
"_prefab": null,
......@@ -4867,7 +4964,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 94
"__id__": 96
},
"_enabled": true,
"_materials": [
......@@ -4905,7 +5002,7 @@
"_active": false,
"_components": [
{
"__id__": 97
"__id__": 99
}
],
"_prefab": null,
......@@ -4961,7 +5058,7 @@
"_name": "",
"_objFlags": 0,
"node": {
"__id__": 96
"__id__": 98
},
"_enabled": true,
"_materials": [
......@@ -5052,10 +5149,10 @@
},
"_enabled": true,
"testPanel": {
"__id__": 70
"__id__": 72
},
"touchPanel": {
"__id__": 75
"__id__": 77
},
"audTurnPage": {
"__uuid__": "91258ef3-e5b7-47cf-8480-be91ece6c0f9"
......@@ -5070,25 +5167,25 @@
"__uuid__": "320caeb2-9a8a-41b4-a87f-62d541b235fd"
},
"tipFirst": {
"__id__": 94
"__id__": 96
},
"tipLast": {
"__id__": 96
"__id__": 98
},
"btnLeft": {
"__id__": 84
"__id__": 86
},
"btnRight": {
"__id__": 87
"__id__": 89
},
"touchAniLeft": {
"__id__": 78
"__id__": 80
},
"touchAniRight": {
"__id__": 81
"__id__": 83
},
"capture": {
"__id__": 102
"__id__": 104
},
"_id": "76pKAVQpBDVby2iIHB3LLz"
},
......
{
"ver": "2.3.5",
"uuid": "75bb8baa-fa17-4414-9363-5d6cabdc9980",
"type": "sprite",
"wrapMode": "clamp",
"filterMode": "bilinear",
"premultiplyAlpha": false,
"genMipmaps": false,
"packable": true,
"width": 368,
"height": 480,
"platformSettings": {},
"subMetas": {
"rope": {
"ver": "1.0.4",
"uuid": "6b92e645-ccfd-4fec-a742-1889ddd3ca19",
"rawTextureUuid": "75bb8baa-fa17-4414-9363-5d6cabdc9980",
"trimType": "auto",
"trimThreshold": 1,
"rotated": false,
"offsetX": 0,
"offsetY": 0,
"trimX": 0,
"trimY": 0,
"width": 368,
"height": 480,
"rawWidth": 368,
"rawHeight": 480,
"borderTop": 0,
"borderBottom": 0,
"borderLeft": 0,
"borderRight": 0,
"subMetas": {}
}
}
}
\ No newline at end of file
var fs = require('fs-extra');
var file = require('./util/file');
module.exports = {
load() {
},
unload() {
},
replaceDirUuid: function (path, dbpath) {
Editor.log('开始检查:' + path);
file.findDirUuid(path);
Editor.log('资源检查完成');
},
messages: {
'checkFileName'() {
var uuids = Editor.Selection.curSelection('asset');
uuids.forEach((uuid) => {
var dir_path = Editor.assetdb._uuid2path[uuid];
if (fs.existsSync(dir_path)) {
this.replaceDirUuid(dir_path, Editor.assetdb.uuidToUrl(uuid));
}
});
},
},
}
\ No newline at end of file
{
"name": "check-file-name",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"version": "0.0.1",
"dependencies": {
"node-uuid": "1.4.8"
}
},
"node_modules/node-uuid": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz",
"integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc=",
"deprecated": "Use uuid module instead",
"bin": {
"uuid": "bin/uuid"
}
}
},
"dependencies": {
"node-uuid": {
"version": "1.4.8",
"resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.8.tgz",
"integrity": "sha1-sEDrCSOWivq/jTL7HxfxFn/auQc="
}
}
}
{
"name": "check-file-name",
"version": "0.0.1",
"description": "check-file-name",
"author": "Cocos Creator",
"main": "main.js",
"main-menu": {
"i18n:MAIN_MENU.package.title/check-file-name": {
"message": "check-file-name:checkFileName"
}
},
"dependencies": {
"node-uuid": "1.4.8"
}
}
var fs = require("fs-extra");
var path = require("path");
var AppName = ""
module.exports = {
/**
* 递归目录 检查文件名
* 参考 https://docs.cocos.com/creator/manual/zh/advanced-topics/meta.html
*/
findDirUuid: function (dir) {
if(AppName == '') {
AppName = this.getRootDirName(dir);
if(AppName != "") {
Editor.log("AppName: " + AppName);
}
}
var stat = fs.statSync(dir);
if (!stat.isDirectory()) {
return;
}
var subpaths = fs.readdirSync(dir),
subpath;
for (var i = 0; i < subpaths.length; ++i) {
if (subpaths[i][0] === ".") {
continue;
}
subpath = path.join(dir, subpaths[i]);
stat = fs.statSync(subpath);
if (stat.isDirectory()) {
this.findDirUuid(subpath);
} else if (stat.isFile()) {
var metastr = subpath.substr(subpath.length - 5, 5);
if (metastr != ".meta") {
this.check(AppName, subpaths[i]);
}
}
}
},
getRootDirName: function (path) {
let pArr = path.split("/");
let assteIndex = -1;
pArr.find((item, index) => {
if(item == 'assets') {
assteIndex = index;
return true
} else {
return false
}
})
if(assteIndex > 0 && assteIndex<(pArr.length-1)) {
return pArr[assteIndex + 1];
} else {
return ""
}
},
check: (appName, filePath) => {
if(escape(filePath).indexOf("%u")>=0) {
Editor.log(`检测到[中文或中文符号]命名的文件: ${filePath}`);
}
if (!/^\S*$/.test(filePath)) {
Editor.log(`检测到[包含空格]命名的文件: ${filePath}`);
}
if (/[-]/.test(filePath)) {
Editor.log(`检测到存在[包含减号(-)]命名的文件: ${filePath}`);
}
if(filePath.indexOf(appName) == -1 && (filePath.endsWith(".js") || filePath.endsWith(".ts"))) {
Editor.log(`检测到[不包含包名(${appName})]的文件: ${filePath}`);
}
}
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment