Hi!
I’m deeply pleased with Cocos Creator. This is what I was waiting for.
I’m a bit confused about properties. More precisely about getters/setters.
Could someone clarify it for me?
Let’s say I’d like custom getter and setter for a property. So I declare it like it is described in the documentation:
properties: { foo: { get: function () { return this._foo }, set: function… } }
Then should I add _foo to the list?
And how can I give it a default value?
And so can I return an initialised object’s method’s return value ( eg. return this._foo.getFoo() )?
Does it become a private member only if I declare the getter only?
These are the questions in my mind.
Thanks for your help in advance.