more robust editor preview (#3666)

This commit is contained in:
Yun Hsiao Wu
2018-12-21 15:42:35 +08:00
committed by pandamicro
parent 367ae4ad3c
commit edf53462fa
4 changed files with 24 additions and 6 deletions
+5 -4
View File
@@ -26,7 +26,7 @@
import RenderSystemActor from './renderSystemActor';
import renderer from '../../renderer/index';
import { toRadian } from '../../core/vmath';
import { ccclass, menu, property } from "../../core/data/class-decorator";
import { ccclass, menu, property, executeInEditMode } from "../../core/data/class-decorator";
import { Color, Enum, Rect } from '../../core/value-types';
import enums from '../../renderer/enums';
@@ -63,7 +63,7 @@ let CameraProjection = Enum({
});
let CameraClearFlag = Enum({
SKYBOX: enums.CLEAR_SKYBOX,
SKYBOX: enums.CLEAR_SKYBOX | enums.CLEAR_DEPTH | enums.CLEAR_STENCIL,
SOLID_COLOR: enums.CLEAR_COLOR | enums.CLEAR_DEPTH | enums.CLEAR_STENCIL,
DEPTH_ONLY: enums.CLEAR_DEPTH | enums.CLEAR_STENCIL,
DONT_CLEAR: 0
@@ -78,8 +78,9 @@ let CameraClearFlag = Enum({
*/
@ccclass('cc.CameraComponent')
@menu('Components/CameraComponent')
@executeInEditMode
export default class CameraComponent extends RenderSystemActor{
@property(CameraProjection)
@property
_projection = CameraProjection.PERSPECTIVE;
@property
@@ -106,7 +107,7 @@ export default class CameraComponent extends RenderSystemActor{
@property
_stencil = 0;
@property(CameraClearFlag)
@property
_clearFlags = CameraClearFlag.SOLID_COLOR;
@property
+2 -1
View File
@@ -26,7 +26,7 @@
import renderer from '../../renderer/index';
import { box } from '../primitive/index';
import Material from '../assets/material';
import { ccclass, property, menu } from '../../core/data/class-decorator';
import { ccclass, property, menu, executeInEditMode } from '../../core/data/class-decorator';
import TextureCube from '../assets/texture-cube';
import Component from '../../components/CCComponent';
@@ -39,6 +39,7 @@ import Component from '../../components/CCComponent';
*/
@ccclass('cc.SkyboxComponent')
@menu('Components/SkyboxComponent')
@executeInEditMode
export default class SkyboxComponent extends Component {
@property
+9 -1
View File
@@ -91,7 +91,15 @@ export default class Light {
}
/**
* set the hosting node of this light
* Get the hosting node of this camera
* @returns {Node} the hosting node
*/
getNode() {
return this._node;
}
/**
* Set the hosting node of this camera
* @param {Node} node the hosting node
*/
setNode(node) {
+8
View File
@@ -41,6 +41,14 @@ export default class Model {
this._boundingShape = aabb.clone(this._bsModelSpace);
}
/**
* Get the hosting node of this camera
* @returns {Node} the hosting node
*/
getNode() {
return this._node;
}
/**
* Set the hosting node of this model
* @param {Node} node the hosting node