Application.js 1.84 KB
cc.Class({
    extends: cc.Component,

    properties: {
        
        //键值由具体场景决定
        _aSceneContext:{default:[]},

        /*
        {
            categoryId:123,
            history:[]
        }
        /*/
        _aSceneParameter:{default:[]},
        _bBackStatus:false,
        _iDefaultCollectionId:-1,

        _iTotalFrames:0,
    },

    // use this for initialization
    onLoad: function () {
        this._aSceneContext=[];
        this._aSceneParameter=[];
    },

    getSceneContext:function(){
        return this._aSceneContext;
    },
    popSceneContext:function(){
        return this._aSceneContext.pop();
    },
    getTopSceneContext:function(){
        return this._aSceneContext[this._aSceneContext.length-1];
    },
    setSceneContext:function(aSceneContext){
        this._aSceneContext=aSceneContext;
    },
    getSceneParameter:function(){
        return this._aSceneParameter;
    },
    popSceneParameter:function(){
        return this._aSceneParameter.pop();
    },
    getTopSceneParameter:function(){
        return this._aSceneParameter[this._aSceneParameter.length-1];
    },
    setSceneParameter:function(aSceneParameter){
        this._aSceneParameter=aSceneParameter;
    },
    getBackStatus:function(){
        return this._bBackStatus;
    },

    setBackStatus:function(bBackStatus){
        this._bBackStatus=bBackStatus;
    },

    getDefaultCollectionId:function(){
        return this._iDefaultCollectionId;
    },

    setDefaultCollectionId:function(iCollectionId){
        this._iDefaultCollectionId=iCollectionId;
    },

    setTotalFrames:function(iFrames){
        this._iTotalFrames=iFrames;
    },

    getTotalFrames:function(){
        return this._iTotalFrames;
    }

    // called every frame, uncomment this function to activate update callback
    // update: function (dt) {

    // },
});