优化文本材质更新

pull/706/MERGE
ChenX 5 years ago
parent f3382aca05
commit f70ec3dc6c

@ -101,7 +101,7 @@ export class Text extends Entity
this.UpdateTranslate();
this.AsyncUpdated();
}
//TODO: FIXME 应该避免一直重载这个迭代.
UpdateTranslate()
{
for (let [type, obj] of this._CacheDrawObject)
@ -149,10 +149,14 @@ export class Text extends Entity
{
this.AsyncUpdateDrawObject(obj, type);
}
UpdateDrawObjectMaterial(type: RenderType, en: Object3D)
UpdateDrawObjectMaterial(renderType: RenderType, en: Object3D)
{
if (en)
this.AsyncUpdateDrawObject(en, type);
if (en && en.children.length === 1)
{
let mesh = en.children[0] as Mesh;
let color = renderType === RenderType.Print ? 256 : this.ColorIndex;
mesh.material = ColorMaterial.GetBasicMaterialDoubleSide(color);
}
}
GetGripPoints(): Array<Vector3>
{

Loading…
Cancel
Save