// Learn cc.Class:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/class.html
// Learn Attribute:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - [Chinese] http://docs.cocos.com/creator/manual/zh/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/creator/en/scripting/life-cycle-callbacks.html

cc.Class({
    extends: cc.Component,

    properties: {
        safe_Time:1,
        Already_click:false
    },
    onLoad () {
        this.node.on('click',this.callback,this);
    },
    callback(){
        var self = this;
        if(self.Already_click == true){
            return ;
        }
        self.Button_Click();
        self.Already_click = true;
    },
    update (dt) {
        var self = this;
        if(self.Already_click){
            self.safe_Time -= dt;
            if(self.safe_Time <= 0){
                self.Already_click = false;
                self.safe_Time = 1;
            }
        }
    },
    Button_Click(){
        //所有的相应事件在这里写就号
    }
});
