update
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"ver": "4.0.24",
|
||||
"importer": "typescript",
|
||||
"imported": true,
|
||||
"uuid": "54ca6f08-c166-47ca-a969-6a7cb141f29a",
|
||||
"files": [],
|
||||
"subMetas": {},
|
||||
"userData": {}
|
||||
}
|
||||
Reference in New Issue
Block a user