unityzgy/CODELY.md
ayuan9957 1b87b70d96 feat: 沙漠地形场景注册 + 海岛起点区域修复 + 编队编组下拉框修复
- 沙漠(沙漠.unity): 地形材质优化(增大tileSize减少重复), 添加枯草950簇, 烘焙NavMesh
- 沙漠注册到程序: AB打包, SAMap.txt, SQLite数据库(替换城市), 本地化XML, 8192x8192地图图片(含绿色起点区域)
- 海岛.unity: PermissibleArea旋转180°修正, MeshRenderer统一禁用(匹配山地)
- 海岛地图: 使用卫星贴图MountRainier_Stitched作为底图, 绘制绿色起点区域
- 编队编组下拉框: 修复选项顺序与FormationGroupingEnum不匹配导致前三个选错的问题
- StudentSub1EditorPanel: 运行时重建下拉选项, +1偏移映射enum
2026-07-27 17:30:32 +08:00

4.4 KiB
Raw Blame History

Codely Structured Memories

User

Feedback

  • [2026-07-23 10:59:26] User wants ALL UI text to translate in real-time when switching languages, including: static Text, Dropdown options, InputField placeholders, Toggle labels, popup/prompt windows, 3D text, VR controller tooltips, and operation messages. Any text that doesn't update on language switch is a bug. Why: user has tested every panel and reported missing translations repeatedly. How to apply: when adding any new UI text or popup, always use LocalizationManager.Get/Format/SetFormatted instead of raw strings. For popups with dynamic content, pass key+args (not pre-formatted string) so LanguageChanged can re-translate.
  • [2026-07-27 10:16:48] User does NOT want AI-generated terrain textures to replace existing good ones. Why: AI-generated "seamless" textures had visible seams/tiling artifacts, and user felt replacing all existing textures was unnecessary when original ones were fine. How to apply: For terrain texture optimization, keep existing textures and only adjust parameters (tileSize, smoothness, splatmap distribution, basemap distance). Only generate new textures if user explicitly asks for a specific new texture.

Project

  • [2026-07-23 10:59:21] User is building a multi-language localization system (Chinese/English/French/Russian) for a Unity 2019.4 military equipment repair simulation training app. Translations are stored in Assets/StreamingAssets/Localization.xml (external XML, ~470 entries). Code fallback in LocalizationManager.cs. Key patterns: SetFormatted() for format strings, InjectOperateMsgLocalized() for operation records, IconBase.SetName() wraps LocalizationManager.Get(), PromptWindowInitData has key+args constructor for real-time translation of popups.

  • [2026-07-27 12:10:20] 海岛.unity terrain: custom Custom/PuzzleTerrain shader (modified to single _MainTex), 9×9 satellite tiles stitched into MountRainier_Stitched.png (8192×8192, DXT1). PermissibleArea MeshRenderer must be disabled (False) in all terrain scenes (山地/海岛/沙漠) — the green start area is shown by UI prefab Image_startArea, NOT by the 3D TOUMING material. Enabling MeshRenderer breaks it. Tile arrangement: x=0 west→x=8 east; y=0 south→y=8 north (NO Y-flip). Terrain registered in project: SQLite AssetBundle table (Type=3), SAMap.txt (海岛=OutAssets/AB/Scenes/海岛.ab, 海岛_Map=OutAssets/Map/海岛_Map.png), localization added. NavMesh baked to Assets/Scenes/海岛/NavMesh.asset. Map images: 海岛_Map.png + 海岛_temp.png saved as JPG (RGB24, ~13MB, marker at PermissibleArea pos). Scene structure mirrors 山地 (same root objects: Directional Light, Terrain+water children, Canvas, TooltipCanvas, EventSystem, CameraPos, PermissibleArea, VRCameraPos+VRTK). StudentWaitingPanel.cs hardcoded "山地" fixed to use dynamic terrainName.

  • [2026-07-24 18:03:18] Student app (VirtualRepairClient) is at test/VirtualRepairClient_Data/. Built 2022, but DLL/resources can be hot-swapped. AB files are at StreamingAssets/OutAssets/AB/Scenes/. Student app loads scenes from AB, UI prefab from baked resources.assets. To deploy code fixes: copy Library/ScriptAssemblies/Assembly-CSharp.dll to test/VirtualRepairClient_Data/Managed/. To deploy scene fixes: rebuild AB with BuildPipeline.BuildAssetBundles and copy to both project's and student app's StreamingAssets. Dropdown options now built at runtime in StudentSub1EditorPanel.Change() to avoid dependency on prefab option order.

  • [2026-07-27 11:06:13] New terrain scene registration process (e.g. 沙漠): 1) Set AssetBundle name via AssetImporter.assetBundleName, 2) Build AB with BuildPipeline.BuildAssetBundles (output file has no .ab extension - rename to match SAMap path), 3) Add to StreamingAssets/SAMap.txt (both 沙漠=OutAssets/AB/Scenes/沙漠.ab and 沙漠_Map=OutAssets/Map/沙漠_Map.png), 4) Add to SQLite VirtualRepairSql.db table AssetBundle (Name, Type=3 for 地形, FilePath, ParentName=NULL) — use C# SqliteCommand with parameters, NOT sqlite3 CLI (CLI mangles Chinese chars), 5) Add localization entry to StreamingAssets/Localization.xml, 6) Generate map image (top-down terrain render with hillshade), 7) Copy AB + map + SAMap.txt + db + Localization.xml to test/VirtualRepairClient_Data/StreamingAssets/. Terrain dropdown reads from DBManager.Instance.GetABNames(ABType.地形).

Reference