add TypedArray (#4994)

This commit is contained in:
gameu3d
2019-07-26 16:12:11 +08:00
committed by Weiliang Wang
parent 6d2671b6f1
commit 59079ed8dc
2 changed files with 11 additions and 2 deletions
+10 -1
View File
@@ -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)
+1 -1
View File
@@ -526,7 +526,7 @@ export class Terrain extends Component {
@property({
type: TerrainLayer,
visible: false,
visible: true,
})
protected _layers: Array<TerrainLayer|null> = [];