/**
 * copyright (c) 厦门风领科技有限公司
 * http://www.fenglinghudong.com/
 * 
 * 组件功能
 * 徐斌杰
 * 2018-00-00
 */
const {ccclass, property} = cc._decorator;

@ccclass
export default class RScene extends cc.Component {

    /**
     * 
     */
    @property({
        type:cc.Node,
        tooltip:''
    })
    display: cc.Node = null;

    

    onLoad(){
        
    }
    



    start () {
        if (cc.sys.platform != cc.sys.WECHAT_GAME){
            return;
        }
        wx.onMessage(data => {
            switch (data.message) {
                case 'Show':
                    this._show();
                    break;
                case 'Hide':
                    this._hide();
                    break;
            }
        });
    }

    _show () {
        // let moveTo = cc.moveTo(0.5, 0, 73);
        // this.display.runAction(moveTo);
        this.display.active = true;
    }

    _hide () {
        // let moveTo = cc.moveTo(0.5, 0, 1000);
        // this.display.runAction(moveTo);
        this.display.active = false;
    }
    // update (dt) {},
}
