Hello,
I wrote the following code:
@property ({ type: cc.SpriteAtlas })
_cellsAtlas: cc.SpriteAtlas = null;
And then, I added get and set like this:
@property({ type: cc.SpriteAtlas })
get CellsAtlas() {
return this._cellsAtlas;
}
set CellsAtlas(value) {
this._cellsAtlas = value;
// On Property Changed...
}
Is there a better way to do that? Less code? Better solution? (I am sure something is messed up here)
I am ending up with lots lines of code just for making props and I did not even started to scratch the surface…
The program runs fine and in JS it looks much cleaner.
Btw, What are the properties that I can add inside:
@property({ //here…? })
Any documentation for that?
My Cocos Creator version is 2.0.5 (currently the latest).