1234567891011121314151617181920212223242526272829 |
- import { _decorator, Component, Node, Button, EventHandler, NodeEventType } from 'cc';
- const { ccclass, property } = _decorator;
- @ccclass('btn_hui')
- export class btn_hui extends Component {
- @property(Node) btn_an_xia_hui:Node = null;
- start() {
- this.node.on(NodeEventType.MOUSE_DOWN, ()=>{
- this.btn_an_xia_hui.active = true;
- }, this);
- this.btn_an_xia_hui.active = false;
- }
- update(deltaTime: number) {
- if(this.node.scale.x===1){
- if(this.btn_an_xia_hui.active){
- this.btn_an_xia_hui.active = false;
- }
- }else{
- if(!this.btn_an_xia_hui.active){
- this.btn_an_xia_hui.active = true;
- }
- }
-
- }
- }
|