添加形状显示开关,修改默认参数

This commit is contained in:
tianmo committed 2026-09-22 14:42:21 +08:00
1 parent aadcf5cbcf
commit 3f2699a946
7 files changed
+17 -6

No files matched your search

@@ -120,6 +120,10 @@
<NumSlider label="基准角度" :min="-360" :max="360" :step="1" v-model="sys.config.direction" />
<NumSlider label="随机范围" :min="0" :max="360" :step="1" v-model="sys.config.spread" />
</template>
<label v-if="sys.config.shape !== 'point'" class="switch-row">
<input type="checkbox" v-model="sys.config.showShape" />
<span class="switch-ui"></span><span>显示形状</span>
</label>
</div>
</div>
</template>
+1 -1
View File
@@ -298,7 +298,7 @@ const MODULE_RESET_KEYS: Record<Exclude<ResetModule, 'export'>, string[]> = {
'burstCount', 'burstLoop', 'delay', 'duration',
],
shape: [
'shape', 'shapeRangeVersion',
'shape', 'showShape', 'shapeRangeVersion',
'innerRadius', 'outerRadius', 'innerRectW', 'innerRectH', 'outerRectW', 'outerRectH', 'spawnPathId', 'spawnPathDistribution',
'radius', 'rectW', 'rectH', 'emissionAngleMode', 'direction', 'spread', 'coneDirection', 'coneAngle',
],
+1 -1
View File
@@ -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
+7 -1
View File
@@ -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) => {