diff --git a/cocos/core/data/class-decorator.ts b/cocos/core/data/class-decorator.ts index 7bd3014112..20067dabf3 100644 --- a/cocos/core/data/class-decorator.ts +++ b/cocos/core/data/class-decorator.ts @@ -638,9 +638,13 @@ export const string = type(CCString); */ export function type (type: Function): PropertyDecorator; +export function type (type: [Function]): PropertyDecorator; + export function type (type: PrimitiveType): PropertyDecorator; -export function type (type: PrimitiveType | Function): PropertyDecorator { +export function type (type: [PrimitiveType]): PropertyDecorator; + +export function type (type: PrimitiveType | Function | [PrimitiveType] | [Function]): PropertyDecorator { return property({ type, }); diff --git a/cocos/core/pipeline/pipeline-serialization.ts b/cocos/core/pipeline/pipeline-serialization.ts index 6a3b557f0b..19e482d183 100644 --- a/cocos/core/pipeline/pipeline-serialization.ts +++ b/cocos/core/pipeline/pipeline-serialization.ts @@ -1,7 +1,8 @@ -import { ccclass, property } from '../data/class-decorator'; +import { ccclass, property, type } from '../data/class-decorator'; import { ccenum } from '../value-types/enum'; import { GFXFormat, GFXLoadOp, GFXStoreOp, GFXTextureLayout, GFXTextureType, GFXTextureUsageBit, GFXTextureViewType} from '../gfx/define'; +import { CCString } from '../data'; ccenum(GFXTextureType); ccenum(GFXTextureViewType); @@ -50,10 +51,8 @@ export class FrameBufferDesc { public name: string = ''; @property public renderPass: number = 0; - @property({ - type: [String], - }) - public colorViews = []; + @type([CCString]) + public colorViews: string[] = []; @property public depthStencilView: string = ''; } diff --git a/cocos/core/pipeline/render-stage.ts b/cocos/core/pipeline/render-stage.ts index 9684c53ca6..fe6286bbd0 100644 --- a/cocos/core/pipeline/render-stage.ts +++ b/cocos/core/pipeline/render-stage.ts @@ -2,7 +2,7 @@ * @category pipeline */ -import { ccclass, property } from '../data/class-decorator'; +import { ccclass, property, type } from '../data/class-decorator'; import { ccenum } from '../value-types/enum'; import { GFXCommandBuffer } from '../gfx/command-buffer'; import { IGFXColor, IGFXRect, GFXClearFlag, GFXCommandBufferType } from '../gfx/define'; @@ -16,6 +16,7 @@ import { RenderFlow } from './render-flow'; import { RenderPipeline } from './render-pipeline'; import { opaqueCompareFn, RenderQueue, transparentCompareFn } from './render-queue'; import { RenderView } from './render-view'; +import { CCString } from '../data'; const colors: IGFXColor[] = [ { r: 0, g: 0, b: 0, a: 1 } ]; const bufs: GFXCommandBuffer[] = []; @@ -46,9 +47,7 @@ class RenderQueueDesc { type: RenderQueueSortMode, }) public sortMode: RenderQueueSortMode = RenderQueueSortMode.FRONT_TO_BACK; - @property({ - type: [String], - }) + @type([CCString]) public stages: string[] = []; }