mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
add TypedArray (#4994)
This commit is contained in:
@@ -569,7 +569,16 @@ class _Deserializer {
|
||||
let obj: any = null; // the obj to return
|
||||
let klass: any = null;
|
||||
const type = serialized.__type__;
|
||||
if (type) {
|
||||
if (type === 'TypedArray') {
|
||||
const array = serialized.array;
|
||||
// @ts-ignore
|
||||
obj = new window[serialized.ctor](array.length);
|
||||
for (let i = 0; i < array.length; ++i) {
|
||||
obj[i] = array[i];
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
else if (type) {
|
||||
|
||||
// Type Object (including CCClass)
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@ export class Terrain extends Component {
|
||||
|
||||
@property({
|
||||
type: TerrainLayer,
|
||||
visible: false,
|
||||
visible: true,
|
||||
})
|
||||
protected _layers: Array<TerrainLayer|null> = [];
|
||||
|
||||
|
||||
Reference in New Issue
Block a user