From 9160abd3205b60d1ba2ae24ebf3e9a516127dfed Mon Sep 17 00:00:00 2001 From: Santy-Wang Date: Mon, 23 Nov 2020 11:06:46 +0800 Subject: [PATCH] hide fallback effect in editor (#7840) * hide fallback effect in editor * refine --- cocos/core/3d/builtin/init.ts | 1 + cocos/core/assets/effect-asset.ts | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cocos/core/3d/builtin/init.ts b/cocos/core/3d/builtin/init.ts index 9e57fb7608..d431feeca8 100644 --- a/cocos/core/3d/builtin/init.ts +++ b/cocos/core/3d/builtin/init.ts @@ -170,6 +170,7 @@ class BuiltinResMgr { shaderInfo[shaderVersionKey] = shaderSource; } }); + effect.hideInEditor = true; effect.onLoaded(); }); this._initMaterials(); diff --git a/cocos/core/assets/effect-asset.ts b/cocos/core/assets/effect-asset.ts index d1190ab505..d45dd9b895 100644 --- a/cocos/core/assets/effect-asset.ts +++ b/cocos/core/assets/effect-asset.ts @@ -28,7 +28,7 @@ * @module material */ -import { ccclass, serializable, editable } from 'cc.decorator'; +import { ccclass, serializable, editable, editorOnly } from 'cc.decorator'; import { EDITOR } from 'internal:constants'; import { Root } from '../root'; import { BlendState, DepthStencilState, RasterizerState, DescriptorType, @@ -192,6 +192,10 @@ export class EffectAsset extends Asset { @editable public combinations: IPreCompileInfo[] = []; + @serializable + @editorOnly + public hideInEditor = false; + /** * @en The loaded callback which should be invoked by the [[Loader]], will automatically register the effect. * @zh 通过 [[Loader]] 加载完成时的回调,将自动注册 effect 资源。