Rebuild the game as a single code-driven scene with a package-folder pack source
- 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]>
No files matched your search
@@ -1,14 +1,14 @@
|
||||
# Unity
|
||||
/Library/
|
||||
/Temp/
|
||||
/Build/
|
||||
/Logs/
|
||||
/UserSettings/
|
||||
/.utmp/
|
||||
/Luinchpad_BurstDebugInformation_DoNotShip/
|
||||
/Lunchpad_BackUpThisFolder_ButDontShipItWithYourGame/
|
||||
/Lunchpad_BurstDebugInformation_DoNotShip/
|
||||
/*_BurstDebugInformation_DoNotShip/
|
||||
/*_BackUpThisFolder_ButDontShipItWithYourGame/
|
||||
*.csproj
|
||||
*.sln
|
||||
*.slnx
|
||||
*.apk
|
||||
.vs/
|
||||
/Temp/
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 108c6e29ea6d54f4ea77d13d79174a85
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,39 +1,78 @@
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build.Profile;
|
||||
using UnityEditor.Build.Reporting;
|
||||
using UnityEditor.SceneManagement;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Rendering.Universal;
|
||||
|
||||
// 指令列打包:
|
||||
// Unity.exe -batchmode -quit -projectPath <path> -executeMethod BuildAndroid.Build -logFile build.log
|
||||
// 指令列打包(產出 Build/Rhyculator.apk,並複製一份到專案根目錄 Rhyculator.apk):
|
||||
// Unity.exe -batchmode -quit -projectPath <path> -buildTarget Android -executeMethod BuildAndroid.Build -logFile build.log
|
||||
// 加上 -development 打包 Development Build(可看 log、連 Profiler)
|
||||
public static class BuildAndroid
|
||||
{
|
||||
public const string OutputPath = "Build/Lunchpad.apk";
|
||||
public const string ScenePath = "Assets/Scenes/Main.unity";
|
||||
public const string OutputPath = "Build/Rhyculator.apk";
|
||||
public const string SideloadPath = "Rhyculator.apk";
|
||||
public const string ProfilePath = "Assets/Settings/Build Profiles/Android™.asset";
|
||||
|
||||
[MenuItem("Build/Android APK")]
|
||||
public static void Build()
|
||||
{
|
||||
// 使用專案的 Android Build Profile(場景清單與 Player Settings 都在裡面)
|
||||
var profile = AssetDatabase.LoadAssetAtPath<BuildProfile>(ProfilePath);
|
||||
BuildProfile.SetActiveBuildProfile(profile);
|
||||
EnsureScene();
|
||||
ApplyPlayerSettings();
|
||||
|
||||
// 注意:本地伺服器走 http,Profile 內的 insecureHttpOption 已設為 2 (AlwaysAllowed)
|
||||
// 正式上線改回 https 後,記得在 Build Profile 的 Player Settings 改回 Not Allowed
|
||||
|
||||
var report = BuildPipeline.BuildPlayer(new BuildPlayerWithProfileOptions
|
||||
bool dev = System.Environment.GetCommandLineArgs().Contains("-development");
|
||||
var report = BuildPipeline.BuildPlayer(new BuildPlayerOptions
|
||||
{
|
||||
buildProfile = profile,
|
||||
scenes = new[] { ScenePath },
|
||||
target = BuildTarget.Android,
|
||||
targetGroup = BuildTargetGroup.Android,
|
||||
locationPathName = OutputPath,
|
||||
options = BuildOptions.Development
|
||||
options = dev ? BuildOptions.Development : BuildOptions.None,
|
||||
});
|
||||
|
||||
// 另存一份到專案根目錄,方便直接複製到手機安裝
|
||||
if (report.summary.result == BuildResult.Succeeded)
|
||||
System.IO.File.Copy(OutputPath, SideloadPath, true);
|
||||
File.Copy(OutputPath, SideloadPath, true);
|
||||
|
||||
Debug.Log($"[BuildAndroid] {report.summary.result}, {report.summary.totalSize / 1024 / 1024} MB, errors={report.summary.totalErrors}");
|
||||
if (Application.isBatchMode)
|
||||
EditorApplication.Exit(report.summary.result == BuildResult.Succeeded ? 0 : 1);
|
||||
}
|
||||
|
||||
// 整個遊戲只有一個場景:一台清成黑色的攝影機,其他全部由 App 在執行時建立
|
||||
[MenuItem("Build/Create Main Scene")]
|
||||
public static void EnsureScene()
|
||||
{
|
||||
if (!File.Exists(ScenePath))
|
||||
{
|
||||
Directory.CreateDirectory(Path.GetDirectoryName(ScenePath));
|
||||
var scene = EditorSceneManager.NewScene(NewSceneSetup.EmptyScene, NewSceneMode.Single);
|
||||
var cam = new GameObject("Main Camera", typeof(Camera)).GetComponent<Camera>();
|
||||
cam.tag = "MainCamera";
|
||||
cam.clearFlags = CameraClearFlags.SolidColor;
|
||||
cam.backgroundColor = Color.black;
|
||||
cam.orthographic = true;
|
||||
cam.cullingMask = 0;
|
||||
cam.gameObject.AddComponent<UniversalAdditionalCameraData>();
|
||||
EditorSceneManager.SaveScene(scene, ScenePath);
|
||||
}
|
||||
EditorBuildSettings.scenes = new[] { new EditorBuildSettingsScene(ScenePath, true) };
|
||||
}
|
||||
|
||||
static void ApplyPlayerSettings()
|
||||
{
|
||||
PlayerSettings.productName = "Rhyculator";
|
||||
PlayerSettings.bundleVersion = "3.0.0";
|
||||
// 沿用舊的套件名,已安裝的玩家可以直接覆蓋更新(登入狀態、設定都保留)
|
||||
PlayerSettings.SetApplicationIdentifier(UnityEditor.Build.NamedBuildTarget.Android, "com.DefaultCompany.Lunchpad");
|
||||
PlayerSettings.SetScriptingBackend(UnityEditor.Build.NamedBuildTarget.Android, ScriptingImplementation.IL2CPP);
|
||||
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
|
||||
PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel25;
|
||||
PlayerSettings.defaultInterfaceOrientation = UIOrientation.Portrait;
|
||||
PlayerSettings.SetManagedStrippingLevel(UnityEditor.Build.NamedBuildTarget.Android, ManagedStrippingLevel.Low);
|
||||
PlayerSettings.stripEngineCode = true;
|
||||
// 本地伺服器走 http;正式上線(ServerConfig.UseLocal = false)只允許 https
|
||||
PlayerSettings.insecureHttpOption = ServerConfig.UseLocal ? InsecureHttpOption.AlwaysAllowed : InsecureHttpOption.NotAllowed;
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8b8c5e8571f756e47adfa9aec64a046b
|
||||
|
Before Width: | Height: | Size: 6.6 KiB |
@@ -1,169 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 824ef3d5923790644b3469b785244dca
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: 1847339304477120361
|
||||
second: Grid_black_0
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 4
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: Grid_black_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 360
|
||||
height: 360
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 967d9fe4f4113a910800000000000000
|
||||
internalID: 1847339304477120361
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable:
|
||||
Grid_black_0: 1847339304477120361
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Before Width: | Height: | Size: 7.9 KiB |
@@ -1,169 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e43e42cea4a993a47bd83815e84b9153
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: 4619537855308639785
|
||||
second: Grid_lgray_0
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 4
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: Grid_lgray_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 360
|
||||
height: 360
|
||||
alignment: 0
|
||||
pivot: {x: 0, y: 0}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 92e242c3435eb1040800000000000000
|
||||
internalID: 4619537855308639785
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable:
|
||||
Grid_lgray_0: 4619537855308639785
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
Before Width: | Height: | Size: 22 KiB |
@@ -1,351 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f73e24ad9a62db8418a79c1e797985fc
|
||||
TextureImporter:
|
||||
internalIDToNameTable:
|
||||
- first:
|
||||
213: -223534241043079789
|
||||
second: Rhyculator_0
|
||||
- first:
|
||||
213: 3158069515948486
|
||||
second: Rhyculator_1
|
||||
- first:
|
||||
213: -7553417374223139224
|
||||
second: Rhyculator_2
|
||||
- first:
|
||||
213: -4068945440974601891
|
||||
second: Rhyculator_3
|
||||
- first:
|
||||
213: -3707293423269078136
|
||||
second: Rhyculator_4
|
||||
- first:
|
||||
213: -3003161579679580399
|
||||
second: Rhyculator_5
|
||||
- first:
|
||||
213: 4433893549879244657
|
||||
second: Rhyculator_6
|
||||
- first:
|
||||
213: -8674613407056935608
|
||||
second: Rhyculator_7
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 0
|
||||
sRGBTexture: 1
|
||||
linearTexture: 0
|
||||
fadeOut: 0
|
||||
borderMipMap: 0
|
||||
mipMapsPreserveCoverage: 0
|
||||
alphaTestReferenceValue: 0.5
|
||||
mipMapFadeDistanceStart: 1
|
||||
mipMapFadeDistanceEnd: 3
|
||||
bumpmap:
|
||||
convertToNormalMap: 0
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
flipGreenChannel: 0
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
ignoreMipmapLimit: 0
|
||||
grayScaleToAlpha: 0
|
||||
generateCubemap: 6
|
||||
cubemapConvolution: 0
|
||||
seamlessCubemap: 0
|
||||
textureFormat: 1
|
||||
maxTextureSize: 2048
|
||||
textureSettings:
|
||||
serializedVersion: 2
|
||||
filterMode: 1
|
||||
aniso: 1
|
||||
mipBias: 0
|
||||
wrapU: 1
|
||||
wrapV: 1
|
||||
wrapW: 1
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
spritePivot: {x: 0.5, y: 0.5}
|
||||
spritePixelsToUnits: 100
|
||||
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
|
||||
spriteGenerateFallbackPhysicsShape: 1
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
flipbookColumns: 1
|
||||
maxTextureSizeSet: 0
|
||||
compressionQualitySet: 0
|
||||
textureFormatSet: 0
|
||||
ignorePngGamma: 0
|
||||
applyGammaDecoding: 0
|
||||
swizzle: 50462976
|
||||
cookieLightType: 0
|
||||
platformSettings:
|
||||
- serializedVersion: 4
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Standalone
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_0
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1080
|
||||
height: 720
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 39d9d77cac8d5ecf0800000000000000
|
||||
internalID: -223534241043079789
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_1
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 169
|
||||
y: 473
|
||||
width: 157
|
||||
height: 149
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 6c19cab5f383b0000800000000000000
|
||||
internalID: 3158069515948486
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_2
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 354
|
||||
y: 477
|
||||
width: 156
|
||||
height: 150
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 86e7a29faeedc2790800000000000000
|
||||
internalID: -7553417374223139224
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_3
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 527
|
||||
y: 473
|
||||
width: 129
|
||||
height: 154
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: d51834cfda33887c0800000000000000
|
||||
internalID: -4068945440974601891
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_4
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 673
|
||||
y: 477
|
||||
width: 156
|
||||
height: 242
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 88b97eb064c0d8cc0800000000000000
|
||||
internalID: -3707293423269078136
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_5
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 543
|
||||
y: 89
|
||||
width: 164
|
||||
height: 232
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 11ff8186470a256d0800000000000000
|
||||
internalID: -3003161579679580399
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_6
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 706
|
||||
y: 85
|
||||
width: 169
|
||||
height: 154
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 177b27c11ba588d30800000000000000
|
||||
internalID: 4433893549879244657
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
- serializedVersion: 2
|
||||
name: Rhyculator_7
|
||||
rect:
|
||||
serializedVersion: 2
|
||||
x: 895
|
||||
y: 85
|
||||
width: 170
|
||||
height: 246
|
||||
alignment: 0
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
customData:
|
||||
outline: []
|
||||
physicsShape: []
|
||||
tessellationDetail: -1
|
||||
bones: []
|
||||
spriteID: 845c78cf0159d9780800000000000000
|
||||
internalID: -8674613407056935608
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
outline: []
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID: 7364ccee3707594428e4655f02ef838e
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
spriteCustomMetadata:
|
||||
entries: []
|
||||
nameFileIdTable:
|
||||
Rhyculator_0: -223534241043079789
|
||||
Rhyculator_1: 3158069515948486
|
||||
Rhyculator_2: -7553417374223139224
|
||||
Rhyculator_3: -4068945440974601891
|
||||
Rhyculator_4: -3707293423269078136
|
||||
Rhyculator_5: -3003161579679580399
|
||||
Rhyculator_6: 4433893549879244657
|
||||
Rhyculator_7: -8674613407056935608
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,14 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2bcd2660ca9b64942af0de543d8d7100
|
||||
ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 8404be70184654265930450def6a9037, type: 3}
|
||||
generateWrapperCode: 0
|
||||
wrapperCodePath:
|
||||
wrapperClassName:
|
||||
wrapperCodeNamespace:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 907df91bf75a0af4b9eb4c075795cc9b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b4842e92e4e2e4d43a426e8257a40948
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -3,16 +3,21 @@
|
||||
自訂的 main manifest(Player Settings > Custom Main Manifest)
|
||||
內容以 Unity 產生的版本為基礎,多加了「開啟 / 分享 zip 給本 app」的 intent-filter,
|
||||
讓玩家能用檔案管理員或瀏覽器直接把曲包送進遊戲;
|
||||
activity 換成 RhyculatorActivity(繼承 UnityPlayerGameActivity),負責把收到的 zip 複製到收件匣
|
||||
activity 換成 RhyculatorActivity(繼承 UnityPlayerGameActivity),負責把收到的 zip 複製到曲包資料夾;
|
||||
儲存權限讓曲包資料夾可以放在手機根目錄的 Rhyculator/package(Android 11+ 為「所有檔案存取權」);
|
||||
rhyculator://pack/<code> 是曲包網站「在遊戲中下載」的連結
|
||||
-->
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools">
|
||||
<uses-permission android:name="android.permission.INTERNET" />
|
||||
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" tools:ignore="ScopedStorage" />
|
||||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="29" />
|
||||
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="32" />
|
||||
<uses-feature android:glEsVersion="0x00030000" />
|
||||
<uses-feature android:name="android.hardware.vulkan.version" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.touchscreen" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.touchscreen.multitouch" android:required="false" />
|
||||
<uses-feature android:name="android.hardware.touchscreen.multitouch.distinct" android:required="false" />
|
||||
<application android:appCategory="game" android:enableOnBackInvokedCallback="false" android:extractNativeLibs="true">
|
||||
<application android:appCategory="game" android:enableOnBackInvokedCallback="false" android:extractNativeLibs="true" android:requestLegacyExternalStorage="true">
|
||||
<meta-data android:name="unity.splash-mode" android:value="0" />
|
||||
<meta-data android:name="unity.splash-enable" android:value="True" />
|
||||
<meta-data android:name="unity.launch-fullscreen" android:value="True" />
|
||||
@@ -21,7 +26,7 @@
|
||||
<meta-data android:name="unity.auto-report-fully-drawn" android:value="true" />
|
||||
<meta-data android:name="unity.strip-engine-code" android:value="true" />
|
||||
<meta-data android:name="unity.auto-set-game-state" android:value="true" />
|
||||
<activity android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:enabled="true" android:exported="true" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.rhyculator.RhyculatorActivity" android:resizeableActivity="true" android:screenOrientation="fullUser" android:theme="@style/BaseUnityGameActivityTheme">
|
||||
<activity android:configChanges="mcc|mnc|locale|touchscreen|keyboard|keyboardHidden|navigation|orientation|screenLayout|uiMode|screenSize|smallestScreenSize|fontScale|layoutDirection|density" android:enabled="true" android:exported="true" android:hardwareAccelerated="false" android:launchMode="singleTask" android:name="com.rhyculator.RhyculatorActivity" android:resizeableActivity="true" android:screenOrientation="userPortrait" android:theme="@style/BaseUnityGameActivityTheme">
|
||||
<intent-filter>
|
||||
<category android:name="android.intent.category.LAUNCHER" />
|
||||
<action android:name="android.intent.action.MAIN" />
|
||||
@@ -45,6 +50,13 @@
|
||||
<data android:mimeType="application/x-zip-compressed" />
|
||||
<data android:mimeType="application/octet-stream" />
|
||||
</intent-filter>
|
||||
<!-- 曲包網站的「在遊戲中下載」 -->
|
||||
<intent-filter>
|
||||
<action android:name="android.intent.action.VIEW" />
|
||||
<category android:name="android.intent.category.DEFAULT" />
|
||||
<category android:name="android.intent.category.BROWSABLE" />
|
||||
<data android:scheme="rhyculator" android:host="pack" />
|
||||
</intent-filter>
|
||||
<meta-data android:name="unityplayer.UnityActivity" android:value="true" />
|
||||
<meta-data android:name="android.app.lib_name" android:value="game" />
|
||||
<meta-data android:name="WindowManagerPreference:FreeformWindowSize" android:value="@string/FreeformWindowSize_maximize" />
|
||||
|
||||
@@ -1,8 +1,17 @@
|
||||
package com.rhyculator;
|
||||
|
||||
import android.Manifest;
|
||||
import android.app.Activity;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.os.Build;
|
||||
import android.os.Bundle;
|
||||
import android.os.Environment;
|
||||
import android.provider.OpenableColumns;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.unity3d.player.UnityPlayerGameActivity;
|
||||
|
||||
@@ -11,11 +20,14 @@ import java.io.FileOutputStream;
|
||||
import java.io.InputStream;
|
||||
import java.io.OutputStream;
|
||||
|
||||
// 遊戲的 activity:收到「開啟 / 分享」進來的 zip 時,在背景執行緒複製到 app 的 files 資料夾(收件匣),
|
||||
// C# 端(PackImportWatcher)只要檢查收件匣就能匯入,不需要從 Unity 呼叫 Java
|
||||
// 遊戲的 activity:
|
||||
// - 收到「開啟 / 分享」進來的 zip:在背景執行緒複製到曲包資料夾(package/),C# 端掃描資料夾時就會讀到
|
||||
// - 曲包網站的連結 rhyculator://pack/<code>:把代碼寫到 app 資料夾的 pending-download.txt,C# 端負責下載
|
||||
// - 曲包資料夾的位置與權限(C# 的 PackStorage 呼叫這裡的 static 方法)
|
||||
public class RhyculatorActivity extends UnityPlayerGameActivity {
|
||||
// 與 C# 的 SongLibrary.ImportErrorFile 一致
|
||||
// 與 C# 的 PackStorage 一致
|
||||
static final String ERROR_FILE = "import-error.txt";
|
||||
static final String PENDING_DOWNLOAD_FILE = "pending-download.txt";
|
||||
|
||||
@Override
|
||||
protected void onCreate(Bundle savedInstanceState) {
|
||||
@@ -29,6 +41,39 @@ public class RhyculatorActivity extends UnityPlayerGameActivity {
|
||||
receive(intent);
|
||||
}
|
||||
|
||||
// ---------- 曲包資料夾 ----------
|
||||
|
||||
// 有「所有檔案存取權」(Android 11+)或儲存權限(Android 10 以下)時,曲包放在手機根目錄的 Rhyculator/package
|
||||
public static boolean hasStorageAccess(Context ctx) {
|
||||
if (Build.VERSION.SDK_INT >= 30) return Environment.isExternalStorageManager();
|
||||
return ctx.checkSelfPermission(Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED;
|
||||
}
|
||||
|
||||
public static void requestStorageAccess(Activity activity) {
|
||||
if (Build.VERSION.SDK_INT >= 30) {
|
||||
try {
|
||||
Intent i = new Intent(Settings.ACTION_MANAGE_APP_ALL_FILES_ACCESS_PERMISSION,
|
||||
Uri.parse("package:" + activity.getPackageName()));
|
||||
activity.startActivity(i);
|
||||
} catch (Exception e) {
|
||||
activity.startActivity(new Intent(Settings.ACTION_MANAGE_ALL_FILES_ACCESS_PERMISSION));
|
||||
}
|
||||
} else {
|
||||
activity.requestPermissions(new String[]{Manifest.permission.WRITE_EXTERNAL_STORAGE}, 1);
|
||||
}
|
||||
}
|
||||
|
||||
static File packageDir(Context ctx) {
|
||||
File root = hasStorageAccess(ctx)
|
||||
? new File(Environment.getExternalStorageDirectory(), "Rhyculator")
|
||||
: ctx.getExternalFilesDir(null);
|
||||
File dir = new File(root, "package");
|
||||
dir.mkdirs();
|
||||
return dir;
|
||||
}
|
||||
|
||||
// ---------- 收到的 intent ----------
|
||||
|
||||
private void receive(Intent intent) {
|
||||
if (intent == null) return;
|
||||
Uri uri = null;
|
||||
@@ -39,20 +84,42 @@ public class RhyculatorActivity extends UnityPlayerGameActivity {
|
||||
}
|
||||
if (uri == null) return;
|
||||
|
||||
// 標記為已處理,避免 activity 重建時又匯入一次
|
||||
// 標記為已處理,避免 activity 重建時又處理一次
|
||||
intent.setAction(Intent.ACTION_MAIN);
|
||||
intent.setData(null);
|
||||
intent.removeExtra(Intent.EXTRA_STREAM);
|
||||
|
||||
final File appDir = getExternalFilesDir(null);
|
||||
if (appDir == null) return;
|
||||
|
||||
if ("rhyculator".equals(uri.getScheme())) {
|
||||
// rhyculator://pack/<code>
|
||||
String code = uri.getLastPathSegment();
|
||||
if (code != null) writeText(new File(appDir, PENDING_DOWNLOAD_FILE), code);
|
||||
return;
|
||||
}
|
||||
|
||||
final Uri source = uri;
|
||||
final File dir = getExternalFilesDir(null);
|
||||
if (dir == null) return;
|
||||
new Thread(() -> copy(source, dir), "PackReceive").start();
|
||||
final File dir = packageDir(this);
|
||||
final String name = displayName(uri);
|
||||
new Thread(() -> copy(source, dir, name, appDir), "PackReceive").start();
|
||||
}
|
||||
|
||||
private void copy(Uri uri, File dir) {
|
||||
String name = "import-" + System.currentTimeMillis();
|
||||
File part = new File(dir, name + ".part");
|
||||
private String displayName(Uri uri) {
|
||||
String name = null;
|
||||
try (Cursor c = getContentResolver().query(uri, new String[]{OpenableColumns.DISPLAY_NAME}, null, null, null)) {
|
||||
if (c != null && c.moveToFirst()) name = c.getString(0);
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
if (name == null) name = uri.getLastPathSegment();
|
||||
if (name == null) name = "pack";
|
||||
name = name.replaceAll("[\\\\/:*?\"<>|]", "_");
|
||||
if (name.toLowerCase().endsWith(".zip")) name = name.substring(0, name.length() - 4);
|
||||
return name.isEmpty() ? "pack" : name;
|
||||
}
|
||||
|
||||
private void copy(Uri uri, File dir, String name, File appDir) {
|
||||
File part = new File(dir, "." + name + "-" + System.currentTimeMillis() + ".part");
|
||||
try (InputStream in = getContentResolver().openInputStream(uri);
|
||||
OutputStream out = new FileOutputStream(part)) {
|
||||
if (in == null) throw new Exception("無法開啟 " + uri);
|
||||
@@ -61,19 +128,21 @@ public class RhyculatorActivity extends UnityPlayerGameActivity {
|
||||
while ((n = in.read(buf)) > 0) out.write(buf, 0, n);
|
||||
} catch (Exception e) {
|
||||
part.delete();
|
||||
writeError(dir, e.toString());
|
||||
writeText(new File(appDir, ERROR_FILE), e.toString());
|
||||
return;
|
||||
}
|
||||
// 寫完才改名成 .zip,C# 不會讀到寫一半的檔案
|
||||
if (!part.renameTo(new File(dir, name + ".zip"))) {
|
||||
// 寫完才改名成 .zip,C# 不會讀到寫一半的檔案;同名時加上 (2)、(3)…
|
||||
File target = new File(dir, name + ".zip");
|
||||
for (int i = 2; target.exists(); i++) target = new File(dir, name + " (" + i + ").zip");
|
||||
if (!part.renameTo(target)) {
|
||||
part.delete();
|
||||
writeError(dir, "無法儲存檔案");
|
||||
writeText(new File(appDir, ERROR_FILE), "無法儲存檔案");
|
||||
}
|
||||
}
|
||||
|
||||
private static void writeError(File dir, String message) {
|
||||
try (OutputStream out = new FileOutputStream(new File(dir, ERROR_FILE))) {
|
||||
out.write(message.getBytes("UTF-8"));
|
||||
private static void writeText(File file, String text) {
|
||||
try (OutputStream out = new FileOutputStream(file)) {
|
||||
out.write(text.getBytes("UTF-8"));
|
||||
} catch (Exception ignored) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,91 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &6929059385884637366
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8981396772839112451}
|
||||
- component: {fileID: 2329249021651780560}
|
||||
- component: {fileID: 3325753727345968004}
|
||||
- component: {fileID: 4734467639709616990}
|
||||
m_Layer: 4
|
||||
m_Name: GridDisplay_cell
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8981396772839112451
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6929059385884637366}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 150, y: 150}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &2329249021651780560
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6929059385884637366}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &3325753727345968004
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6929059385884637366}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 0}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &4734467639709616990
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6929059385884637366}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d019d349bdba3bd4da6179077b905f3d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::GridDisplay_cell
|
||||
image: {fileID: 3325753727345968004}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b37705496636fdc4f8cce03eaf85b87e
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,98 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &4402007107776277397
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9128983536730687087}
|
||||
- component: {fileID: 5096784082476651039}
|
||||
- component: {fileID: 538415730173305727}
|
||||
- component: {fileID: -7873575381358420159}
|
||||
m_Layer: 5
|
||||
m_Name: Grid_cell
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9128983536730687087
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4402007107776277397}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5096784082476651039
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4402007107776277397}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &538415730173305727
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4402007107776277397}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: -5360011561144203789, guid: 1a583a07ab3221648a22a86ea2d83ede, type: 3}
|
||||
m_Type: 0
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &-7873575381358420159
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4402007107776277397}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a576b5bf68358b645bc2d0793ba0dfb0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::GridColor
|
||||
cellImage: {fileID: 0}
|
||||
defaultSprite: {fileID: -5360011561144203789, guid: 1a583a07ab3221648a22a86ea2d83ede, type: 3}
|
||||
whiteSprite: {fileID: 1430946849159234051, guid: 55aa41c225d5ce94c965a2b72cce210f, type: 3}
|
||||
blueSprite: {fileID: -8591009396098641633, guid: 5f3ee2d4daba2f04c85966833d1c3931, type: 3}
|
||||
orangeSprite: {fileID: 9014057951283639122, guid: e69bc5fe2b6895c4c8bdb43821ded67c, type: 3}
|
||||
redSprite: {fileID: 8340061429579452774, guid: ffc80dadca1705c44a32dbf9485758d8, type: 3}
|
||||
greenSprite: {fileID: 8726304385414162451, guid: 76dd2bfe9d707994e8bf3863272b9940, type: 3}
|
||||
flashDuration: 0.3
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6130fd9473fd8324a87e6c3ce00c27c3
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,91 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &7824453328613019926
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1783891999010961816}
|
||||
- component: {fileID: 732320220946238382}
|
||||
- component: {fileID: 8268815823909597847}
|
||||
- component: {fileID: 5685259866679701683}
|
||||
m_Layer: 5
|
||||
m_Name: HoldHint_cell
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1783891999010961816
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824453328613019926}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 540, y: 595}
|
||||
m_SizeDelta: {x: 300, y: 300}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &732320220946238382
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824453328613019926}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &8268815823909597847
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824453328613019926}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Image
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Sprite: {fileID: 232588453944898340, guid: c9b23776eaf79f04cbfbac8fa3378d5c, type: 3}
|
||||
m_Type: 3
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 2
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &5685259866679701683
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7824453328613019926}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 1c186d43719e3604eb17df884c7aa488, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::HoldProgressUI
|
||||
radialImage: {fileID: 8268815823909597847}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d235dc0e60211a940a595668e0620eca
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,95 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2753918722221379680
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4236898687858882165}
|
||||
- component: {fileID: 1051734479364742604}
|
||||
- component: {fileID: 1288824484019456349}
|
||||
- component: {fileID: 7028774529006298737}
|
||||
m_Layer: 5
|
||||
m_Name: UID
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4236898687858882165
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2753918722221379680}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 250, y: 24}
|
||||
m_SizeDelta: {x: 400, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &1051734479364742604
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2753918722221379680}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1288824484019456349
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2753918722221379680}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Text
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.30588236, g: 0.30588236, b: 0.30588236, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 32
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 0
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 6
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: 'UID: 0x00000000'
|
||||
--- !u!114 &7028774529006298737
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2753918722221379680}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: d37d15764a6dd8d419c9acb03ea61106, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: Assembly-CSharp::ShowUID
|
||||
displayText: {fileID: 1288824484019456349}
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 38d9e0a110160f84d98ff4c0cda3dd64
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,81 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &728995496487590804
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9220641938897914870}
|
||||
- component: {fileID: 7827452860862519516}
|
||||
- component: {fileID: 1013158182034330675}
|
||||
m_Layer: 5
|
||||
m_Name: Version
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &9220641938897914870
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 728995496487590804}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -250, y: 24}
|
||||
m_SizeDelta: {x: 400, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7827452860862519516
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 728995496487590804}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1013158182034330675
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 728995496487590804}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier: UnityEngine.UI::UnityEngine.UI.Text
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.30588236, g: 0.30588236, b: 0.30588236, a: 1}
|
||||
m_RaycastTarget: 1
|
||||
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_Maskable: 1
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_FontData:
|
||||
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
|
||||
m_FontSize: 32
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 0
|
||||
m_MinSize: 3
|
||||
m_MaxSize: 40
|
||||
m_Alignment: 8
|
||||
m_AlignByGeometry: 0
|
||||
m_RichText: 1
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: 'version: Alpha 2.3.1'
|
||||
@@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9f55d92aa98bee546be67a3871770dc2
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 403e1acd0db81d84fb0da85c93098440
|
||||
guid: f14b90ee893ea174f982d25ad9a4e1d1
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8942c38635040384e8c9f590af21e194
|
||||
guid: f38f6f840ba5893498d399f5a1b3212f
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 8
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d0603b6d5186471b96c778c3949c7ce2
|
||||
guid: 37284d613bf95fb45898d72ed79a99c6
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 5.2 KiB After Width: | Height: | Size: 5.2 KiB |
|
Before Width: | Height: | Size: 4.9 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 5.4 KiB After Width: | Height: | Size: 5.4 KiB |
|
Before Width: | Height: | Size: 7.4 KiB After Width: | Height: | Size: 7.4 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 7.2 KiB After Width: | Height: | Size: 7.2 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -109,6 +109,19 @@ TextureImporter:
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
@@ -138,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -151,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 7.6 KiB After Width: | Height: | Size: 7.6 KiB |
|
Before Width: | Height: | Size: 8.2 KiB After Width: | Height: | Size: 8.2 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -109,6 +109,19 @@ TextureImporter:
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
@@ -138,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
|
Before Width: | Height: | Size: 9.0 KiB After Width: | Height: | Size: 9.0 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 8.1 KiB After Width: | Height: | Size: 8.1 KiB |
@@ -46,7 +46,7 @@ TextureImporter:
|
||||
nPOTScale: 0
|
||||
lightmap: 0
|
||||
compressionQuality: 50
|
||||
spriteMode: 2
|
||||
spriteMode: 1
|
||||
spriteExtrude: 1
|
||||
spriteMeshType: 1
|
||||
alignment: 0
|
||||
@@ -109,6 +109,19 @@ TextureImporter:
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 4
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
ignorePlatformSupport: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites:
|
||||
@@ -138,7 +151,7 @@ TextureImporter:
|
||||
customData:
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
spriteID: 5e97eb03825dee720800000000000000
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: d574b2fb4661c408f80aa76c0182931f
|
||||
guid: 1ffccffeae6210643b994e2b61cc1319
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -13,7 +13,7 @@ OcclusionCullingSettings:
|
||||
--- !u!104 &2
|
||||
RenderSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 9
|
||||
serializedVersion: 10
|
||||
m_Fog: 0
|
||||
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
|
||||
m_FogMode: 3
|
||||
@@ -38,13 +38,12 @@ RenderSettings:
|
||||
m_ReflectionIntensity: 1
|
||||
m_CustomReflection: {fileID: 0}
|
||||
m_Sun: {fileID: 0}
|
||||
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_UseRadianceAmbientProbe: 0
|
||||
--- !u!157 &3
|
||||
LightmapSettings:
|
||||
m_ObjectHideFlags: 0
|
||||
serializedVersion: 12
|
||||
m_GIWorkflowMode: 1
|
||||
serializedVersion: 13
|
||||
m_BakeOnSceneLoad: 0
|
||||
m_GISettings:
|
||||
serializedVersion: 2
|
||||
m_BounceScale: 1
|
||||
@@ -67,44 +66,41 @@ LightmapSettings:
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_LightmapsBakeMode: 1
|
||||
m_TextureCompression: 1
|
||||
m_FinalGather: 0
|
||||
m_FinalGatherFiltering: 1
|
||||
m_FinalGatherRayCount: 256
|
||||
m_ReflectionCompression: 2
|
||||
m_MixedBakeMode: 2
|
||||
m_BakeBackend: 0
|
||||
m_BakeBackend: 1
|
||||
m_PVRSampling: 1
|
||||
m_PVRDirectSampleCount: 32
|
||||
m_PVRSampleCount: 500
|
||||
m_PVRSampleCount: 512
|
||||
m_PVRBounces: 2
|
||||
m_PVREnvironmentSampleCount: 500
|
||||
m_PVREnvironmentSampleCount: 256
|
||||
m_PVREnvironmentReferencePointCount: 2048
|
||||
m_PVRFilteringMode: 2
|
||||
m_PVRDenoiserTypeDirect: 0
|
||||
m_PVRDenoiserTypeIndirect: 0
|
||||
m_PVRDenoiserTypeAO: 0
|
||||
m_PVRFilteringMode: 1
|
||||
m_PVRDenoiserTypeDirect: 1
|
||||
m_PVRDenoiserTypeIndirect: 1
|
||||
m_PVRDenoiserTypeAO: 1
|
||||
m_PVRFilterTypeDirect: 0
|
||||
m_PVRFilterTypeIndirect: 0
|
||||
m_PVRFilterTypeAO: 0
|
||||
m_PVREnvironmentMIS: 0
|
||||
m_PVREnvironmentMIS: 1
|
||||
m_PVRCulling: 1
|
||||
m_PVRFilteringGaussRadiusDirect: 1
|
||||
m_PVRFilteringGaussRadiusIndirect: 5
|
||||
m_PVRFilteringGaussRadiusAO: 2
|
||||
m_PVRFilteringGaussRadiusIndirect: 1
|
||||
m_PVRFilteringGaussRadiusAO: 1
|
||||
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
|
||||
m_PVRFilteringAtrousPositionSigmaIndirect: 2
|
||||
m_PVRFilteringAtrousPositionSigmaAO: 1
|
||||
m_ExportTrainingData: 0
|
||||
m_TrainingDataDestination: TrainingData
|
||||
m_LightProbeSampleCountMultiplier: 4
|
||||
m_LightingDataAsset: {fileID: 0}
|
||||
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_LightingSettings: {fileID: 0}
|
||||
--- !u!196 &4
|
||||
NavMeshSettings:
|
||||
serializedVersion: 2
|
||||
m_ObjectHideFlags: 0
|
||||
m_BuildSettings:
|
||||
serializedVersion: 2
|
||||
serializedVersion: 3
|
||||
agentTypeID: 0
|
||||
agentRadius: 0.5
|
||||
agentHeight: 2
|
||||
@@ -117,13 +113,13 @@ NavMeshSettings:
|
||||
cellSize: 0.16666667
|
||||
manualTileSize: 0
|
||||
tileSize: 256
|
||||
accuratePlacement: 0
|
||||
buildHeightMesh: 0
|
||||
maxJobWorkers: 0
|
||||
preserveTilesOutsideBounds: 0
|
||||
debug:
|
||||
m_Flags: 0
|
||||
m_NavMeshData: {fileID: 0}
|
||||
--- !u!1 &519420028
|
||||
--- !u!1 &1233910606
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
@@ -131,10 +127,9 @@ GameObject:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 519420032}
|
||||
- component: {fileID: 519420031}
|
||||
- component: {fileID: 519420029}
|
||||
- component: {fileID: 519420030}
|
||||
- component: {fileID: 1233910609}
|
||||
- component: {fileID: 1233910608}
|
||||
- component: {fileID: 1233910607}
|
||||
m_Layer: 0
|
||||
m_Name: Main Camera
|
||||
m_TagString: MainCamera
|
||||
@@ -142,26 +137,18 @@ GameObject:
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!81 &519420029
|
||||
AudioListener:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_Enabled: 1
|
||||
--- !u!114 &519420030
|
||||
--- !u!114 &1233910607
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_GameObject: {fileID: 1233910606}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EditorClassIdentifier: Unity.RenderPipelines.Universal.Runtime::UnityEngine.Rendering.Universal.UniversalAdditionalCameraData
|
||||
m_RenderShadows: 1
|
||||
m_RequiresDepthTextureOption: 2
|
||||
m_RequiresOpaqueTextureOption: 2
|
||||
@@ -172,6 +159,7 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
m_Bits: 1
|
||||
m_VolumeTrigger: {fileID: 0}
|
||||
m_VolumeFrameworkUpdateModeOption: 2
|
||||
m_RenderPostProcessing: 0
|
||||
m_Antialiasing: 0
|
||||
m_AntialiasingQuality: 2
|
||||
@@ -179,26 +167,45 @@ MonoBehaviour:
|
||||
m_Dithering: 0
|
||||
m_ClearDepth: 1
|
||||
m_AllowXRRendering: 1
|
||||
m_AllowHDROutput: 1
|
||||
m_UseScreenCoordOverride: 0
|
||||
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
|
||||
m_RequiresDepthTexture: 0
|
||||
m_RequiresColorTexture: 0
|
||||
m_TaaSettings:
|
||||
m_Quality: 3
|
||||
m_FrameInfluence: 0.1
|
||||
m_JitterScale: 1
|
||||
m_MipBias: 0
|
||||
m_VarianceClampScale: 0.9
|
||||
m_ContrastAdaptiveSharpening: 0
|
||||
m_Version: 2
|
||||
--- !u!20 &519420031
|
||||
--- !u!20 &1233910608
|
||||
Camera:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_GameObject: {fileID: 1233910606}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 2
|
||||
m_ClearFlags: 2
|
||||
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
|
||||
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_projectionMatrixMode: 1
|
||||
m_GateFitMode: 2
|
||||
m_FOVAxisMode: 0
|
||||
m_Iso: 200
|
||||
m_ShutterSpeed: 0.005
|
||||
m_Aperture: 16
|
||||
m_FocusDistance: 10
|
||||
m_FocalLength: 50
|
||||
m_BladeCount: 5
|
||||
m_Curvature: {x: 2, y: 11}
|
||||
m_BarrelClipping: 0.25
|
||||
m_Anamorphism: 0
|
||||
m_SensorSize: {x: 36, y: 24}
|
||||
m_LensShift: {x: 0, y: 0}
|
||||
m_FocalLength: 50
|
||||
m_NormalizedViewPortRect:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
@@ -207,144 +214,41 @@ Camera:
|
||||
height: 1
|
||||
near clip plane: 0.3
|
||||
far clip plane: 1000
|
||||
field of view: 34
|
||||
field of view: 60
|
||||
orthographic: 1
|
||||
orthographic size: 5
|
||||
m_Depth: -1
|
||||
m_Depth: 0
|
||||
m_CullingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_Bits: 0
|
||||
m_RenderingPath: -1
|
||||
m_TargetTexture: {fileID: 0}
|
||||
m_TargetDisplay: 0
|
||||
m_TargetEye: 0
|
||||
m_TargetEye: 3
|
||||
m_HDR: 1
|
||||
m_AllowMSAA: 0
|
||||
m_AllowMSAA: 1
|
||||
m_AllowDynamicResolution: 0
|
||||
m_ForceIntoRT: 0
|
||||
m_OcclusionCulling: 0
|
||||
m_OcclusionCulling: 1
|
||||
m_StereoConvergence: 10
|
||||
m_StereoSeparation: 0.022
|
||||
--- !u!4 &519420032
|
||||
--- !u!4 &1233910609
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 519420028}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -10}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1 &619394800
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 619394802}
|
||||
- component: {fileID: 619394801}
|
||||
m_Layer: 0
|
||||
m_Name: Global Light 2D
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!114 &619394801
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 619394800}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_ComponentVersion: 1
|
||||
m_LightType: 4
|
||||
m_BlendStyleIndex: 0
|
||||
m_FalloffIntensity: 0.5
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Intensity: 1
|
||||
m_LightVolumeIntensity: 1
|
||||
m_LightVolumeIntensityEnabled: 0
|
||||
m_ApplyToSortingLayers: 00000000
|
||||
m_LightCookieSprite: {fileID: 0}
|
||||
m_DeprecatedPointLightCookieSprite: {fileID: 0}
|
||||
m_LightOrder: 0
|
||||
m_OverlapOperation: 0
|
||||
m_NormalMapDistance: 3
|
||||
m_NormalMapQuality: 2
|
||||
m_UseNormalMap: 0
|
||||
m_ShadowIntensityEnabled: 0
|
||||
m_ShadowIntensity: 0.75
|
||||
m_ShadowVolumeIntensityEnabled: 0
|
||||
m_ShadowVolumeIntensity: 0.75
|
||||
m_Vertices:
|
||||
- position: {x: 0.9985302, y: 0.9985302, z: 0}
|
||||
color: {r: 0.70710677, g: 0.70710677, b: 0, a: 0}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: 0.9985302, y: 0.9985302, z: 0}
|
||||
color: {r: 0, g: 0, b: 0, a: 1}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: -0.9985302, y: 0.9985302, z: 0}
|
||||
color: {r: -0.70710677, g: 0.70710677, b: 0, a: 0}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: -0.9985302, y: 0.9985302, z: 0}
|
||||
color: {r: 0, g: 0, b: 0, a: 1}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: -0.99853003, y: -0.9985304, z: 0}
|
||||
color: {r: -0.70710665, g: -0.7071069, b: 0, a: 0}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: -0.99853003, y: -0.9985304, z: 0}
|
||||
color: {r: 0, g: 0, b: 0, a: 1}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: 0.99853003, y: -0.9985304, z: 0}
|
||||
color: {r: 0.70710665, g: -0.7071069, b: 0, a: 0}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: 0.99853003, y: -0.9985304, z: 0}
|
||||
color: {r: 0, g: 0, b: 0, a: 1}
|
||||
uv: {x: 0, y: 0}
|
||||
- position: {x: 0, y: 0, z: 0}
|
||||
color: {r: 0, g: 0, b: 0, a: 1}
|
||||
uv: {x: 0, y: 0}
|
||||
m_Triangles: 030001000800020000000100030002000100050003000800040002000300050004000300070005000800060004000500070006000500010007000800000006000700010000000700
|
||||
m_LocalBounds:
|
||||
m_Center: {x: 0, y: -0.00000011920929, z: 0}
|
||||
m_Extent: {x: 0.9985302, y: 0.99853027, z: 0}
|
||||
m_PointLightInnerAngle: 360
|
||||
m_PointLightOuterAngle: 360
|
||||
m_PointLightInnerRadius: 0
|
||||
m_PointLightOuterRadius: 1
|
||||
m_ShapeLightParametricSides: 5
|
||||
m_ShapeLightParametricAngleOffset: 0
|
||||
m_ShapeLightParametricRadius: 1
|
||||
m_ShapeLightFalloffSize: 0.5
|
||||
m_ShapeLightFalloffOffset: {x: 0, y: 0}
|
||||
m_ShapePath:
|
||||
- {x: -0.5, y: -0.5, z: 0}
|
||||
- {x: 0.5, y: -0.5, z: 0}
|
||||
- {x: 0.5, y: 0.5, z: 0}
|
||||
- {x: -0.5, y: 0.5, z: 0}
|
||||
--- !u!4 &619394802
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 619394800}
|
||||
m_GameObject: {fileID: 1233910606}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1660057539 &9223372036854775807
|
||||
SceneRoots:
|
||||
m_ObjectHideFlags: 0
|
||||
m_Roots:
|
||||
- {fileID: 1233910609}
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 953c990c99d3f6d4590f828cab832947
|
||||
guid: 540b57d1c013b024bb0f4411f3a7c8fb
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -1,94 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System;
|
||||
|
||||
public class AccountDisplay : MonoBehaviour
|
||||
{
|
||||
[Header("UI 元件")]
|
||||
public Text UIDText;
|
||||
public Text NameText;
|
||||
public Text TypeText;
|
||||
public Text CreateTimeText;
|
||||
public Text EmailText;
|
||||
public Text EmailVerifiedText;
|
||||
public Text PhoneText;
|
||||
public Text PhoneVerifiedText;
|
||||
|
||||
void Start()
|
||||
{
|
||||
ShowAccountInfo();
|
||||
}
|
||||
public void ShowAccountInfo()
|
||||
{
|
||||
int uid = PlayerPrefs.GetInt("UID", 0);
|
||||
string name = PlayerPrefs.GetString("Name", "");
|
||||
string type = PlayerPrefs.GetString("Type", "");
|
||||
string createTime = PlayerPrefs.GetString("CreateTime", "");
|
||||
string email = PlayerPrefs.GetString("Email", "");
|
||||
bool emailVerified = PlayerPrefs.GetInt("EmailVerified", 0) == 1;
|
||||
string phone = PlayerPrefs.GetString("Phone", "");
|
||||
bool phoneVerified = PlayerPrefs.GetInt("PhoneVerified", 0) == 1;
|
||||
string uidHex;
|
||||
|
||||
if (uid != 0 && !string.IsNullOrEmpty(type))
|
||||
{
|
||||
char typeChar = type switch
|
||||
{
|
||||
"R" => '0',
|
||||
"A" => 'a',
|
||||
"B" => 'b',
|
||||
"D" => 'f',
|
||||
_ => '?'
|
||||
};
|
||||
|
||||
string uidHexPart = uid.ToString("X8");
|
||||
|
||||
uidHex = $"{typeChar}x{uidHexPart}";
|
||||
}
|
||||
else
|
||||
{
|
||||
uidHex = "0x00000000";
|
||||
}
|
||||
|
||||
string typeDisplay = type;
|
||||
switch (typeDisplay)
|
||||
{
|
||||
case "R": typeDisplay = "玩家"; break;
|
||||
case "A": typeDisplay = "Alpha 測試"; break;
|
||||
case "B": typeDisplay = "Beta 測試"; break;
|
||||
case "D": typeDisplay = "開發者"; break;
|
||||
}
|
||||
|
||||
// Email
|
||||
string emailDisplay = "";
|
||||
if (!string.IsNullOrEmpty(email) && email.Contains("@"))
|
||||
{
|
||||
int atIndex = email.IndexOf('@');
|
||||
string prefix = email.Substring(0, Math.Min(2, atIndex));
|
||||
string domain = email.Substring(atIndex);
|
||||
emailDisplay = prefix + "*****" + domain;
|
||||
}
|
||||
|
||||
// Phone
|
||||
string phoneDisplay = "";
|
||||
if (!string.IsNullOrEmpty(phone) && phone.Length >= 3)
|
||||
{
|
||||
string last3 = phone.Substring(phone.Length - 3);
|
||||
phoneDisplay = new string('*', phone.Length - 3) + last3;
|
||||
}
|
||||
|
||||
// Verified
|
||||
string emailVerText = emailVerified ? "已驗證" : "未驗證";
|
||||
string phoneVerText = phoneVerified ? "已驗證" : "未驗證";
|
||||
|
||||
// UI
|
||||
UIDText.text = "使用者號碼: " + uidHex;
|
||||
NameText.text = "顯示名稱: " + name;
|
||||
TypeText.text = "帳號類型: " + typeDisplay;
|
||||
CreateTimeText.text = "創建日期: " + createTime;
|
||||
EmailText.text = "電子信箱: " + emailDisplay;
|
||||
EmailVerifiedText.text = "狀態: " + emailVerText;
|
||||
PhoneText.text = "電話號碼: " + phoneDisplay;
|
||||
PhoneVerifiedText.text = "狀態: " + phoneVerText;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ac1f6dff7e49008498c23e6e0acffedc
|
||||
@@ -1,227 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.InputSystem.EnhancedTouch;
|
||||
using Touch = UnityEngine.InputSystem.EnhancedTouch.Touch;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
// 設定頁:音訊延遲校正
|
||||
// 播放節拍聲,玩家只聽聲音跟著點擊;取偏差中位數存成 AudioOffsetMs
|
||||
public class CalibrationController : MonoBehaviour
|
||||
{
|
||||
private const string SceneName = "SettingScene";
|
||||
private const double Bpm = 100;
|
||||
private const int BeatCount = 16;
|
||||
private const int WarmupBeats = 4;
|
||||
private const double LeadIn = 1.0;
|
||||
|
||||
private double Interval => 60.0 / Bpm;
|
||||
|
||||
private Font font;
|
||||
private Text offsetText;
|
||||
private Text statusText;
|
||||
private Text beatText;
|
||||
private Button startButton;
|
||||
|
||||
private AudioSource audioSource;
|
||||
private AudioClip clickTrack;
|
||||
private bool running;
|
||||
private readonly List<double> deltas = new List<double>();
|
||||
private readonly HashSet<int> ignoredTouches = new HashSet<int>();
|
||||
|
||||
// 進入設定頁時自動加入(不需改動場景)
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.AfterSceneLoad)]
|
||||
static void Register()
|
||||
{
|
||||
SceneManager.sceneLoaded += (scene, mode) =>
|
||||
{
|
||||
if (scene.name == SceneName)
|
||||
new GameObject("CalibrationController").AddComponent<CalibrationController>();
|
||||
};
|
||||
}
|
||||
|
||||
void Start()
|
||||
{
|
||||
// 沿用場景字型,並隱藏原本的佔位文字
|
||||
foreach (var t in FindObjectsByType<Text>(FindObjectsSortMode.None))
|
||||
{
|
||||
if (font == null) font = t.font;
|
||||
if (t.text.Trim() == "Empty") t.gameObject.SetActive(false);
|
||||
}
|
||||
|
||||
EnhancedTouchSupport.Enable();
|
||||
audioSource = gameObject.AddComponent<AudioSource>();
|
||||
clickTrack = BuildClickTrack();
|
||||
BuildUI();
|
||||
RefreshOffset();
|
||||
}
|
||||
|
||||
void OnDestroy()
|
||||
{
|
||||
if (running) SongClock.Stop();
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!running) return;
|
||||
|
||||
double now = SongClock.Now;
|
||||
int beat = (int)System.Math.Floor((now - LeadIn) / Interval) + 1;
|
||||
beatText.text = beat <= 0 ? "準備…" : $"{Mathf.Min(beat, BeatCount)} / {BeatCount}";
|
||||
|
||||
PollTaps(now);
|
||||
|
||||
if (now > LeadIn + (BeatCount - 0.5) * Interval + 0.3)
|
||||
Finish();
|
||||
}
|
||||
|
||||
void PollTaps(double now)
|
||||
{
|
||||
double real = Time.realtimeSinceStartupAsDouble;
|
||||
foreach (var t in Touch.activeTouches)
|
||||
{
|
||||
if (t.phase != UnityEngine.InputSystem.TouchPhase.Began) continue;
|
||||
if (ignoredTouches.Contains(t.touchId)) continue;
|
||||
|
||||
double age = System.Math.Min(0.1, System.Math.Max(0, real - t.startTime));
|
||||
if (CalibrationMath.TryBeatDelta(now - age, LeadIn, Interval, BeatCount, WarmupBeats, out double d))
|
||||
deltas.Add(d);
|
||||
}
|
||||
}
|
||||
|
||||
void StartCalibration()
|
||||
{
|
||||
deltas.Clear();
|
||||
ignoredTouches.Clear();
|
||||
// 開始前已按著的手指(按下「開始」的那一下)不計入
|
||||
foreach (var t in Touch.activeTouches)
|
||||
ignoredTouches.Add(t.touchId);
|
||||
|
||||
double dspStart = AudioSettings.dspTime + 0.2;
|
||||
audioSource.clip = clickTrack;
|
||||
audioSource.PlayScheduled(dspStart);
|
||||
SongClock.Begin(dspStart, applyOffset: false);
|
||||
|
||||
running = true;
|
||||
startButton.interactable = false;
|
||||
statusText.text = "閉上眼睛,跟著聲音點擊螢幕任意處";
|
||||
}
|
||||
|
||||
void Finish()
|
||||
{
|
||||
running = false;
|
||||
SongClock.Stop();
|
||||
audioSource.Stop();
|
||||
startButton.interactable = true;
|
||||
beatText.text = "";
|
||||
|
||||
int needed = (BeatCount - WarmupBeats) / 2;
|
||||
if (deltas.Count < needed)
|
||||
{
|
||||
statusText.text = $"有效點擊太少({deltas.Count} 次),請再試一次";
|
||||
return;
|
||||
}
|
||||
|
||||
int ms = (int)System.Math.Round(CalibrationMath.Median(deltas) * 1000);
|
||||
SetOffset(ms);
|
||||
statusText.text = $"已套用:{deltas.Count} 次有效點擊,中位數 {ms:+0;-0;0} ms";
|
||||
}
|
||||
|
||||
void SetOffset(int ms)
|
||||
{
|
||||
PlayerPrefs.SetInt(SongClock.OffsetPrefKey, Mathf.Clamp(ms, -500, 500));
|
||||
PlayerPrefs.Save();
|
||||
RefreshOffset();
|
||||
}
|
||||
|
||||
void RefreshOffset()
|
||||
{
|
||||
int ms = PlayerPrefs.GetInt(SongClock.OffsetPrefKey, 0);
|
||||
offsetText.text = $"目前延遲補償:{ms:+0;-0;0} ms";
|
||||
}
|
||||
|
||||
// 產生整段節拍聲(每四拍第一拍較高音)
|
||||
AudioClip BuildClickTrack()
|
||||
{
|
||||
int rate = AudioSettings.outputSampleRate;
|
||||
double length = LeadIn + BeatCount * Interval + 0.5;
|
||||
var data = new float[(int)(rate * length)];
|
||||
int clickLen = (int)(rate * 0.04);
|
||||
|
||||
for (int b = 0; b < BeatCount; b++)
|
||||
{
|
||||
int start = (int)((LeadIn + b * Interval) * rate);
|
||||
double freq = b % 4 == 0 ? 1760 : 1320;
|
||||
for (int i = 0; i < clickLen && start + i < data.Length; i++)
|
||||
{
|
||||
double env = System.Math.Exp(-i / (rate * 0.008));
|
||||
data[start + i] = (float)(System.Math.Sin(2 * System.Math.PI * freq * i / rate) * env * 0.8);
|
||||
}
|
||||
}
|
||||
|
||||
var clip = AudioClip.Create("CalibrationClicks", data.Length, 1, rate, false);
|
||||
clip.SetData(data, 0);
|
||||
return clip;
|
||||
}
|
||||
|
||||
// ---------- UI ----------
|
||||
|
||||
void BuildUI()
|
||||
{
|
||||
Canvas canvas = FindAnyObjectByType<Canvas>();
|
||||
Transform parent = canvas.transform;
|
||||
|
||||
AddText(parent, "延遲校正", 72, Color.white, 520);
|
||||
AddText(parent, "戴上平常玩的耳機,按「開始」後\n只聽聲音、跟著節拍點擊螢幕\n前 4 拍為暖身不計分", 40, new Color(0.8f, 0.8f, 0.8f), 340);
|
||||
offsetText = AddText(parent, "", 52, new Color(1f, 0.42f, 0.8f), 160);
|
||||
beatText = AddText(parent, "", 96, Color.white, 0);
|
||||
statusText = AddText(parent, "", 38, new Color(0.8f, 0.8f, 0.8f), -140);
|
||||
|
||||
startButton = AddButton(parent, "開始", new Vector2(0, -300), new Vector2(420, 120), StartCalibration);
|
||||
AddButton(parent, "-5 ms", new Vector2(-300, -460), new Vector2(240, 100), () => SetOffset(PlayerPrefs.GetInt(SongClock.OffsetPrefKey, 0) - 5));
|
||||
AddButton(parent, "重設", new Vector2(0, -460), new Vector2(240, 100), () => SetOffset(0));
|
||||
AddButton(parent, "+5 ms", new Vector2(300, -460), new Vector2(240, 100), () => SetOffset(PlayerPrefs.GetInt(SongClock.OffsetPrefKey, 0) + 5));
|
||||
AddText(parent, "正值 = 聲音比畫面晚(藍牙耳機通常為正)", 32, new Color(0.55f, 0.55f, 0.55f), -580);
|
||||
|
||||
AddText(parent, $"匯入曲包:用檔案管理員或瀏覽器開啟 .zip → 選擇 Rhyculator\n目前已匯入 {SongLibrary.Songs.Count} 首",
|
||||
30, new Color(0.55f, 0.55f, 0.55f), -760);
|
||||
}
|
||||
|
||||
Text AddText(Transform parent, string content, int size, Color color, float y)
|
||||
{
|
||||
var go = new GameObject("CalibText", typeof(RectTransform));
|
||||
go.transform.SetParent(parent, false);
|
||||
var text = go.AddComponent<Text>();
|
||||
text.font = font;
|
||||
text.text = content;
|
||||
text.fontSize = size;
|
||||
text.color = color;
|
||||
text.alignment = TextAnchor.MiddleCenter;
|
||||
text.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
text.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
text.raycastTarget = false;
|
||||
var rt = text.rectTransform;
|
||||
rt.anchorMin = rt.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
rt.sizeDelta = new Vector2(1000, size * 1.5f);
|
||||
rt.anchoredPosition = new Vector2(0, y);
|
||||
return text;
|
||||
}
|
||||
|
||||
Button AddButton(Transform parent, string label, Vector2 pos, Vector2 size, UnityEngine.Events.UnityAction onClick)
|
||||
{
|
||||
var go = new GameObject("CalibButton", typeof(RectTransform));
|
||||
go.transform.SetParent(parent, false);
|
||||
var img = go.AddComponent<Image>();
|
||||
img.color = new Color(0.33f, 0.33f, 0.33f);
|
||||
var btn = go.AddComponent<Button>();
|
||||
btn.onClick.AddListener(onClick);
|
||||
var rt = img.rectTransform;
|
||||
rt.anchorMin = rt.anchorMax = new Vector2(0.5f, 0.5f);
|
||||
rt.sizeDelta = size;
|
||||
rt.anchoredPosition = pos;
|
||||
|
||||
var text = AddText(go.transform, label, 44, Color.white, 0);
|
||||
text.rectTransform.sizeDelta = size;
|
||||
return btn;
|
||||
}
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
// 啟動時的全域設定
|
||||
public static class GameBoot
|
||||
{
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
static void Init()
|
||||
{
|
||||
// 幀率上限 = 螢幕支援的最高更新率(120Hz 手機就跑 120)
|
||||
// 注意:Android 上 targetFrameRate = -1 代表平台預設 30fps,不是無限制;
|
||||
// 超過螢幕更新率的幀也看不到,只會增加耗電與發熱
|
||||
QualitySettings.vSyncCount = 0;
|
||||
Application.targetFrameRate = Mathf.Max(60, MaxRefreshRate());
|
||||
}
|
||||
|
||||
static int MaxRefreshRate()
|
||||
{
|
||||
double max = Screen.currentResolution.refreshRateRatio.value;
|
||||
foreach (var r in Screen.resolutions)
|
||||
if (r.refreshRateRatio.value > max) max = r.refreshRateRatio.value;
|
||||
return Mathf.RoundToInt((float)max);
|
||||
}
|
||||
}
|
||||
@@ -1,53 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class GridColor : MonoBehaviour
|
||||
{
|
||||
public Image cellImage;
|
||||
public Sprite defaultSprite;
|
||||
public Sprite whiteSprite;
|
||||
public Sprite blueSprite;
|
||||
public Sprite orangeSprite;
|
||||
public Sprite redSprite;
|
||||
public Sprite greenSprite;
|
||||
public int cellX;
|
||||
public int cellY;
|
||||
public float flashDuration = 0.3f;
|
||||
|
||||
private float flashEnd;
|
||||
private bool colored; // 目前顯示的是判定色(優先於按住時的白色)
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (cellImage == null) cellImage = GetComponent<Image>();
|
||||
if (defaultSprite == null) defaultSprite = cellImage.sprite;
|
||||
enabled = false; // 沒有閃爍時不跑 Update
|
||||
}
|
||||
|
||||
// 按住提示:不覆蓋判定色
|
||||
public void FlashWhite()
|
||||
{
|
||||
if (enabled && colored) return;
|
||||
Flash(whiteSprite, false);
|
||||
}
|
||||
|
||||
public void FlashBlue() => Flash(blueSprite, true);
|
||||
public void FlashOrange() => Flash(orangeSprite, true);
|
||||
public void FlashRed() => Flash(redSprite, true);
|
||||
public void FlashGreen() => Flash(greenSprite, true);
|
||||
|
||||
private void Flash(Sprite sprite, bool isColor)
|
||||
{
|
||||
cellImage.sprite = sprite;
|
||||
colored = isColor;
|
||||
flashEnd = Time.time + flashDuration;
|
||||
enabled = true;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (Time.time < flashEnd) return;
|
||||
cellImage.sprite = defaultSprite;
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a576b5bf68358b645bc2d0793ba0dfb0
|
||||
@@ -1,138 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
// 單一格子的顯示:靜態圖示(選單)或音符
|
||||
// 音符動畫完全由 SongClock 決定,保證在 hitTime 時縮放剛好為 1
|
||||
public class GridDisplay : MonoBehaviour
|
||||
{
|
||||
public Image image;
|
||||
|
||||
// 音符在判定點前多久出現(秒)
|
||||
public const double AppearLead = 0.5;
|
||||
// 出現時的圓形填滿動畫長度
|
||||
private const double FillDuration = 0.2;
|
||||
// 判定點前後的縮放區間:0.5 → 1 → 1.5
|
||||
private const double GrowHalf = 0.2;
|
||||
|
||||
public int cellX;
|
||||
public int cellY;
|
||||
|
||||
// 音符超過判定時間仍未被按 → 通知(Miss)
|
||||
public System.Action<GridDisplay, string> OnExpired;
|
||||
|
||||
private RectTransform rt;
|
||||
private Vector2 basePos;
|
||||
private Image.Type baseType;
|
||||
|
||||
private bool active = false;
|
||||
private string currentNote = "None";
|
||||
private int currentSec = 0;
|
||||
private double hitTime;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (image == null)
|
||||
image = GetComponent<Image>();
|
||||
rt = GetComponent<RectTransform>();
|
||||
baseType = image.type;
|
||||
enabled = false; // 沒有音符時不跑 Update
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!active) return;
|
||||
|
||||
double t = SongClock.Now - hitTime;
|
||||
if (t > NoteJudge.BadWindow)
|
||||
{
|
||||
string note = currentNote;
|
||||
Clear();
|
||||
OnExpired?.Invoke(this, note);
|
||||
return;
|
||||
}
|
||||
UpdateVisual(t);
|
||||
}
|
||||
|
||||
public void ShowNote(Sprite sprite, string note, int sec, double noteHitTime)
|
||||
{
|
||||
// 同格還有未處理的音符:視為 Miss,避免音符無聲消失造成統計少算
|
||||
if (active)
|
||||
{
|
||||
string old = currentNote;
|
||||
Clear();
|
||||
OnExpired?.Invoke(this, old);
|
||||
}
|
||||
|
||||
basePos = rt.anchoredPosition;
|
||||
currentNote = note;
|
||||
currentSec = sec;
|
||||
hitTime = noteHitTime;
|
||||
active = true;
|
||||
enabled = true;
|
||||
|
||||
image.sprite = sprite;
|
||||
image.enabled = true;
|
||||
image.type = Image.Type.Filled;
|
||||
image.fillMethod = Image.FillMethod.Radial360;
|
||||
image.fillOrigin = 2;
|
||||
image.fillClockwise = true;
|
||||
|
||||
UpdateVisual(SongClock.Now - hitTime);
|
||||
}
|
||||
|
||||
// t = 目前時間 - 判定時間
|
||||
private void UpdateVisual(double t)
|
||||
{
|
||||
double sinceAppear = t + AppearLead;
|
||||
float fill = (float)System.Math.Min(1.0, System.Math.Max(0.0, sinceAppear / FillDuration));
|
||||
float scale = t < -GrowHalf ? 0.5f : (float)(1.0 + t / (2 * GrowHalf));
|
||||
float alpha = scale > 1f ? Mathf.Clamp01(1f - (scale - 1f) / 0.5f) : 1f;
|
||||
|
||||
image.fillAmount = fill;
|
||||
SetAlpha(alpha);
|
||||
|
||||
Vector2 size = rt.sizeDelta;
|
||||
rt.localScale = Vector3.one * scale;
|
||||
rt.anchoredPosition = basePos + (1f - scale) * size / 2f;
|
||||
}
|
||||
|
||||
public void SetImage(Sprite sprite)
|
||||
{
|
||||
if (active) Clear();
|
||||
image.sprite = sprite;
|
||||
image.enabled = (sprite != null);
|
||||
SetAlpha(1f);
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
if (active)
|
||||
{
|
||||
rt.localScale = Vector3.one;
|
||||
rt.anchoredPosition = basePos;
|
||||
image.type = baseType;
|
||||
image.fillAmount = 1f;
|
||||
active = false;
|
||||
enabled = false;
|
||||
}
|
||||
SetAlpha(1f);
|
||||
currentSec = 0;
|
||||
currentNote = "None";
|
||||
image.sprite = null;
|
||||
image.enabled = false;
|
||||
}
|
||||
|
||||
public void SetAlpha(float a)
|
||||
{
|
||||
if (image == null) return;
|
||||
|
||||
Color c = image.color;
|
||||
c.a = a;
|
||||
image.color = c;
|
||||
}
|
||||
|
||||
public bool HasNote() => active;
|
||||
public string GetNote() => currentNote;
|
||||
public int GetSec() => currentSec;
|
||||
public double GetHitTime() => hitTime;
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class GridDisplaySpawner : MonoBehaviour
|
||||
{
|
||||
public GameObject displayPrefab;
|
||||
public int rows = 6;
|
||||
public int columns = 5;
|
||||
public Sprite imgNoteTap;
|
||||
public Sprite imgNoteHold;
|
||||
public Sprite imgNoteSlide;
|
||||
public GridDisplay[,] displayCells;
|
||||
|
||||
// 音符過期未被按(x, y, 音符種類)
|
||||
public event System.Action<int, int, string> NoteExpired;
|
||||
|
||||
[Header("Base Layout Settings")]
|
||||
public float baseWidth = 1080f;
|
||||
public float cellBase = 180f;
|
||||
public float spaceBase = 20f;
|
||||
public float heightBase = 90f;
|
||||
|
||||
// 格子上的文字(例如選歌頁的難度數字)
|
||||
private readonly Dictionary<(int, int), Text> labels = new Dictionary<(int, int), Text>();
|
||||
private float cellSize;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
float scale = Screen.width / baseWidth;
|
||||
|
||||
cellSize = cellBase * scale;
|
||||
float spacing = spaceBase * scale;
|
||||
float heightOffset = heightBase * scale;
|
||||
|
||||
displayCells = new GridDisplay[columns, rows];
|
||||
|
||||
RectTransform rt = GetComponent<RectTransform>();
|
||||
if (rt == null) rt = gameObject.AddComponent<RectTransform>();
|
||||
|
||||
rt.anchorMin = new Vector2(0.5f, 0f);
|
||||
rt.anchorMax = new Vector2(0.5f, 0f);
|
||||
rt.pivot = new Vector2(0.5f, 0f);
|
||||
|
||||
float totalWidth = columns * cellSize + (columns - 1) * spacing;
|
||||
float startX = -totalWidth / 2f;
|
||||
float startY = heightOffset;
|
||||
|
||||
for (int i = 0; i < rows * columns; i++)
|
||||
{
|
||||
GameObject obj = Instantiate(displayPrefab, transform);
|
||||
|
||||
int x = i % columns;
|
||||
int y = i / columns;
|
||||
|
||||
RectTransform cellRT = obj.GetComponent<RectTransform>();
|
||||
cellRT.anchorMin = new Vector2(0f, 0f);
|
||||
cellRT.anchorMax = new Vector2(0f, 0f);
|
||||
cellRT.pivot = new Vector2(0f, 0f);
|
||||
|
||||
cellRT.sizeDelta = new Vector2(cellSize, cellSize);
|
||||
|
||||
float posX = startX + x * (cellSize + spacing);
|
||||
float posY = startY + y * (cellSize + spacing);
|
||||
cellRT.anchoredPosition = new Vector2(posX, posY);
|
||||
|
||||
GridDisplay cell = obj.GetComponent<GridDisplay>();
|
||||
cell.cellX = x;
|
||||
cell.cellY = y;
|
||||
cell.OnExpired = (c, note) => NoteExpired?.Invoke(c.cellX, c.cellY, note);
|
||||
displayCells[x, y] = cell;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetImage(int x, int y, Sprite image)
|
||||
{
|
||||
if (!InBound(x, y)) return;
|
||||
displayCells[x, y].SetImage(image);
|
||||
}
|
||||
|
||||
public void Clear(int x, int y)
|
||||
{
|
||||
if (!InBound(x, y)) return;
|
||||
displayCells[x, y].Clear();
|
||||
RemoveLabel((x, y));
|
||||
}
|
||||
|
||||
// 在格子上顯示文字;text 為 null 或空字串時移除
|
||||
public void SetLabel(int x, int y, string text, Color color, float fontScale = 0.55f)
|
||||
{
|
||||
if (!InBound(x, y)) return;
|
||||
var key = (x, y);
|
||||
if (string.IsNullOrEmpty(text))
|
||||
{
|
||||
RemoveLabel(key);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!labels.TryGetValue(key, out var label) || label == null)
|
||||
{
|
||||
var go = new GameObject("Label", typeof(RectTransform));
|
||||
go.transform.SetParent(displayCells[x, y].transform, false);
|
||||
label = go.AddComponent<Text>();
|
||||
label.font = Resources.GetBuiltinResource<Font>("LegacyRuntime.ttf");
|
||||
label.fontStyle = FontStyle.Bold;
|
||||
label.alignment = TextAnchor.MiddleCenter;
|
||||
label.horizontalOverflow = HorizontalWrapMode.Overflow;
|
||||
label.verticalOverflow = VerticalWrapMode.Overflow;
|
||||
label.raycastTarget = false;
|
||||
var rt = label.rectTransform;
|
||||
rt.anchorMin = Vector2.zero;
|
||||
rt.anchorMax = Vector2.one;
|
||||
rt.offsetMin = rt.offsetMax = Vector2.zero;
|
||||
labels[key] = label;
|
||||
}
|
||||
label.text = text;
|
||||
label.color = color;
|
||||
label.fontSize = Mathf.Max(1, Mathf.RoundToInt(cellSize * fontScale));
|
||||
}
|
||||
|
||||
private void RemoveLabel((int, int) key)
|
||||
{
|
||||
if (labels.TryGetValue(key, out var label) && label != null) Destroy(label.gameObject);
|
||||
labels.Remove(key);
|
||||
}
|
||||
|
||||
public void PlayNoteTap(int x, int y, double hitTime)
|
||||
{
|
||||
if (!InBound(x, y)) return;
|
||||
displayCells[x, y].ShowNote(imgNoteTap, "Tap", 0, hitTime);
|
||||
}
|
||||
|
||||
public void PlayNoteHold(int x, int y, int durationMs, double hitTime)
|
||||
{
|
||||
if (!InBound(x, y)) return;
|
||||
displayCells[x, y].ShowNote(imgNoteHold, "Hold", durationMs, hitTime);
|
||||
}
|
||||
|
||||
public void PlayNoteSlide(int x, int y, double hitTime)
|
||||
{
|
||||
if (!InBound(x, y)) return;
|
||||
displayCells[x, y].ShowNote(imgNoteSlide, "Slide", 0, hitTime);
|
||||
}
|
||||
|
||||
public bool HasNote(int x, int y)
|
||||
{
|
||||
return InBound(x, y) && displayCells[x, y].HasNote();
|
||||
}
|
||||
|
||||
public double GetHitTime(int x, int y)
|
||||
{
|
||||
if (!InBound(x, y)) return 0;
|
||||
return displayCells[x, y].GetHitTime();
|
||||
}
|
||||
|
||||
public string GetCurrentNote(int x, int y)
|
||||
{
|
||||
if (!InBound(x, y)) return "None";
|
||||
return displayCells[x, y].GetNote();
|
||||
}
|
||||
|
||||
public int GetCurrentSec(int x, int y)
|
||||
{
|
||||
if (!InBound(x, y)) return 0;
|
||||
return displayCells[x, y].GetSec();
|
||||
}
|
||||
|
||||
private bool InBound(int x, int y)
|
||||
{
|
||||
return x >= 0 && y >= 0 && x < columns && y < rows;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef37c6cacf7f78545a4093fdcb5c4826
|
||||
@@ -1,95 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
public class GridSpawner : MonoBehaviour
|
||||
{
|
||||
public GameObject cellPrefab;
|
||||
public int rows = 6;
|
||||
public int columns = 5;
|
||||
|
||||
public GridColor[,] gridCells;
|
||||
|
||||
// 用於由螢幕座標直接算出格子
|
||||
private RectTransform container;
|
||||
private Camera canvasCamera;
|
||||
private Vector2 origin; // 格子 (0,0) 左下角,在 container 本地座標
|
||||
private float cellSize;
|
||||
private float step; // 格子大小 + 間距
|
||||
|
||||
void Start()
|
||||
{
|
||||
float baseWidth = 1080f;
|
||||
float cellBase = 180f;
|
||||
float spaceBase = 20f;
|
||||
float heightBase = 90f;
|
||||
|
||||
float scale = Screen.width / baseWidth;
|
||||
|
||||
cellSize = cellBase * scale;
|
||||
float spacing = spaceBase * scale;
|
||||
float heightOffset = heightBase * scale;
|
||||
|
||||
gridCells = new GridColor[columns, rows];
|
||||
|
||||
RectTransform rt = GetComponent<RectTransform>();
|
||||
if (rt == null) rt = gameObject.AddComponent<RectTransform>();
|
||||
container = rt;
|
||||
step = cellSize + spacing;
|
||||
|
||||
Canvas canvas = GetComponentInParent<Canvas>();
|
||||
if (canvas != null && canvas.rootCanvas.renderMode != RenderMode.ScreenSpaceOverlay)
|
||||
canvasCamera = canvas.rootCanvas.worldCamera;
|
||||
|
||||
rt.anchorMin = new Vector2(0.5f, 0f);
|
||||
rt.anchorMax = new Vector2(0.5f, 0f);
|
||||
rt.pivot = new Vector2(0.5f, 0f);
|
||||
|
||||
float totalWidth = columns * cellSize + (columns - 1) * spacing;
|
||||
float startX = -totalWidth / 2f;
|
||||
float startY = heightOffset;
|
||||
|
||||
for (int i = 0; i < rows * columns; i++)
|
||||
{
|
||||
GameObject cellObj = Instantiate(cellPrefab, transform);
|
||||
|
||||
int x = i % columns;
|
||||
int y = i / columns;
|
||||
|
||||
RectTransform cellRT = cellObj.GetComponent<RectTransform>();
|
||||
cellRT.anchorMin = new Vector2(0f, 0f);
|
||||
cellRT.anchorMax = new Vector2(0f, 0f);
|
||||
cellRT.pivot = new Vector2(0f, 0f);
|
||||
cellRT.sizeDelta = new Vector2(cellSize, cellSize);
|
||||
|
||||
float posX = startX + x * (cellSize + spacing);
|
||||
float posY = startY + y * (cellSize + spacing);
|
||||
cellRT.anchoredPosition = new Vector2(posX, posY);
|
||||
|
||||
GridColor cellColor = cellObj.GetComponent<GridColor>();
|
||||
cellColor.cellX = x;
|
||||
cellColor.cellY = y;
|
||||
|
||||
gridCells[x, y] = cellColor;
|
||||
}
|
||||
|
||||
origin = gridCells[0, 0].transform.localPosition;
|
||||
}
|
||||
|
||||
// 螢幕座標 → 格子座標;在格子外(含間距)回傳 false,x/y = -1
|
||||
public bool CellAt(Vector2 screenPos, out int x, out int y)
|
||||
{
|
||||
x = y = -1;
|
||||
if (gridCells == null) return false;
|
||||
if (!RectTransformUtility.ScreenPointToLocalPointInRectangle(container, screenPos, canvasCamera, out Vector2 local))
|
||||
return false;
|
||||
|
||||
Vector2 p = local - origin;
|
||||
int cx = Mathf.FloorToInt(p.x / step);
|
||||
int cy = Mathf.FloorToInt(p.y / step);
|
||||
if (cx < 0 || cy < 0 || cx >= columns || cy >= rows) return false;
|
||||
if (p.x - cx * step > cellSize || p.y - cy * step > cellSize) return false;
|
||||
|
||||
x = cx;
|
||||
y = cy;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1,2 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1ebf2c7c1d748884d99b72572feb9ffe
|
||||
@@ -1,59 +0,0 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using System.Collections;
|
||||
|
||||
public class HoldProgress : MonoBehaviour
|
||||
{
|
||||
public Image radialImage;
|
||||
private Coroutine progressCoroutine;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
if (radialImage != null)
|
||||
{
|
||||
radialImage.fillAmount = 0f;
|
||||
radialImage.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
// 開始
|
||||
public void StartProgress(float seconds)
|
||||
{
|
||||
if (radialImage == null || seconds <= 0f) return;
|
||||
|
||||
if (progressCoroutine != null)
|
||||
StopCoroutine(progressCoroutine);
|
||||
|
||||
radialImage.gameObject.SetActive(true);
|
||||
progressCoroutine = StartCoroutine(ProgressCoroutine(seconds));
|
||||
}
|
||||
|
||||
// 中斷
|
||||
public void StopProgress()
|
||||
{
|
||||
if (progressCoroutine != null)
|
||||
{
|
||||
StopCoroutine(progressCoroutine);
|
||||
progressCoroutine = null;
|
||||
}
|
||||
if (radialImage != null)
|
||||
{
|
||||
radialImage.fillAmount = 0f;
|
||||
radialImage.gameObject.SetActive(false);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerator ProgressCoroutine(float seconds)
|
||||
{
|
||||
float elapsed = 0f;
|
||||
while (elapsed < seconds)
|
||||
{
|
||||
elapsed += Time.deltaTime;
|
||||
radialImage.fillAmount = 1f - Mathf.Clamp01(elapsed / seconds);
|
||||
yield return null;
|
||||
}
|
||||
radialImage.fillAmount = 0f;
|
||||
radialImage.gameObject.SetActive(false);
|
||||
progressCoroutine = null;
|
||||
}
|
||||
}
|
||||