装饰器是否支持二维数组

cocos creator 3.4.1

希望在一个自定义组件上能够编辑如下,

  • sequence 3
    • [0] [number, string, cc.node]
    • [1] [number, string, cc.node]
    • [2] [number, string, cc.node]

image image 这样?

1赞

记录一个问题,二维数组下,node 类型不能正确被赋值,始终处于 null 状态。

不会啊 是不是你Node类型给错了 有两个Node :13:

import { _decorator, Component, Node, Enum, CCString, Tween, Sprite } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('TweenParameters')

    @property({ type: Node })
    node: Node = null;
}

找到问题了,变量名称起名 node 时,会引发不能赋值的错误。

该主题在最后一个回复创建后14天后自动关闭。不再允许新的回复。