怎么才能在start里获取properties的各种属性

cc.Class({
extends: cc.Component,
properties: {
att1: 0,
att2: “”,
testArr: [],

	structArr: {
		default: function(){
			return [1,2,3,4,5];
		}, 
		serializable: true,
		type: [cc.Integer],
		arrLenght: 5,
		getLenght(){
			return this.arrLenght;
		},
	},
start () {
	cc.log("=======>>att1:" + this.att1);
	cc.log("=======>>att2:" + this.att2	);
},

)}

这三个都没问题 att1 att2 testArr
怎么才能拿到structArr里的lenght
this.structArr.getlenght()?这样写不对

:hushed:这是啥写法????
this.structArr.length

今天刚才是写JS要怎么才能获取到arrLenght?

this.structArr.length 就行了啊

从你return [1,2,3,4,5]后边所有的都中断了,相当于没有任何效果

what?:confused:

start怎么写到properties里面了

你不是要获取staructArr这个数组的长度嘛? .length就行啊

写在外面会报错
error: Unknown type of CCLogo_Scrip.structArr, property should be defined in ‘properties’ or ‘ctor’
我本意是在properties里面创建一个自定义的类型

properties: {
	structArr: {
	   	arrLenght: 5,
	},
},

cc.log("=======>>this.structArr.arrLenght:" + this.structArr.arrLenght);
好像不行嘛。。。。
[ERROR]: TypeError: Cannot read property ‘arrLenght’ of undefined

并不会报错

https://docs.cocos.com/creator/manual/zh/scripting/class.html
你看下官方文档吧,,,

大概理解了虽然不清楚为什么会中断
其实我本意是想在properties里放一个自定义的属性
属性里可以放各种类型

return会中断后续所有。

这样?

了解THX!!