This commit is contained in:
2025-09-15 16:11:15 +08:00
parent eb0163b3fc
commit 5a5014b024
26 changed files with 2400 additions and 754 deletions
@@ -0,0 +1,20 @@
import { _decorator, Component, Node, SpringJoint2D, Sprite } from "cc";
const { ccclass, property } = _decorator;
@ccclass("NavigationBtn")
export class NavigationBtn extends Component {
focus: Node;
unfocus: Node;
start() {
this.focus = this.node.getChildByName("focus");
this.unfocus = this.node.getChildByName("unfocus");
}
setFocus(focus: boolean) {
if (!this.focus) this.focus = this.node.getChildByName("focus");
if (!this.unfocus) this.unfocus = this.node.getChildByName("unfocus");
this.focus.active = focus;
this.unfocus.active = !focus;
}
}