Skip to content

Commit

Permalink
fix: fix material clone bug (#308)
Browse files Browse the repository at this point in the history
  • Loading branch information
GuoLei1990 authored May 26, 2021
1 parent 7b4d7af commit e2247df
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/core/src/shader/ShaderData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,12 @@ export class ShaderData implements IRefObject, IClone {
} else if (property instanceof Array || property instanceof Float32Array || property instanceof Int32Array) {
targetProperties[k] = property.slice();
} else {
targetProperties[k] = property.clone();
const targetProperty = targetProperties[k];
if (targetProperty) {
property.cloneTo(targetProperty);
} else {
targetProperties[k] = property.clone();
}
}
} else {
targetProperties[k] = property;
Expand Down

0 comments on commit e2247df

Please sign in to comment.