bug fix
This commit is contained in:
@@ -6,15 +6,21 @@ export class NavigationBtn extends Component {
|
||||
focus: Node;
|
||||
unfocus: Node;
|
||||
|
||||
focusLight: Node;
|
||||
|
||||
start() {
|
||||
this.focus = this.node.getChildByName("focus");
|
||||
this.unfocus = this.node.getChildByName("unfocus");
|
||||
this.focusLight = this.node.getChildByName("focusLight");
|
||||
}
|
||||
|
||||
setFocus(focus: boolean) {
|
||||
if (!this.focus) this.focus = this.node.getChildByName("focus");
|
||||
if (!this.unfocus) this.unfocus = this.node.getChildByName("unfocus");
|
||||
if (!this.focusLight)
|
||||
this.focusLight = this.node.getChildByName("focusLight");
|
||||
this.focus.active = focus;
|
||||
this.unfocus.active = !focus;
|
||||
this.focusLight.active = focus;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user