- One empty scene; App builds the canvas, safe-area layout and a shared 5x6 Grid in code. Pages (Intro, Main, Choose, Play, Account, Settings) replace 5 scenes, 5 prefabs and the per-cell spawner/display components. - Packs: the game reads Rhyculator/package/ (with All files access) or the app folder, like a plugged-in USB stick. Zips stay where they are and are extracted to a cache keyed by name/size/mtime; folders are read directly. Scans run every second on a background thread. Old songs/ imports and inbox zips are migrated automatically. - Download packs by 8-char code from the new pack website, or via rhyculator://pack/<code> links; opened/shared zips go into the package folder. - Play: pause/resume/retry, auto-pause on background, combo and progress bar; judging and scoring unchanged. Choose page fits 9:16 screens; empty state, pack delete. Android back key handled everywhere. - Slimming: removed TextMesh Pro, unused 2D/Timeline/VisualScripting/etc. packages and modules, scene template, unused sprites; menu theme wav (20MB) -> ogg (2.3MB). Build profile replaced by explicit settings in BuildAndroid. - Tests: PackLibrary/PackReader/migration/serializer tests (39 passing). Co-Authored-By: Claude Opus 5.5 <[email protected]>
23 lines
829 B
C#
23 lines
829 B
C#
using UnityEditor;
|
||
|
||
// Resources/Sprites 的圖片一律匯入成單一 Sprite(程式以檔名載入:Resources.Load<Sprite>("Sprites/<檔名>"))
|
||
public class SpriteImport : AssetPostprocessor
|
||
{
|
||
void OnPreprocessTexture()
|
||
{
|
||
if (!assetPath.StartsWith("Assets/Resources/Sprites/")) return;
|
||
var ti = (TextureImporter)assetImporter;
|
||
ti.textureType = TextureImporterType.Sprite;
|
||
ti.spriteImportMode = SpriteImportMode.Single;
|
||
ti.spritePivot = new UnityEngine.Vector2(0.5f, 0.5f);
|
||
ti.mipmapEnabled = false;
|
||
ti.alphaIsTransparency = true;
|
||
}
|
||
|
||
[MenuItem("Build/Reimport Sprites")]
|
||
public static void Reimport()
|
||
{
|
||
AssetDatabase.ImportAsset("Assets/Resources/Sprites", ImportAssetOptions.ImportRecursive | ImportAssetOptions.ForceUpdate);
|
||
}
|
||
}
|