Skip to content

refactor(webgal): 将引擎特效纹理从 game/tex 迁移到 assets#945

Open
A-kirami wants to merge 1 commit intoOpenWebGAL:devfrom
A-kirami:refactor/move-engine-effect-textures-to-assets
Open

refactor(webgal): 将引擎特效纹理从 game/tex 迁移到 assets#945
A-kirami wants to merge 1 commit intoOpenWebGAL:devfrom
A-kirami:refactor/move-engine-effect-textures-to-assets

Conversation

@A-kirami
Copy link
Copy Markdown
Contributor

@A-kirami A-kirami commented May 6, 2026

背景

当前 snow、rain、cherryBlossoms 三个 PIXI perform 使用的纹理文件放在 public/game/tex,构建后进入 dist/game/tex

这类资源本质上是引擎内置纹理,不属于游戏项目资源。继续放在 game/ 目录下会混淆引擎文件和游戏文件的边界,也绕开了引擎自身的 assets 构建管线。

本次修改

  • snow.pngrain.pngcherryBlossoms.webppackages/webgal/public/game/tex 迁移到 packages/webgal/src/assets/tex
  • 将三个 perform 的纹理加载方式改为通过模块导入获取构建产物 URL
  • 让这批引擎内置纹理随 Vite 一起构建到 dist/assets
  • 不再依赖 ./game/tex/* 作为运行时加载路径

影响范围

  • packages/webgal/src/Core/gameScripts/pixi/performs/snow.ts
  • packages/webgal/src/Core/gameScripts/pixi/performs/rain.ts
  • packages/webgal/src/Core/gameScripts/pixi/performs/cherryBlossoms.ts
  • packages/webgal/src/assets/tex/*

预期收益

  • 明确区分引擎资源和游戏资源
  • 统一到现有 src/assets -> dist/assets 的构建方式
  • 避免引擎内置纹理继续占用 game/ 命名空间
  • 构建产物更符合 npm 包和引擎分发语义

验证

  • packages/webgal 下执行 yarn build
  • 确认构建通过
  • 确认纹理文件输出到 dist/assets
  • 确认不再生成 dist/game/tex 中的这三张引擎纹理

风险与兼容性

  • 如果外部项目此前依赖覆盖 game/tex/* 来替换这三种内置特效纹理,这种覆盖方式将失效
  • 除此之外,本次修改不涉及脚本接口或游戏资源协议变更

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the cherry blossoms, rain, and snow performance scripts by replacing hardcoded relative texture paths with imported asset URLs. This allows the build system to manage asset resolution and hashing more effectively. I have no feedback to provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant