Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OP13
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
template admin
OP13
Commits
1ffbb99c
Commit
1ffbb99c
authored
Jan 06, 2023
by
李维
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
加长绳子适配竖屏
parent
ce0e330e
Changes
7
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
426 additions
and
146 deletions
+426
-146
OP13.fire
assets/OP13/scene/OP13.fire
+243
-146
rope.png
assets/OP13/textures/unpack/rope.png
+0
-0
rope.png.meta
assets/OP13/textures/unpack/rope.png.meta
+36
-0
main.js
packages/check-file-name/main.js
+28
-0
package-lock.json
packages/check-file-name/package-lock.json
+30
-0
package.json
packages/check-file-name/package.json
+15
-0
file.js
packages/check-file-name/util/file.js
+74
-0
No files found.
assets/OP13/scene/OP13.fire
View file @
1ffbb99c
This diff is collapsed.
Click to expand it.
assets/OP13/textures/unpack/rope.png
0 → 100644
View file @
1ffbb99c
4.66 KB
assets/OP13/textures/unpack/rope.png.meta
0 → 100644
View file @
1ffbb99c
{
"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
packages/check-file-name/main.js
0 → 100644
View file @
1ffbb99c
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
packages/check-file-name/package-lock.json
0 → 100644
View file @
1ffbb99c
{
"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="
}
}
}
packages/check-file-name/package.json
0 → 100644
View file @
1ffbb99c
{
"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"
}
}
packages/check-file-name/util/file.js
0 → 100644
View file @
1ffbb99c
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
}
`
);
}
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment