mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
more robust editor preview (#3666)
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user