添加形状显示开关,修改默认参数
This commit is contained in:
1 parent
aadcf5cbcf
commit
3f2699a946
7 files changed
+17
-6
No files matched your search
@@ -40,10 +40,10 @@ export function drawShapeRange(store: EditorStore, emitterPreviewTransform: Map<
|
||||
if (!shapeGfx) return
|
||||
const g = shapeGfx
|
||||
g.clear()
|
||||
if (!store.settings.showEmitter) return
|
||||
const sys = store.systems.find((s) => s.id === store.activeId)
|
||||
if (!sys || sys.visible === false) return
|
||||
const c = sys.config
|
||||
if (!c.showShape) return
|
||||
const preview = emitterPreviewTransform.get(sys.id)
|
||||
// root 中心(发射器容器 position = centerX/-centerY),数学坐标
|
||||
const cx = preview?.x ?? c.centerX ?? 0
|
||||
|
||||
@@ -167,8 +167,14 @@ export function drawPaths(store: EditorStore, selectedPathNodes: Set<number>, pa
|
||||
if (!pathGfx) return
|
||||
const g = pathGfx
|
||||
g.clear()
|
||||
const activeSystem = store.activeObjectType === 'particle'
|
||||
? store.systems.find((system) => system.id === store.activeObjectId)
|
||||
: null
|
||||
const hiddenEmitterPathId = activeSystem?.config.shape === 'path' && !activeSystem.config.showShape
|
||||
? activeSystem.config.spawnPathId
|
||||
: 0
|
||||
for (const path of store.paths) {
|
||||
if (path.visible === false || !path.enabled || !path.points.length) continue
|
||||
if (path.id === hiddenEmitterPathId || path.visible === false || !path.enabled || !path.points.length) continue
|
||||
const selected = store.activeObjectType === 'path' && store.activeObjectId === path.id
|
||||
const color = colorNumber(path.color, 0xff933e)
|
||||
const screenPoint = (x: number, y: number) => {
|
||||
|
||||
Reference in new issue
Block a user