Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified release/preview-template.zip
Binary file not shown.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions release/preview-template/dist/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<script type="module" crossorigin src="/dist/assets/index.95bf25f5.js"></script>
<link rel="stylesheet" href="/dist/assets/index.741f95c0.css">
<script type="module" crossorigin src="/dist/assets/index.7489529e.js"></script>
<link rel="stylesheet" href="/dist/assets/index.3b94c241.css">
<div id="dev-app" style="width: 400px;height: 100%;display: flex;flex-direction: column;justify-content: center;"></div>

2 changes: 1 addition & 1 deletion release/preview-template/index.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
name="viewport"
content="width=device-width,user-scalable=no,initial-scale=1,minimum-scale=1,maximum-scale=1,minimal-ui=true"
/>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="full-screen" content="yes" />
<meta name="screen-orientation" content="portrait" />
<meta name="x5-fullscreen" content="true" />
Expand Down
2 changes: 1 addition & 1 deletion release/preview-template/version.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"name":"ccc-devtools","version":"2022/12/11","author":"Next","repo":"https://github.com/potato47/ccc-devtools.git"}
{"name":"ccc-devtools","version":"2025/5/22","author":"Next","repo":"https://github.com/potato47/ccc-devtools.git"}
2 changes: 1 addition & 1 deletion src/components/TreePanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ function setChildren(container: TreeNode[], children: any[], path: string[]) {

function refreshTree() {
// @ts-ignore
if (props.show && window.ccdevShow) {
if (props.show && window.ccdevShow && cc.director.getScene()) {
let value: TreeNode[] = [];
//@ts-ignore
setChildren(value, cc.director.getScene().children, []);
Expand Down
19 changes: 19 additions & 0 deletions src/misc/Utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,27 @@ export default class Utils {
console.log('temp' + i);
// @ts-ignore
console.log(window['temp' + i]);
this.copyToClipboard('temp' + i)
}

static async copyToClipboard(text: string) {
try {
// 使用 Clipboard API(现代浏览器)
await navigator.clipboard.writeText(text);
console.log('已通过 Clipboard API 复制到剪贴板:', text);
} catch (err) {
// 回退到 execCommand(旧浏览器)
const textarea = document.createElement('textarea');
textarea.value = text;
document.body.appendChild(textarea);
textarea.select();
document.execCommand('copy');
document.body.removeChild(textarea);
console.log('已通过 execCommand 回退复制到剪贴板:', text);
}
};


static drawNodeRect(target: any) {
let rect;
let transform = target.getComponent(cc.UITransformComponent);
Expand Down