// Learn TypeScript:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/2.4/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class Trap extends cc.Component {
   @property(cc.Node)
   spBack: cc.Node = null;
 
   @property(cc.Node)
   spFont: cc.Node = null;

    updateSize(is18){
        if (is18) {
            this.spBack.width = 50;
            this.spBack.height = 60;
            this.spFont.width = 50;
            this.spFont.height = 35;
        }else{
            this.spBack.width = 45;
            this.spBack.height = 55;
            this.spFont.width = 45;
            this.spFont.height = 25;
        }
        this.spFont.zIndex = 10000;
    }
}
