Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve #1

Merged
merged 2 commits into from
Oct 24, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions cocos/3d/assets/mesh.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ export default class Mesh extends Asset {
this.flush();
}

onLoad() {
this.flush();
}

constructor() {
super();

Expand Down
4 changes: 3 additions & 1 deletion cocos/3d/framework/animation-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ export default class AnimationComponent extends Component {

_preview = false;

@property({type: Boolean, editorOnly: true})
@property({type: Boolean})
get preview() {
return this._preview;
}
Expand All @@ -342,9 +342,11 @@ export default class AnimationComponent extends Component {
this._preview = value;
if (value) {
if (this.currentClip) {
cc.engine.animatingInEditMode = true;
this.play(this.currentClip.name);
}
} else {
cc.engine.animatingInEditMode = false;
this._animCtrl.crossFade(null, 0);
}
}
Expand Down
11 changes: 11 additions & 0 deletions cocos/3d/framework/camera-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,17 @@ export default class CameraComponent extends RenderSystemActor{
}

onLoad() {
this.projection = this._projection;
this.priority = this._priority;
this.fov = this._fov;
this.orthoHeight = this._orthoHeight;
this.near = this._near;
this.far = this._far;
this.color = this._color;
this.depth = this._depth;
this.stencil = this._stencil;
this.clearFlags = this._clearFlags;
this.rect = this._rect;
this._camera.setStages([
'opaque',
'transparent'
Expand Down
7 changes: 5 additions & 2 deletions cocos/3d/framework/model-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,9 @@ export default class ModelComponent extends RenderableComponent {
}

_updateModels() {
if (this._mesh) {
this._mesh.flush();
}
let meshCount = this._mesh ? this._mesh.subMeshCount : 0;
let oldModels = this._models;

Expand Down Expand Up @@ -292,12 +295,12 @@ export default class ModelComponent extends RenderableComponent {
}

_updateCastShadow() {
if (this._shadowCastingMode === 'off') {
if (this._shadowCastingMode === ModelShadowCastingMode.Off) {
for (let i = 0; i < this._models.length; ++i) {
let model = this._models[i];
model._castShadow = false;
}
} else if (this._shadowCastingMode === 'on') {
} else if (this._shadowCastingMode === ModelShadowCastingMode.On) {
for (let i = 0; i < this._models.length; ++i) {
let model = this._models[i];
model._castShadow = true;
Expand Down
4 changes: 3 additions & 1 deletion cocos/3d/framework/renderSystemActor.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ class RenderSystemActorListener {
this._renderSystem = cc.director._renderSystem;
}
comp._system = this._renderSystem;
comp._scene = this._renderSystem.scene;
if (this._renderSystem) {
comp._scene = this._renderSystem.scene;
}
}
}

Expand Down
4 changes: 4 additions & 0 deletions cocos/3d/framework/skinning-model-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ export default class SkinningModelComponent extends ModelComponent {
}

_updateModels() {
if (this._mesh) {
this._mesh.flush();
}

let meshCount = this._mesh ? this._mesh.subMeshCount : 0;
let oldModels = this._models;

Expand Down
7 changes: 1 addition & 6 deletions cocos/load-pipeline/uuid-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,7 @@ export function loadUuid (item, callback) {
if (depends.length === 0) {
return callback(null, asset);
}
loadDepends(this.pipeline, item, asset, depends, (...args)=> {
if (asset.onLoad) {
asset.onLoad();
}
callback(...args);
});
loadDepends(this.pipeline, item, asset, depends, callback);
}

loadUuid.isSceneObj = isSceneObj;