1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- import { _decorator, Component, Node, Color, Label } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('page_btn')
- export class page_btn extends Component {
- @property(Node)
- select_status_node: Node = null;
- @property(Node)
- unselect_status_node: Node = null;
- @property(Node)
- lab: Node = null;
- color:Color = new Color()
- start() {
- }
- status_select(){
- this.select_status_node.active = true;
- this.unselect_status_node.active = false;
- if(this.lab!=null){
- this.lab.getComponent(Label).color = this.color.fromHEX("#FFFFFF")
- }
-
- }
- isSelect(){
- return this.select_status_node.active;
- }
- status_unselect(){
- this.select_status_node.active = false;
- this.unselect_status_node.active = true;
- if(this.lab!=null){
- this.lab.getComponent(Label).color = this.color.fromHEX("#A48C80")
- }
- }
- update(deltaTime: number) {
-
- }
- }
|