├── .gitignore ├── .vscode └── settings.json ├── Assets ├── Fonts.meta ├── Fonts │ ├── EXO-BLACK.TTF │ ├── EXO-BLACK.TTF.meta │ ├── EXO-BOLD.TTF │ ├── EXO-BOLD.TTF.meta │ ├── EXO-EXTRABOLD.TTF │ ├── EXO-EXTRABOLD.TTF.meta │ ├── EXO-EXTRALIGHT.TTF │ ├── EXO-EXTRALIGHT.TTF.meta │ ├── EXO-LIGHT.TTF │ ├── EXO-LIGHT.TTF.meta │ ├── EXO-MEDIUM.TTF │ ├── EXO-MEDIUM.TTF.meta │ ├── EXO-REGULAR.TTF │ ├── EXO-REGULAR.TTF.meta │ ├── EXO-SEMIBOLD.TTF │ └── EXO-SEMIBOLD.TTF.meta ├── Packages.meta ├── Packages │ ├── Jint.meta │ ├── Jint │ │ ├── Jint.dll │ │ └── Jint.dll.meta │ ├── StandaloneFileBrowser.meta │ └── StandaloneFileBrowser │ │ ├── IStandaloneFileBrowser.cs │ │ ├── IStandaloneFileBrowser.cs.meta │ │ ├── Plugins.meta │ │ ├── Plugins │ │ ├── Linux.meta │ │ ├── Linux │ │ │ ├── x86_64.meta │ │ │ └── x86_64 │ │ │ │ ├── libStandaloneFileBrowser.so │ │ │ │ └── libStandaloneFileBrowser.so.meta │ │ ├── Ookii.Dialogs.dll │ │ ├── Ookii.Dialogs.dll.meta │ │ ├── StandaloneFileBrowser.bundle.meta │ │ ├── StandaloneFileBrowser.bundle │ │ │ ├── Contents.meta │ │ │ └── Contents │ │ │ │ ├── Info.plist │ │ │ │ ├── Info.plist.meta │ │ │ │ ├── MacOS.meta │ │ │ │ └── MacOS │ │ │ │ ├── StandaloneFileBrowser │ │ │ │ └── StandaloneFileBrowser.meta │ │ ├── StandaloneFileBrowser.jslib │ │ ├── StandaloneFileBrowser.jslib.meta │ │ ├── System.Windows.Forms.dll │ │ └── System.Windows.Forms.dll.meta │ │ ├── StandaloneFileBrowser.cs │ │ ├── StandaloneFileBrowser.cs.meta │ │ ├── StandaloneFileBrowserEditor.cs │ │ ├── StandaloneFileBrowserEditor.cs.meta │ │ ├── StandaloneFileBrowserLinux.cs │ │ ├── StandaloneFileBrowserLinux.cs.meta │ │ ├── StandaloneFileBrowserMac.cs │ │ ├── StandaloneFileBrowserMac.cs.meta │ │ ├── StandaloneFileBrowserWindows.cs │ │ └── StandaloneFileBrowserWindows.cs.meta ├── Prefabs.meta ├── Prefabs │ ├── DrawableHitCircle.prefab │ ├── DrawableHitCircle.prefab.meta │ ├── DrawableSlider.prefab │ ├── DrawableSlider.prefab.meta │ ├── Handle.prefab │ ├── Handle.prefab.meta │ ├── OptionBool.prefab │ ├── OptionBool.prefab.meta │ ├── OptionChoice.prefab │ ├── OptionChoice.prefab.meta │ ├── OptionNumber.prefab │ ├── OptionNumber.prefab.meta │ ├── OptionVector2.prefab │ ├── OptionVector2.prefab.meta │ ├── ToolbarButton.prefab │ └── ToolbarButton.prefab.meta ├── Resources.meta ├── Resources │ ├── framework.txt │ └── framework.txt.meta ├── Scenes.meta ├── Scenes │ ├── Screen.unity │ └── Screen.unity.meta ├── Scripts.meta ├── Scripts │ ├── Bindables.meta │ ├── Bindables │ │ ├── Bindable.cs │ │ ├── Bindable.cs.meta │ │ ├── BindableList.cs │ │ └── BindableList.cs.meta │ ├── Constants.cs │ ├── Constants.cs.meta │ ├── Editor.meta │ ├── Editor │ │ ├── ApplicationBuilder.cs │ │ └── ApplicationBuilder.cs.meta │ ├── HitObjects.meta │ ├── HitObjects │ │ ├── BezierApproximator.cs │ │ ├── BezierApproximator.cs.meta │ │ ├── CatmullApproximator.cs │ │ ├── CatmullApproximator.cs.meta │ │ ├── CircularArcApproximator.cs │ │ ├── CircularArcApproximator.cs.meta │ │ ├── CurveType.cs │ │ ├── CurveType.cs.meta │ │ ├── Drawable.meta │ │ ├── Drawable │ │ │ ├── Components.meta │ │ │ ├── Components │ │ │ │ ├── Circle.cs │ │ │ │ ├── Circle.cs.meta │ │ │ │ ├── Helpers.meta │ │ │ │ ├── Helpers │ │ │ │ │ ├── CircleDrawer.cs │ │ │ │ │ ├── CircleDrawer.cs.meta │ │ │ │ │ ├── LineDrawer.cs │ │ │ │ │ ├── LineDrawer.cs.meta │ │ │ │ │ ├── MeshHelper.cs │ │ │ │ │ └── MeshHelper.cs.meta │ │ │ │ ├── SliderBody.cs │ │ │ │ ├── SliderBody.cs.meta │ │ │ │ ├── SliderTicks.cs │ │ │ │ └── SliderTicks.cs.meta │ │ │ ├── DrawableHitCircle.cs │ │ │ ├── DrawableHitCircle.cs.meta │ │ │ ├── DrawableHitObject.cs │ │ │ ├── DrawableHitObject.cs.meta │ │ │ ├── DrawableSlider.cs │ │ │ └── DrawableSlider.cs.meta │ │ ├── HitCircle.cs │ │ ├── HitCircle.cs.meta │ │ ├── HitObject.cs │ │ ├── HitObject.cs.meta │ │ ├── Slider.cs │ │ └── Slider.cs.meta │ ├── Options.cs │ ├── Options.cs.meta │ ├── OsuMath.meta │ ├── OsuMath │ │ ├── Precision.cs │ │ ├── Precision.cs.meta │ │ ├── VectorMath.cs │ │ └── VectorMath.cs.meta │ ├── Playground.cs │ ├── Playground.cs.meta │ ├── Scripting.meta │ ├── Scripting │ │ ├── ScriptManager.cs │ │ ├── ScriptManager.cs.meta │ │ ├── ScriptUtilities.cs │ │ └── ScriptUtilities.cs.meta │ ├── UI.meta │ └── UI │ │ ├── Border.cs │ │ ├── Border.cs.meta │ │ ├── Handles.meta │ │ ├── Handles │ │ ├── Handle.cs │ │ ├── Handle.cs.meta │ │ ├── HandleManager.cs │ │ └── HandleManager.cs.meta │ │ ├── OptionObjects.meta │ │ ├── OptionObjects │ │ ├── Option.cs │ │ ├── Option.cs.meta │ │ ├── OptionBool.cs │ │ ├── OptionBool.cs.meta │ │ ├── OptionChoice.cs │ │ ├── OptionChoice.cs.meta │ │ ├── OptionNumber.cs │ │ ├── OptionNumber.cs.meta │ │ ├── OptionVector2.cs │ │ └── OptionVector2.cs.meta │ │ ├── PanelManager.cs │ │ ├── PanelManager.cs.meta │ │ ├── Panels.meta │ │ ├── Panels │ │ ├── ErrorPanel.cs │ │ ├── ErrorPanel.cs.meta │ │ ├── OptionsPanel.cs │ │ ├── OptionsPanel.cs.meta │ │ ├── Panel.cs │ │ ├── Panel.cs.meta │ │ ├── PlayfieldPanel.cs │ │ ├── PlayfieldPanel.cs.meta │ │ ├── ToolbarPanel.cs │ │ └── ToolbarPanel.cs.meta │ │ ├── Playfield.cs │ │ └── Playfield.cs.meta ├── Sprites.meta └── Sprites │ ├── icon.png │ ├── icon.png.meta │ ├── x.png │ └── x.png.meta ├── LICENSE ├── Logs └── Packages-Update.log ├── Packages └── manifest.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset ├── README.md └── build.bat /.gitignore: -------------------------------------------------------------------------------- 1 | /[Ll]ibrary/ 2 | /[Tt]emp/ 3 | /[Oo]bj/ 4 | /[Bb]uild/ 5 | /[Bb]uilds/ 6 | /Assets/AssetStoreTools* 7 | 8 | # Visual Studio cache directory 9 | .vs/ 10 | 11 | # Autogenerated VS/MD/Consulo solution and project files 12 | ExportedObj/ 13 | .consulo/ 14 | *.csproj 15 | *.unityproj 16 | *.sln 17 | *.suo 18 | *.tmp 19 | *.user 20 | *.userprefs 21 | *.pidb 22 | *.booproj 23 | *.svd 24 | *.pdb 25 | *.opendb 26 | 27 | # Unity3D generated meta files 28 | *.pidb.meta 29 | *.pdb.meta 30 | 31 | # Unity3D Generated File On Crash Reports 32 | sysinfo.txt 33 | 34 | # Builds 35 | *.apk 36 | *.unitypackage 37 | 38 | /Scripts -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": { 3 | "**/*.meta": true, 4 | "**/*.csproj": true, 5 | "**/*.sln": true, 6 | "[Bb]uilds": true, 7 | "[Ll]ibrary": true, 8 | "[Oo]bj": true, 9 | "[Tt]emp": true, 10 | "[Pp]roject[Ss]ettings": true, 11 | "[Pp]ackages": true, 12 | "**/[Pp]ackages": true, 13 | "**/[Ff]onts": true 14 | } 15 | } -------------------------------------------------------------------------------- /Assets/Fonts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbfa8ec456447424dbb3eadae41e77b6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-BLACK.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-BLACK.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-BLACK.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 580ed1fe84a93364b8024376f4bcecf2 3 | timeCreated: 1525321384 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 18 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 19 | customCharacters: 20 | fontRenderingMode: 0 21 | ascentCalculationMode: 1 22 | useLegacyBoundsCalculation: 0 23 | userData: 24 | assetBundleName: 25 | assetBundleVariant: 26 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-BOLD.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-BOLD.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-BOLD.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8ec932a462b1afd4b8ea1be16d623d69 3 | TrueTypeFontImporter: 4 | externalObjects: {} 5 | serializedVersion: 4 6 | fontSize: 16 7 | forceTextureCase: -2 8 | characterSpacing: 0 9 | characterPadding: 1 10 | includeFontData: 1 11 | fontName: Exo 12 | fontNames: 13 | - Exo 14 | fallbackFontReferences: 15 | - {fileID: 12800000, guid: cb0a1508000b96848a5b75bb4b50407e, type: 3} 16 | - {fileID: 12800000, guid: 3489ed293c3a37a488cf89811d1fc89a, type: 3} 17 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 18 | - {fileID: 12800000, guid: 9c7a3f6a2ab974b42894f037d2734690, type: 3} 19 | - {fileID: 12800000, guid: 13b6f1fadcc079a4e926219788ac2cac, type: 3} 20 | - {fileID: 12800000, guid: fa2f414e530416d46a12127dc4e5172d, type: 3} 21 | - {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 22 | customCharacters: 23 | fontRenderingMode: 0 24 | ascentCalculationMode: 1 25 | useLegacyBoundsCalculation: 0 26 | shouldRoundAdvanceValue: 1 27 | userData: 28 | assetBundleName: 29 | assetBundleVariant: 30 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-EXTRABOLD.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-EXTRABOLD.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-EXTRABOLD.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 735e2bf901a467b498cb31429ac13208 3 | timeCreated: 1525321380 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 18 | customCharacters: 19 | fontRenderingMode: 0 20 | ascentCalculationMode: 1 21 | useLegacyBoundsCalculation: 0 22 | userData: 23 | assetBundleName: 24 | assetBundleVariant: 25 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-EXTRALIGHT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-EXTRALIGHT.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-EXTRALIGHT.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fa2f414e530416d46a12127dc4e5172d 3 | timeCreated: 1525321386 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 18 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 19 | - {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 20 | customCharacters: 21 | fontRenderingMode: 0 22 | ascentCalculationMode: 1 23 | useLegacyBoundsCalculation: 0 24 | userData: 25 | assetBundleName: 26 | assetBundleVariant: 27 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-LIGHT.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-LIGHT.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-LIGHT.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cb0a1508000b96848a5b75bb4b50407e 3 | timeCreated: 1525321387 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 18 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 19 | - {fileID: 12800000, guid: fa2f414e530416d46a12127dc4e5172d, type: 3} 20 | - {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 21 | customCharacters: 22 | fontRenderingMode: 0 23 | ascentCalculationMode: 1 24 | useLegacyBoundsCalculation: 0 25 | userData: 26 | assetBundleName: 27 | assetBundleVariant: 28 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-MEDIUM.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-MEDIUM.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-MEDIUM.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3489ed293c3a37a488cf89811d1fc89a 3 | timeCreated: 1525321388 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: cb0a1508000b96848a5b75bb4b50407e, type: 3} 18 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 19 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 20 | - {fileID: 12800000, guid: fa2f414e530416d46a12127dc4e5172d, type: 3} 21 | - {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 22 | customCharacters: 23 | fontRenderingMode: 0 24 | ascentCalculationMode: 1 25 | useLegacyBoundsCalculation: 0 26 | userData: 27 | assetBundleName: 28 | assetBundleVariant: 29 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-REGULAR.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-REGULAR.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-REGULAR.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13b6f1fadcc079a4e926219788ac2cac 3 | timeCreated: 1525321388 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: cb0a1508000b96848a5b75bb4b50407e, type: 3} 18 | - {fileID: 12800000, guid: 3489ed293c3a37a488cf89811d1fc89a, type: 3} 19 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 20 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 21 | - {fileID: 12800000, guid: fa2f414e530416d46a12127dc4e5172d, type: 3} 22 | - {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 23 | customCharacters: 24 | fontRenderingMode: 0 25 | ascentCalculationMode: 1 26 | useLegacyBoundsCalculation: 0 27 | userData: 28 | assetBundleName: 29 | assetBundleVariant: 30 | -------------------------------------------------------------------------------- /Assets/Fonts/EXO-SEMIBOLD.TTF: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Fonts/EXO-SEMIBOLD.TTF -------------------------------------------------------------------------------- /Assets/Fonts/EXO-SEMIBOLD.TTF.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c7a3f6a2ab974b42894f037d2734690 3 | timeCreated: 1525321389 4 | licenseType: Free 5 | TrueTypeFontImporter: 6 | externalObjects: {} 7 | serializedVersion: 4 8 | fontSize: 64 9 | forceTextureCase: -2 10 | characterSpacing: 0 11 | characterPadding: 1 12 | includeFontData: 1 13 | fontName: Exo 14 | fontNames: 15 | - Exo 16 | fallbackFontReferences: 17 | - {fileID: 12800000, guid: cb0a1508000b96848a5b75bb4b50407e, type: 3} 18 | - {fileID: 12800000, guid: 3489ed293c3a37a488cf89811d1fc89a, type: 3} 19 | - {fileID: 12800000, guid: 735e2bf901a467b498cb31429ac13208, type: 3} 20 | - {fileID: 12800000, guid: 13b6f1fadcc079a4e926219788ac2cac, type: 3} 21 | - {fileID: 12800000, guid: c4a74d9c4e441be46aa16aeb78a85701, type: 3} 22 | - {fileID: 12800000, guid: fa2f414e530416d46a12127dc4e5172d, type: 3} 23 | - {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 24 | customCharacters: 25 | fontRenderingMode: 0 26 | ascentCalculationMode: 1 27 | useLegacyBoundsCalculation: 0 28 | userData: 29 | assetBundleName: 30 | assetBundleVariant: 31 | -------------------------------------------------------------------------------- /Assets/Packages.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f641c5a82a6a5f34aaf8a227f970824d 3 | folderAsset: yes 4 | timeCreated: 1525718389 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Packages/Jint.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b76da0e0de26a0a468b25e3f65c8a579 3 | folderAsset: yes 4 | timeCreated: 1525791462 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Packages/Jint/Jint.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Packages/Jint/Jint.dll -------------------------------------------------------------------------------- /Assets/Packages/Jint/Jint.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2dde3ba28f7f39241a79b91b7b3807f9 3 | timeCreated: 1525791542 4 | licenseType: Free 5 | PluginImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | isOverridable: 0 12 | platformData: 13 | - first: 14 | Any: 15 | second: 16 | enabled: 1 17 | settings: {} 18 | - first: 19 | Editor: Editor 20 | second: 21 | enabled: 0 22 | settings: 23 | DefaultValueInitialized: true 24 | - first: 25 | Windows Store Apps: WindowsStoreApps 26 | second: 27 | enabled: 0 28 | settings: 29 | CPU: AnyCPU 30 | userData: 31 | assetBundleName: 32 | assetBundleVariant: 33 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a170f49d2def54e8fbf9d7d7598e0890 3 | folderAsset: yes 4 | timeCreated: 1483902786 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/IStandaloneFileBrowser.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace SFB { 4 | public interface IStandaloneFileBrowser { 5 | string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect); 6 | string[] OpenFolderPanel(string title, string directory, bool multiselect); 7 | string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions); 8 | 9 | void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb); 10 | void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb); 11 | void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/IStandaloneFileBrowser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7609f7b6787a54496aa41a3053fcc76a 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fabd0452d926f4a79b1a6ac2a3524117 3 | folderAsset: yes 4 | timeCreated: 1483902786 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/Linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82666e520ab4d4cf08bebbb8059cd6f4 3 | folderAsset: yes 4 | timeCreated: 1538224809 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/Linux/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd198408642944765b9305bd99404136 3 | folderAsset: yes 4 | timeCreated: 1538230728 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Packages/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/Linux/x86_64/libStandaloneFileBrowser.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b8c465928f1784a3fac8dc3766f7201c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux: 1 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXIntel: 1 25 | Exclude OSXIntel64: 1 26 | Exclude OSXUniversal: 1 27 | Exclude SamsungTV: 1 28 | Exclude Tizen: 1 29 | Exclude WebGL: 1 30 | Exclude Win: 0 31 | Exclude Win64: 0 32 | Exclude iOS: 1 33 | - first: 34 | Android: Android 35 | second: 36 | enabled: 0 37 | settings: 38 | CPU: ARMv7 39 | - first: 40 | Any: 41 | second: 42 | enabled: 0 43 | settings: {} 44 | - first: 45 | Editor: Editor 46 | second: 47 | enabled: 1 48 | settings: 49 | CPU: x86_64 50 | DefaultValueInitialized: true 51 | OS: Linux 52 | - first: 53 | Facebook: Win 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Facebook: Win64 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: AnyCPU 64 | - first: 65 | Samsung TV: SamsungTV 66 | second: 67 | enabled: 0 68 | settings: 69 | STV_MODEL: STANDARD_15 70 | - first: 71 | Standalone: Linux 72 | second: 73 | enabled: 0 74 | settings: 75 | CPU: None 76 | - first: 77 | Standalone: Linux64 78 | second: 79 | enabled: 1 80 | settings: 81 | CPU: AnyCPU 82 | - first: 83 | Standalone: LinuxUniversal 84 | second: 85 | enabled: 1 86 | settings: 87 | CPU: x86_64 88 | - first: 89 | Standalone: OSXIntel 90 | second: 91 | enabled: 0 92 | settings: 93 | CPU: None 94 | - first: 95 | Standalone: OSXIntel64 96 | second: 97 | enabled: 0 98 | settings: 99 | CPU: None 100 | - first: 101 | Standalone: OSXUniversal 102 | second: 103 | enabled: 0 104 | settings: 105 | CPU: None 106 | - first: 107 | Standalone: Win 108 | second: 109 | enabled: 1 110 | settings: 111 | CPU: AnyCPU 112 | - first: 113 | Standalone: Win64 114 | second: 115 | enabled: 1 116 | settings: 117 | CPU: AnyCPU 118 | - first: 119 | iPhone: iOS 120 | second: 121 | enabled: 0 122 | settings: 123 | CompileFlags: 124 | FrameworkDependencies: 125 | userData: 126 | assetBundleName: 127 | assetBundleVariant: 128 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Packages/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/Ookii.Dialogs.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e60958662eed5413d86143a0a69b731e 3 | timeCreated: 1491979494 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 1 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXIntel: 1 24 | Exclude OSXIntel64: 1 25 | Exclude OSXUniversal: 1 26 | Exclude WebGL: 1 27 | Exclude Win: 0 28 | Exclude Win64: 0 29 | Exclude iOS: 1 30 | data: 31 | first: 32 | '': Editor 33 | second: 34 | enabled: 0 35 | settings: 36 | CPU: AnyCPU 37 | OS: AnyOS 38 | data: 39 | first: 40 | Android: Android 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: ARMv7 45 | data: 46 | first: 47 | Any: 48 | second: 49 | enabled: 0 50 | settings: {} 51 | data: 52 | first: 53 | Editor: Editor 54 | second: 55 | enabled: 1 56 | settings: 57 | DefaultValueInitialized: true 58 | data: 59 | first: 60 | Facebook: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: AnyCPU 65 | data: 66 | first: 67 | Facebook: Win64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: AnyCPU 72 | data: 73 | first: 74 | Standalone: Linux 75 | second: 76 | enabled: 0 77 | settings: 78 | CPU: None 79 | data: 80 | first: 81 | Standalone: Linux64 82 | second: 83 | enabled: 0 84 | settings: 85 | CPU: None 86 | data: 87 | first: 88 | Standalone: LinuxUniversal 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: None 93 | data: 94 | first: 95 | Standalone: OSXIntel 96 | second: 97 | enabled: 0 98 | settings: 99 | CPU: None 100 | data: 101 | first: 102 | Standalone: OSXIntel64 103 | second: 104 | enabled: 0 105 | settings: 106 | CPU: None 107 | data: 108 | first: 109 | Standalone: OSXUniversal 110 | second: 111 | enabled: 0 112 | settings: 113 | CPU: None 114 | data: 115 | first: 116 | Standalone: Win 117 | second: 118 | enabled: 1 119 | settings: 120 | CPU: AnyCPU 121 | data: 122 | first: 123 | Standalone: Win64 124 | second: 125 | enabled: 1 126 | settings: 127 | CPU: AnyCPU 128 | data: 129 | first: 130 | Windows Store Apps: WindowsStoreApps 131 | second: 132 | enabled: 0 133 | settings: 134 | CPU: AnyCPU 135 | data: 136 | first: 137 | iPhone: iOS 138 | second: 139 | enabled: 0 140 | settings: 141 | CompileFlags: 142 | FrameworkDependencies: 143 | userData: 144 | assetBundleName: 145 | assetBundleVariant: 146 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a2a9837b81577491baf2ffadec5e2852 3 | folderAsset: yes 4 | timeCreated: 1491979493 5 | licenseType: Pro 6 | PluginImporter: 7 | serializedVersion: 2 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | isOverridable: 0 12 | platformData: 13 | data: 14 | first: 15 | Any: 16 | second: 17 | enabled: 0 18 | settings: {} 19 | data: 20 | first: 21 | Editor: Editor 22 | second: 23 | enabled: 1 24 | settings: 25 | DefaultValueInitialized: true 26 | data: 27 | first: 28 | Standalone: OSXIntel 29 | second: 30 | enabled: 1 31 | settings: {} 32 | data: 33 | first: 34 | Standalone: OSXIntel64 35 | second: 36 | enabled: 1 37 | settings: {} 38 | data: 39 | first: 40 | Standalone: OSXUniversal 41 | second: 42 | enabled: 1 43 | settings: {} 44 | userData: 45 | assetBundleName: 46 | assetBundleVariant: 47 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46dc4eb12fae14a349800ec0e97ac0c2 3 | folderAsset: yes 4 | timeCreated: 1505756859 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 18A391 7 | CFBundleDevelopmentRegion 8 | English 9 | CFBundleExecutable 10 | StandaloneFileBrowser 11 | CFBundleIdentifier 12 | com.gkngkc.sfb 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | StandaloneFileBrowser 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleSupportedPlatforms 24 | 25 | MacOSX 26 | 27 | CFBundleVersion 28 | 1.0 29 | CSResourcesFileMapped 30 | 31 | DTCompiler 32 | com.apple.compilers.llvm.clang.1_0 33 | DTPlatformBuild 34 | 10A255 35 | DTPlatformVersion 36 | GM 37 | DTSDKBuild 38 | 18A384 39 | DTSDKName 40 | macosx10.14 41 | DTXcode 42 | 1000 43 | DTXcodeBuild 44 | 10A255 45 | 46 | 47 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce685769797f44046afa3e567860c94c 3 | timeCreated: 1505756861 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ee557323b3b2e4d0f8b4d5a2fdca2f1b 3 | folderAsset: yes 4 | timeCreated: 1505756861 5 | licenseType: Pro 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.bundle/Contents/MacOS/StandaloneFileBrowser.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddf122e0e89124ce78aacfeecb3ec554 3 | timeCreated: 1508179371 4 | licenseType: Pro 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib: -------------------------------------------------------------------------------- 1 | var StandaloneFileBrowserWebGLPlugin = { 2 | // Open file. 3 | // gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage. 4 | // methodNamePtr: Callback method name on given GameObject. 5 | // filter: Filter files. Example filters: 6 | // Match all image files: "image/*" 7 | // Match all video files: "video/*" 8 | // Match all audio files: "audio/*" 9 | // Custom: ".plist, .xml, .yaml" 10 | // multiselect: Allows multiple file selection 11 | UploadFile: function(gameObjectNamePtr, methodNamePtr, filterPtr, multiselect) { 12 | gameObjectName = Pointer_stringify(gameObjectNamePtr); 13 | methodName = Pointer_stringify(methodNamePtr); 14 | filter = Pointer_stringify(filterPtr); 15 | 16 | // Delete if element exist 17 | var fileInput = document.getElementById(gameObjectName) 18 | if (fileInput) { 19 | document.body.removeChild(fileInput); 20 | } 21 | 22 | fileInput = document.createElement('input'); 23 | fileInput.setAttribute('id', gameObjectName); 24 | fileInput.setAttribute('type', 'file'); 25 | fileInput.setAttribute('style','display:none;'); 26 | fileInput.setAttribute('style','visibility:hidden;'); 27 | if (multiselect) { 28 | fileInput.setAttribute('multiple', ''); 29 | } 30 | if (filter) { 31 | fileInput.setAttribute('accept', filter); 32 | } 33 | fileInput.onclick = function (event) { 34 | // File dialog opened 35 | this.value = null; 36 | }; 37 | fileInput.onchange = function (event) { 38 | // multiselect works 39 | var urls = []; 40 | for (var i = 0; i < event.target.files.length; i++) { 41 | urls.push(URL.createObjectURL(event.target.files[i])); 42 | } 43 | // File selected 44 | SendMessage(gameObjectName, methodName, urls.join()); 45 | 46 | // Remove after file selected 47 | document.body.removeChild(fileInput); 48 | } 49 | document.body.appendChild(fileInput); 50 | 51 | document.onmouseup = function() { 52 | fileInput.click(); 53 | document.onmouseup = null; 54 | } 55 | }, 56 | 57 | // Save file 58 | // DownloadFile method does not open SaveFileDialog like standalone builds, its just allows user to download file 59 | // gameObjectNamePtr: Unique GameObject name. Required for calling back unity with SendMessage. 60 | // methodNamePtr: Callback method name on given GameObject. 61 | // filenamePtr: Filename with extension 62 | // byteArray: byte[] 63 | // byteArraySize: byte[].Length 64 | DownloadFile: function(gameObjectNamePtr, methodNamePtr, filenamePtr, byteArray, byteArraySize) { 65 | gameObjectName = Pointer_stringify(gameObjectNamePtr); 66 | methodName = Pointer_stringify(methodNamePtr); 67 | filename = Pointer_stringify(filenamePtr); 68 | 69 | var bytes = new Uint8Array(byteArraySize); 70 | for (var i = 0; i < byteArraySize; i++) { 71 | bytes[i] = HEAPU8[byteArray + i]; 72 | } 73 | 74 | var downloader = window.document.createElement('a'); 75 | downloader.setAttribute('id', gameObjectName); 76 | downloader.href = window.URL.createObjectURL(new Blob([bytes], { type: 'application/octet-stream' })); 77 | downloader.download = filename; 78 | document.body.appendChild(downloader); 79 | 80 | document.onmouseup = function() { 81 | downloader.click(); 82 | document.body.removeChild(downloader); 83 | document.onmouseup = null; 84 | 85 | SendMessage(gameObjectName, methodName); 86 | } 87 | } 88 | }; 89 | 90 | mergeInto(LibraryManager.library, StandaloneFileBrowserWebGLPlugin); -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/StandaloneFileBrowser.jslib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 265aaf20a6d564e0fb00a9c4a7a9c300 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Editor: 1 20 | Exclude Linux: 1 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXUniversal: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | - first: 27 | Any: 28 | second: 29 | enabled: 0 30 | settings: {} 31 | - first: 32 | Editor: Editor 33 | second: 34 | enabled: 0 35 | settings: 36 | CPU: AnyCPU 37 | DefaultValueInitialized: true 38 | OS: AnyOS 39 | - first: 40 | Facebook: WebGL 41 | second: 42 | enabled: 1 43 | settings: {} 44 | - first: 45 | Facebook: Win 46 | second: 47 | enabled: 0 48 | settings: 49 | CPU: AnyCPU 50 | - first: 51 | Facebook: Win64 52 | second: 53 | enabled: 0 54 | settings: 55 | CPU: AnyCPU 56 | - first: 57 | Standalone: Linux 58 | second: 59 | enabled: 0 60 | settings: 61 | CPU: x86 62 | - first: 63 | Standalone: Linux64 64 | second: 65 | enabled: 0 66 | settings: 67 | CPU: AnyCPU 68 | - first: 69 | Standalone: LinuxUniversal 70 | second: 71 | enabled: 0 72 | settings: 73 | CPU: None 74 | - first: 75 | Standalone: OSXUniversal 76 | second: 77 | enabled: 0 78 | settings: 79 | CPU: AnyCPU 80 | - first: 81 | Standalone: Win 82 | second: 83 | enabled: 0 84 | settings: 85 | CPU: AnyCPU 86 | - first: 87 | Standalone: Win64 88 | second: 89 | enabled: 0 90 | settings: 91 | CPU: AnyCPU 92 | - first: 93 | WebGL: WebGL 94 | second: 95 | enabled: 1 96 | settings: {} 97 | userData: 98 | assetBundleName: 99 | assetBundleVariant: 100 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lemoncove/osu-playground/7efec103b11efd2e166c1088fabdc8c92fd4de86/Assets/Packages/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/Plugins/System.Windows.Forms.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d459a96865cc4aaab657012c6dc4833 3 | timeCreated: 1491979494 4 | licenseType: Pro 5 | PluginImporter: 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | isOverridable: 0 11 | platformData: 12 | data: 13 | first: 14 | '': Any 15 | second: 16 | enabled: 0 17 | settings: 18 | Exclude Android: 1 19 | Exclude Editor: 0 20 | Exclude Linux: 1 21 | Exclude Linux64: 1 22 | Exclude LinuxUniversal: 1 23 | Exclude OSXIntel: 1 24 | Exclude OSXIntel64: 1 25 | Exclude OSXUniversal: 1 26 | Exclude WebGL: 1 27 | Exclude Win: 0 28 | Exclude Win64: 0 29 | Exclude iOS: 1 30 | data: 31 | first: 32 | '': Editor 33 | second: 34 | enabled: 0 35 | settings: 36 | CPU: AnyCPU 37 | OS: AnyOS 38 | data: 39 | first: 40 | Android: Android 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: ARMv7 45 | data: 46 | first: 47 | Any: 48 | second: 49 | enabled: 0 50 | settings: {} 51 | data: 52 | first: 53 | Editor: Editor 54 | second: 55 | enabled: 1 56 | settings: 57 | DefaultValueInitialized: true 58 | data: 59 | first: 60 | Facebook: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: AnyCPU 65 | data: 66 | first: 67 | Facebook: Win64 68 | second: 69 | enabled: 0 70 | settings: 71 | CPU: AnyCPU 72 | data: 73 | first: 74 | Standalone: Linux 75 | second: 76 | enabled: 0 77 | settings: 78 | CPU: None 79 | data: 80 | first: 81 | Standalone: Linux64 82 | second: 83 | enabled: 0 84 | settings: 85 | CPU: None 86 | data: 87 | first: 88 | Standalone: LinuxUniversal 89 | second: 90 | enabled: 0 91 | settings: 92 | CPU: None 93 | data: 94 | first: 95 | Standalone: OSXIntel 96 | second: 97 | enabled: 0 98 | settings: 99 | CPU: None 100 | data: 101 | first: 102 | Standalone: OSXIntel64 103 | second: 104 | enabled: 0 105 | settings: 106 | CPU: None 107 | data: 108 | first: 109 | Standalone: OSXUniversal 110 | second: 111 | enabled: 0 112 | settings: 113 | CPU: None 114 | data: 115 | first: 116 | Standalone: Win 117 | second: 118 | enabled: 1 119 | settings: 120 | CPU: AnyCPU 121 | data: 122 | first: 123 | Standalone: Win64 124 | second: 125 | enabled: 1 126 | settings: 127 | CPU: AnyCPU 128 | data: 129 | first: 130 | Windows Store Apps: WindowsStoreApps 131 | second: 132 | enabled: 0 133 | settings: 134 | CPU: AnyCPU 135 | data: 136 | first: 137 | iPhone: iOS 138 | second: 139 | enabled: 0 140 | settings: 141 | CompileFlags: 142 | FrameworkDependencies: 143 | userData: 144 | assetBundleName: 145 | assetBundleVariant: 146 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c708be74128e4ced9b79eaaf80e8443 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_EDITOR 2 | 3 | using System; 4 | using UnityEditor; 5 | 6 | namespace SFB { 7 | public class StandaloneFileBrowserEditor : IStandaloneFileBrowser { 8 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 9 | string path = ""; 10 | 11 | if (extensions == null) { 12 | path = EditorUtility.OpenFilePanel(title, directory, ""); 13 | } 14 | else { 15 | path = EditorUtility.OpenFilePanelWithFilters(title, directory, GetFilterFromFileExtensionList(extensions)); 16 | } 17 | 18 | return string.IsNullOrEmpty(path) ? new string[0] : new[] { path }; 19 | } 20 | 21 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 22 | cb.Invoke(OpenFilePanel(title, directory, extensions, multiselect)); 23 | } 24 | 25 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 26 | var path = EditorUtility.OpenFolderPanel(title, directory, ""); 27 | return string.IsNullOrEmpty(path) ? new string[0] : new[] {path}; 28 | } 29 | 30 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 31 | cb.Invoke(OpenFolderPanel(title, directory, multiselect)); 32 | } 33 | 34 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 35 | var ext = extensions != null ? extensions[0].Extensions[0] : ""; 36 | var name = string.IsNullOrEmpty(ext) ? defaultName : defaultName + "." + ext; 37 | return EditorUtility.SaveFilePanel(title, directory, name, ext); 38 | } 39 | 40 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 41 | cb.Invoke(SaveFilePanel(title, directory, defaultName, extensions)); 42 | } 43 | 44 | // EditorUtility.OpenFilePanelWithFilters extension filter format 45 | private static string[] GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 46 | var filters = new string[extensions.Length * 2]; 47 | for (int i = 0; i < extensions.Length; i++) { 48 | filters[(i * 2)] = extensions[i].Name; 49 | filters[(i * 2) + 1] = string.Join(",", extensions[i].Extensions); 50 | } 51 | return filters; 52 | } 53 | } 54 | } 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2650af8de2cda46b99b1bc7cf5d30ca5 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_LINUX 2 | 3 | using System; 4 | using System.IO; 5 | using System.Runtime.InteropServices; 6 | using UnityEngine; 7 | 8 | namespace SFB { 9 | 10 | public class StandaloneFileBrowserLinux : IStandaloneFileBrowser { 11 | 12 | private static Action _openFileCb; 13 | private static Action _openFolderCb; 14 | private static Action _saveFileCb; 15 | 16 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 17 | public delegate void AsyncCallback(string path); 18 | 19 | [DllImport("StandaloneFileBrowser")] 20 | private static extern void DialogInit(); 21 | [DllImport("StandaloneFileBrowser")] 22 | private static extern IntPtr DialogOpenFilePanel(string title, string directory, string extension, bool multiselect); 23 | [DllImport("StandaloneFileBrowser")] 24 | private static extern void DialogOpenFilePanelAsync(string title, string directory, string extension, bool multiselect, AsyncCallback callback); 25 | [DllImport("StandaloneFileBrowser")] 26 | private static extern IntPtr DialogOpenFolderPanel(string title, string directory, bool multiselect); 27 | [DllImport("StandaloneFileBrowser")] 28 | private static extern void DialogOpenFolderPanelAsync(string title, string directory, bool multiselect, AsyncCallback callback); 29 | [DllImport("StandaloneFileBrowser")] 30 | private static extern IntPtr DialogSaveFilePanel(string title, string directory, string defaultName, string extension); 31 | [DllImport("StandaloneFileBrowser")] 32 | private static extern void DialogSaveFilePanelAsync(string title, string directory, string defaultName, string extension, AsyncCallback callback); 33 | 34 | public StandaloneFileBrowserLinux() 35 | { 36 | DialogInit(); 37 | } 38 | 39 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 40 | var paths = Marshal.PtrToStringAnsi(DialogOpenFilePanel( 41 | title, 42 | directory, 43 | GetFilterFromFileExtensionList(extensions), 44 | multiselect)); 45 | return paths.Split((char)28); 46 | } 47 | 48 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 49 | _openFileCb = cb; 50 | DialogOpenFilePanelAsync( 51 | title, 52 | directory, 53 | GetFilterFromFileExtensionList(extensions), 54 | multiselect, 55 | (string result) => { _openFileCb.Invoke(result.Split((char)28)); }); 56 | } 57 | 58 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 59 | var paths = Marshal.PtrToStringAnsi(DialogOpenFolderPanel( 60 | title, 61 | directory, 62 | multiselect)); 63 | return paths.Split((char)28); 64 | } 65 | 66 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 67 | _openFolderCb = cb; 68 | DialogOpenFolderPanelAsync( 69 | title, 70 | directory, 71 | multiselect, 72 | (string result) => { _openFolderCb.Invoke(result.Split((char)28)); }); 73 | } 74 | 75 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 76 | return Marshal.PtrToStringAnsi(DialogSaveFilePanel( 77 | title, 78 | directory, 79 | defaultName, 80 | GetFilterFromFileExtensionList(extensions))); 81 | } 82 | 83 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 84 | _saveFileCb = cb; 85 | DialogSaveFilePanelAsync( 86 | title, 87 | directory, 88 | defaultName, 89 | GetFilterFromFileExtensionList(extensions), 90 | (string result) => { _saveFileCb.Invoke(result); }); 91 | } 92 | 93 | private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 94 | if (extensions == null) { 95 | return ""; 96 | } 97 | 98 | var filterString = ""; 99 | foreach (var filter in extensions) { 100 | filterString += filter.Name + ";"; 101 | 102 | foreach (var ext in filter.Extensions) { 103 | filterString += ext + ","; 104 | } 105 | 106 | filterString = filterString.Remove(filterString.Length - 1); 107 | filterString += "|"; 108 | } 109 | filterString = filterString.Remove(filterString.Length - 1); 110 | return filterString; 111 | } 112 | } 113 | } 114 | 115 | #endif -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserLinux.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5d3a668018554b8a89c3fe12de72b60c 3 | timeCreated: 1538067919 -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserMac.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_OSX 2 | 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace SFB { 7 | public class StandaloneFileBrowserMac : IStandaloneFileBrowser { 8 | private static Action _openFileCb; 9 | private static Action _openFolderCb; 10 | private static Action _saveFileCb; 11 | 12 | [UnmanagedFunctionPointer(CallingConvention.StdCall)] 13 | public delegate void AsyncCallback(string path); 14 | 15 | [AOT.MonoPInvokeCallback(typeof(AsyncCallback))] 16 | private static void openFileCb(string result) { 17 | _openFileCb.Invoke(result.Split((char)28)); 18 | } 19 | 20 | [AOT.MonoPInvokeCallback(typeof(AsyncCallback))] 21 | private static void openFolderCb(string result) { 22 | _openFolderCb.Invoke(result.Split((char)28)); 23 | } 24 | 25 | [AOT.MonoPInvokeCallback(typeof(AsyncCallback))] 26 | private static void saveFileCb(string result) { 27 | _saveFileCb.Invoke(result); 28 | } 29 | 30 | [DllImport("StandaloneFileBrowser")] 31 | private static extern IntPtr DialogOpenFilePanel(string title, string directory, string extension, bool multiselect); 32 | [DllImport("StandaloneFileBrowser")] 33 | private static extern void DialogOpenFilePanelAsync(string title, string directory, string extension, bool multiselect, AsyncCallback callback); 34 | [DllImport("StandaloneFileBrowser")] 35 | private static extern IntPtr DialogOpenFolderPanel(string title, string directory, bool multiselect); 36 | [DllImport("StandaloneFileBrowser")] 37 | private static extern void DialogOpenFolderPanelAsync(string title, string directory, bool multiselect, AsyncCallback callback); 38 | [DllImport("StandaloneFileBrowser")] 39 | private static extern IntPtr DialogSaveFilePanel(string title, string directory, string defaultName, string extension); 40 | [DllImport("StandaloneFileBrowser")] 41 | private static extern void DialogSaveFilePanelAsync(string title, string directory, string defaultName, string extension, AsyncCallback callback); 42 | 43 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 44 | var paths = Marshal.PtrToStringAnsi(DialogOpenFilePanel( 45 | title, 46 | directory, 47 | GetFilterFromFileExtensionList(extensions), 48 | multiselect)); 49 | return paths.Split((char)28); 50 | } 51 | 52 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 53 | _openFileCb = cb; 54 | DialogOpenFilePanelAsync( 55 | title, 56 | directory, 57 | GetFilterFromFileExtensionList(extensions), 58 | multiselect, 59 | openFileCb); 60 | } 61 | 62 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 63 | var paths = Marshal.PtrToStringAnsi(DialogOpenFolderPanel( 64 | title, 65 | directory, 66 | multiselect)); 67 | return paths.Split((char)28); 68 | } 69 | 70 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 71 | _openFolderCb = cb; 72 | DialogOpenFolderPanelAsync( 73 | title, 74 | directory, 75 | multiselect, 76 | openFolderCb); 77 | } 78 | 79 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 80 | return Marshal.PtrToStringAnsi(DialogSaveFilePanel( 81 | title, 82 | directory, 83 | defaultName, 84 | GetFilterFromFileExtensionList(extensions))); 85 | } 86 | 87 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 88 | _saveFileCb = cb; 89 | DialogSaveFilePanelAsync( 90 | title, 91 | directory, 92 | defaultName, 93 | GetFilterFromFileExtensionList(extensions), 94 | saveFileCb); 95 | } 96 | 97 | private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 98 | if (extensions == null) { 99 | return ""; 100 | } 101 | 102 | var filterString = ""; 103 | foreach (var filter in extensions) { 104 | filterString += filter.Name + ";"; 105 | 106 | foreach (var ext in filter.Extensions) { 107 | filterString += ext + ","; 108 | } 109 | 110 | filterString = filterString.Remove(filterString.Length - 1); 111 | filterString += "|"; 112 | } 113 | filterString = filterString.Remove(filterString.Length - 1); 114 | return filterString; 115 | } 116 | } 117 | } 118 | 119 | #endif -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserMac.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcb49ddb0ed5644fda9c3b055cafa27a 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs: -------------------------------------------------------------------------------- 1 | #if UNITY_STANDALONE_WIN 2 | 3 | using System; 4 | using System.IO; 5 | using System.Windows.Forms; 6 | using System.Runtime.InteropServices; 7 | using Ookii.Dialogs; 8 | 9 | namespace SFB { 10 | // For fullscreen support 11 | // - WindowWrapper class and GetActiveWindow() are required for modal file dialog. 12 | // - "PlayerSettings/Visible In Background" should be enabled, otherwise when file dialog opened app window minimizes automatically. 13 | 14 | public class WindowWrapper : IWin32Window { 15 | private IntPtr _hwnd; 16 | public WindowWrapper(IntPtr handle) { _hwnd = handle; } 17 | public IntPtr Handle { get { return _hwnd; } } 18 | } 19 | 20 | public class StandaloneFileBrowserWindows : IStandaloneFileBrowser { 21 | [DllImport("user32.dll")] 22 | private static extern IntPtr GetActiveWindow(); 23 | 24 | public string[] OpenFilePanel(string title, string directory, ExtensionFilter[] extensions, bool multiselect) { 25 | var fd = new VistaOpenFileDialog(); 26 | fd.Title = title; 27 | if (extensions != null) { 28 | fd.Filter = GetFilterFromFileExtensionList(extensions); 29 | fd.FilterIndex = 1; 30 | } 31 | else { 32 | fd.Filter = string.Empty; 33 | } 34 | fd.Multiselect = multiselect; 35 | if (!string.IsNullOrEmpty(directory)) { 36 | fd.FileName = GetDirectoryPath(directory); 37 | } 38 | var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); 39 | var filenames = res == DialogResult.OK ? fd.FileNames : new string[0]; 40 | fd.Dispose(); 41 | return filenames; 42 | } 43 | 44 | public void OpenFilePanelAsync(string title, string directory, ExtensionFilter[] extensions, bool multiselect, Action cb) { 45 | cb.Invoke(OpenFilePanel(title, directory, extensions, multiselect)); 46 | } 47 | 48 | public string[] OpenFolderPanel(string title, string directory, bool multiselect) { 49 | var fd = new VistaFolderBrowserDialog(); 50 | fd.Description = title; 51 | if (!string.IsNullOrEmpty(directory)) { 52 | fd.SelectedPath = GetDirectoryPath(directory); 53 | } 54 | var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); 55 | var filenames = res == DialogResult.OK ? new []{ fd.SelectedPath } : new string[0]; 56 | fd.Dispose(); 57 | return filenames; 58 | } 59 | 60 | public void OpenFolderPanelAsync(string title, string directory, bool multiselect, Action cb) { 61 | cb.Invoke(OpenFolderPanel(title, directory, multiselect)); 62 | } 63 | 64 | public string SaveFilePanel(string title, string directory, string defaultName, ExtensionFilter[] extensions) { 65 | var fd = new VistaSaveFileDialog(); 66 | fd.Title = title; 67 | 68 | var finalFilename = ""; 69 | 70 | if (!string.IsNullOrEmpty(directory)) { 71 | finalFilename = GetDirectoryPath(directory); 72 | } 73 | 74 | if (!string.IsNullOrEmpty(defaultName)) { 75 | finalFilename += defaultName; 76 | } 77 | 78 | fd.FileName = finalFilename; 79 | if (extensions != null) { 80 | fd.Filter = GetFilterFromFileExtensionList(extensions); 81 | fd.FilterIndex = 1; 82 | fd.DefaultExt = extensions[0].Extensions[0]; 83 | fd.AddExtension = true; 84 | } 85 | else { 86 | fd.DefaultExt = string.Empty; 87 | fd.Filter = string.Empty; 88 | fd.AddExtension = false; 89 | } 90 | var res = fd.ShowDialog(new WindowWrapper(GetActiveWindow())); 91 | var filename = res == DialogResult.OK ? fd.FileName : ""; 92 | fd.Dispose(); 93 | return filename; 94 | } 95 | 96 | public void SaveFilePanelAsync(string title, string directory, string defaultName, ExtensionFilter[] extensions, Action cb) { 97 | cb.Invoke(SaveFilePanel(title, directory, defaultName, extensions)); 98 | } 99 | 100 | // .NET Framework FileDialog Filter format 101 | // https://msdn.microsoft.com/en-us/library/microsoft.win32.filedialog.filter 102 | private static string GetFilterFromFileExtensionList(ExtensionFilter[] extensions) { 103 | var filterString = ""; 104 | foreach (var filter in extensions) { 105 | filterString += filter.Name + "("; 106 | 107 | foreach (var ext in filter.Extensions) { 108 | filterString += "*." + ext + ","; 109 | } 110 | 111 | filterString = filterString.Remove(filterString.Length - 1); 112 | filterString += ") |"; 113 | 114 | foreach (var ext in filter.Extensions) { 115 | filterString += "*." + ext + "; "; 116 | } 117 | 118 | filterString += "|"; 119 | } 120 | filterString = filterString.Remove(filterString.Length - 1); 121 | return filterString; 122 | } 123 | 124 | private static string GetDirectoryPath(string directory) { 125 | var directoryPath = Path.GetFullPath(directory); 126 | if (!directoryPath.EndsWith("\\")) { 127 | directoryPath += "\\"; 128 | } 129 | if (Path.GetPathRoot(directoryPath) == directoryPath) { 130 | return directory; 131 | } 132 | return Path.GetDirectoryName(directoryPath) + Path.DirectorySeparatorChar; 133 | } 134 | } 135 | } 136 | 137 | #endif -------------------------------------------------------------------------------- /Assets/Packages/StandaloneFileBrowser/StandaloneFileBrowserWindows.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 194e247414a78461d83ae606c1b96917 3 | timeCreated: 1483902788 4 | licenseType: Pro 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8219a73875fd31c4aba4ab2a96ff6f27 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Prefabs/DrawableHitCircle.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1286918516886198} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1286918516886198 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 224683714670313370} 22 | - component: {fileID: 114837147449602506} 23 | m_Layer: 5 24 | m_Name: DrawableHitCircle 25 | m_TagString: Untagged 26 | m_Icon: {fileID: 0} 27 | m_NavMeshLayer: 0 28 | m_StaticEditorFlags: 0 29 | m_IsActive: 1 30 | --- !u!1 &1657824665053504 31 | GameObject: 32 | m_ObjectHideFlags: 0 33 | m_PrefabParentObject: {fileID: 0} 34 | m_PrefabInternal: {fileID: 100100000} 35 | serializedVersion: 5 36 | m_Component: 37 | - component: {fileID: 224544091913141282} 38 | - component: {fileID: 222620711340383182} 39 | - component: {fileID: 114752829176970280} 40 | m_Layer: 5 41 | m_Name: Text 42 | m_TagString: Untagged 43 | m_Icon: {fileID: 0} 44 | m_NavMeshLayer: 0 45 | m_StaticEditorFlags: 0 46 | m_IsActive: 1 47 | --- !u!1 &1920333046676056 48 | GameObject: 49 | m_ObjectHideFlags: 0 50 | m_PrefabParentObject: {fileID: 0} 51 | m_PrefabInternal: {fileID: 100100000} 52 | serializedVersion: 5 53 | m_Component: 54 | - component: {fileID: 224954457346939262} 55 | - component: {fileID: 222308003598344834} 56 | - component: {fileID: 114207718877282542} 57 | - component: {fileID: 135778651967946020} 58 | m_Layer: 5 59 | m_Name: Circle 60 | m_TagString: Untagged 61 | m_Icon: {fileID: 0} 62 | m_NavMeshLayer: 0 63 | m_StaticEditorFlags: 0 64 | m_IsActive: 1 65 | --- !u!114 &114207718877282542 66 | MonoBehaviour: 67 | m_ObjectHideFlags: 1 68 | m_PrefabParentObject: {fileID: 0} 69 | m_PrefabInternal: {fileID: 100100000} 70 | m_GameObject: {fileID: 1920333046676056} 71 | m_Enabled: 1 72 | m_EditorHideFlags: 0 73 | m_Script: {fileID: 11500000, guid: c5bd3804393b2b240840edabd5b6e6a8, type: 3} 74 | m_Name: 75 | m_EditorClassIdentifier: 76 | m_Material: {fileID: 0} 77 | m_Color: {r: 1, g: 1, b: 1, a: 1} 78 | m_RaycastTarget: 1 79 | m_OnCullStateChanged: 80 | m_PersistentCalls: 81 | m_Calls: [] 82 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 83 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 84 | Position: {x: 0, y: 0} 85 | Radius: 0 86 | --- !u!114 &114752829176970280 87 | MonoBehaviour: 88 | m_ObjectHideFlags: 1 89 | m_PrefabParentObject: {fileID: 0} 90 | m_PrefabInternal: {fileID: 100100000} 91 | m_GameObject: {fileID: 1657824665053504} 92 | m_Enabled: 1 93 | m_EditorHideFlags: 0 94 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 95 | m_Name: 96 | m_EditorClassIdentifier: 97 | m_Material: {fileID: 0} 98 | m_Color: {r: 1, g: 1, b: 1, a: 1} 99 | m_RaycastTarget: 0 100 | m_OnCullStateChanged: 101 | m_PersistentCalls: 102 | m_Calls: [] 103 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 104 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 105 | m_FontData: 106 | m_Font: {fileID: 12800000, guid: 580ed1fe84a93364b8024376f4bcecf2, type: 3} 107 | m_FontSize: 21 108 | m_FontStyle: 0 109 | m_BestFit: 0 110 | m_MinSize: 0 111 | m_MaxSize: 230 112 | m_Alignment: 4 113 | m_AlignByGeometry: 0 114 | m_RichText: 0 115 | m_HorizontalOverflow: 1 116 | m_VerticalOverflow: 1 117 | m_LineSpacing: 1 118 | m_Text: 119 | --- !u!114 &114837147449602506 120 | MonoBehaviour: 121 | m_ObjectHideFlags: 1 122 | m_PrefabParentObject: {fileID: 0} 123 | m_PrefabInternal: {fileID: 100100000} 124 | m_GameObject: {fileID: 1286918516886198} 125 | m_Enabled: 1 126 | m_EditorHideFlags: 0 127 | m_Script: {fileID: 11500000, guid: 96ca32d2424c4e24ca4b039786cff2c4, type: 3} 128 | m_Name: 129 | m_EditorClassIdentifier: 130 | Text: {fileID: 114752829176970280} 131 | Circle: {fileID: 114207718877282542} 132 | Index: 0 133 | --- !u!135 &135778651967946020 134 | SphereCollider: 135 | m_ObjectHideFlags: 1 136 | m_PrefabParentObject: {fileID: 0} 137 | m_PrefabInternal: {fileID: 100100000} 138 | m_GameObject: {fileID: 1920333046676056} 139 | m_Material: {fileID: 0} 140 | m_IsTrigger: 0 141 | m_Enabled: 1 142 | serializedVersion: 2 143 | m_Radius: 1 144 | m_Center: {x: 0, y: 0, z: 0} 145 | --- !u!222 &222308003598344834 146 | CanvasRenderer: 147 | m_ObjectHideFlags: 1 148 | m_PrefabParentObject: {fileID: 0} 149 | m_PrefabInternal: {fileID: 100100000} 150 | m_GameObject: {fileID: 1920333046676056} 151 | --- !u!222 &222620711340383182 152 | CanvasRenderer: 153 | m_ObjectHideFlags: 1 154 | m_PrefabParentObject: {fileID: 0} 155 | m_PrefabInternal: {fileID: 100100000} 156 | m_GameObject: {fileID: 1657824665053504} 157 | --- !u!224 &224544091913141282 158 | RectTransform: 159 | m_ObjectHideFlags: 1 160 | m_PrefabParentObject: {fileID: 0} 161 | m_PrefabInternal: {fileID: 100100000} 162 | m_GameObject: {fileID: 1657824665053504} 163 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 164 | m_LocalPosition: {x: 0, y: 0, z: 0} 165 | m_LocalScale: {x: 1, y: 1, z: 1} 166 | m_Children: [] 167 | m_Father: {fileID: 224683714670313370} 168 | m_RootOrder: 1 169 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 170 | m_AnchorMin: {x: 0.5, y: 0.5} 171 | m_AnchorMax: {x: 0.5, y: 0.5} 172 | m_AnchoredPosition: {x: 0, y: 0} 173 | m_SizeDelta: {x: 0, y: 0} 174 | m_Pivot: {x: 0.5, y: 0.5} 175 | --- !u!224 &224683714670313370 176 | RectTransform: 177 | m_ObjectHideFlags: 1 178 | m_PrefabParentObject: {fileID: 0} 179 | m_PrefabInternal: {fileID: 100100000} 180 | m_GameObject: {fileID: 1286918516886198} 181 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 182 | m_LocalPosition: {x: 0, y: 0, z: 0} 183 | m_LocalScale: {x: 1, y: 1, z: 1} 184 | m_Children: 185 | - {fileID: 224954457346939262} 186 | - {fileID: 224544091913141282} 187 | m_Father: {fileID: 0} 188 | m_RootOrder: 0 189 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 190 | m_AnchorMin: {x: 0.5, y: 0.5} 191 | m_AnchorMax: {x: 0.5, y: 0.5} 192 | m_AnchoredPosition: {x: 0, y: 0} 193 | m_SizeDelta: {x: 0, y: 0} 194 | m_Pivot: {x: 0.5, y: 0.5} 195 | --- !u!224 &224954457346939262 196 | RectTransform: 197 | m_ObjectHideFlags: 1 198 | m_PrefabParentObject: {fileID: 0} 199 | m_PrefabInternal: {fileID: 100100000} 200 | m_GameObject: {fileID: 1920333046676056} 201 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 202 | m_LocalPosition: {x: 0, y: 0, z: 0} 203 | m_LocalScale: {x: 1, y: 1, z: 1} 204 | m_Children: [] 205 | m_Father: {fileID: 224683714670313370} 206 | m_RootOrder: 0 207 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 208 | m_AnchorMin: {x: 0.5, y: 0.5} 209 | m_AnchorMax: {x: 0.5, y: 0.5} 210 | m_AnchoredPosition: {x: 0, y: 0} 211 | m_SizeDelta: {x: 0, y: 0} 212 | m_Pivot: {x: 0.5, y: 0.5} 213 | -------------------------------------------------------------------------------- /Assets/Prefabs/DrawableHitCircle.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73a10102ebcca4a45ba0f1cab642a861 3 | timeCreated: 1525372578 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Prefabs/DrawableSlider.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 27d50fabc00776a4b837b219503f2447 3 | timeCreated: 1525372679 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Prefabs/Handle.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1875114146193958} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1393084682096536 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 224059587757593976} 22 | - component: {fileID: 222635068519724678} 23 | - component: {fileID: 114250587798732836} 24 | m_Layer: 5 25 | m_Name: Center 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!1 &1875114146193958 32 | GameObject: 33 | m_ObjectHideFlags: 0 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | serializedVersion: 5 37 | m_Component: 38 | - component: {fileID: 224389748108659020} 39 | - component: {fileID: 222882127755678786} 40 | - component: {fileID: 114375208553679362} 41 | - component: {fileID: 114863974186789118} 42 | m_Layer: 5 43 | m_Name: Handle 44 | m_TagString: Untagged 45 | m_Icon: {fileID: 0} 46 | m_NavMeshLayer: 0 47 | m_StaticEditorFlags: 0 48 | m_IsActive: 1 49 | --- !u!114 &114250587798732836 50 | MonoBehaviour: 51 | m_ObjectHideFlags: 1 52 | m_PrefabParentObject: {fileID: 0} 53 | m_PrefabInternal: {fileID: 100100000} 54 | m_GameObject: {fileID: 1393084682096536} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 58 | m_Name: 59 | m_EditorClassIdentifier: 60 | m_Material: {fileID: 0} 61 | m_Color: {r: 1, g: 1, b: 1, a: 1} 62 | m_RaycastTarget: 1 63 | m_OnCullStateChanged: 64 | m_PersistentCalls: 65 | m_Calls: [] 66 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 67 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 68 | m_Sprite: {fileID: 0} 69 | m_Type: 0 70 | m_PreserveAspect: 0 71 | m_FillCenter: 1 72 | m_FillMethod: 4 73 | m_FillAmount: 1 74 | m_FillClockwise: 1 75 | m_FillOrigin: 0 76 | --- !u!114 &114375208553679362 77 | MonoBehaviour: 78 | m_ObjectHideFlags: 1 79 | m_PrefabParentObject: {fileID: 0} 80 | m_PrefabInternal: {fileID: 100100000} 81 | m_GameObject: {fileID: 1875114146193958} 82 | m_Enabled: 1 83 | m_EditorHideFlags: 0 84 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 85 | m_Name: 86 | m_EditorClassIdentifier: 87 | m_Material: {fileID: 0} 88 | m_Color: {r: 0.09411765, g: 0.09411765, b: 0.09411765, a: 1} 89 | m_RaycastTarget: 1 90 | m_OnCullStateChanged: 91 | m_PersistentCalls: 92 | m_Calls: [] 93 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 94 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 95 | m_Sprite: {fileID: 0} 96 | m_Type: 0 97 | m_PreserveAspect: 0 98 | m_FillCenter: 1 99 | m_FillMethod: 4 100 | m_FillAmount: 1 101 | m_FillClockwise: 1 102 | m_FillOrigin: 0 103 | --- !u!114 &114863974186789118 104 | MonoBehaviour: 105 | m_ObjectHideFlags: 1 106 | m_PrefabParentObject: {fileID: 0} 107 | m_PrefabInternal: {fileID: 100100000} 108 | m_GameObject: {fileID: 1875114146193958} 109 | m_Enabled: 1 110 | m_EditorHideFlags: 0 111 | m_Script: {fileID: 11500000, guid: e3c75be30ed582d428fccec339605762, type: 3} 112 | m_Name: 113 | m_EditorClassIdentifier: 114 | Manager: {fileID: 0} 115 | center: {fileID: 114250587798732836} 116 | --- !u!222 &222635068519724678 117 | CanvasRenderer: 118 | m_ObjectHideFlags: 1 119 | m_PrefabParentObject: {fileID: 0} 120 | m_PrefabInternal: {fileID: 100100000} 121 | m_GameObject: {fileID: 1393084682096536} 122 | --- !u!222 &222882127755678786 123 | CanvasRenderer: 124 | m_ObjectHideFlags: 1 125 | m_PrefabParentObject: {fileID: 0} 126 | m_PrefabInternal: {fileID: 100100000} 127 | m_GameObject: {fileID: 1875114146193958} 128 | --- !u!224 &224059587757593976 129 | RectTransform: 130 | m_ObjectHideFlags: 1 131 | m_PrefabParentObject: {fileID: 0} 132 | m_PrefabInternal: {fileID: 100100000} 133 | m_GameObject: {fileID: 1393084682096536} 134 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 135 | m_LocalPosition: {x: 0, y: 0, z: 0} 136 | m_LocalScale: {x: 1, y: 1, z: 1} 137 | m_Children: [] 138 | m_Father: {fileID: 224389748108659020} 139 | m_RootOrder: 0 140 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 141 | m_AnchorMin: {x: 0, y: 0} 142 | m_AnchorMax: {x: 1, y: 1} 143 | m_AnchoredPosition: {x: 0, y: 0} 144 | m_SizeDelta: {x: -3, y: -3} 145 | m_Pivot: {x: 0.5, y: 0.5} 146 | --- !u!224 &224389748108659020 147 | RectTransform: 148 | m_ObjectHideFlags: 1 149 | m_PrefabParentObject: {fileID: 0} 150 | m_PrefabInternal: {fileID: 100100000} 151 | m_GameObject: {fileID: 1875114146193958} 152 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 153 | m_LocalPosition: {x: 0, y: 0, z: 4} 154 | m_LocalScale: {x: 1, y: 1, z: 1} 155 | m_Children: 156 | - {fileID: 224059587757593976} 157 | m_Father: {fileID: 0} 158 | m_RootOrder: 0 159 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 160 | m_AnchorMin: {x: 0.5, y: 0.5} 161 | m_AnchorMax: {x: 0.5, y: 0.5} 162 | m_AnchoredPosition: {x: 0, y: 0} 163 | m_SizeDelta: {x: 9, y: 9} 164 | m_Pivot: {x: 0.5, y: 0.5} 165 | -------------------------------------------------------------------------------- /Assets/Prefabs/Handle.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef06f0f4f7b6ea54e9eea25c1554d0cf 3 | timeCreated: 1525325296 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/OptionBool.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0383aee570c8fd54883d7d5cb9115144 3 | timeCreated: 1525486325 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/OptionChoice.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49b7086980e1e8d469d000517dde433e 3 | timeCreated: 1526054355 4 | licenseType: Free 5 | NativeFormatImporter: 6 | externalObjects: {} 7 | mainObjectFileID: 100100000 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Prefabs/OptionNumber.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a53976a43fe80b344bd2da19e6abba31 3 | timeCreated: 1525289930 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/OptionVector2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 313cfa34aee75ef47b9b5eaa5052092f 3 | timeCreated: 1525321556 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Prefabs/ToolbarButton.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1720035648580356} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1720035648580356 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 224167832618591166} 22 | - component: {fileID: 222515929049185436} 23 | - component: {fileID: 114035183591211752} 24 | - component: {fileID: 114545557767982820} 25 | m_Layer: 5 26 | m_Name: ToolbarButton 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!1 &1805104338052196 33 | GameObject: 34 | m_ObjectHideFlags: 0 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | serializedVersion: 5 38 | m_Component: 39 | - component: {fileID: 224543470262659484} 40 | - component: {fileID: 222259499446264290} 41 | - component: {fileID: 114179957108913134} 42 | m_Layer: 5 43 | m_Name: Text 44 | m_TagString: Untagged 45 | m_Icon: {fileID: 0} 46 | m_NavMeshLayer: 0 47 | m_StaticEditorFlags: 0 48 | m_IsActive: 1 49 | --- !u!114 &114035183591211752 50 | MonoBehaviour: 51 | m_ObjectHideFlags: 1 52 | m_PrefabParentObject: {fileID: 0} 53 | m_PrefabInternal: {fileID: 100100000} 54 | m_GameObject: {fileID: 1720035648580356} 55 | m_Enabled: 1 56 | m_EditorHideFlags: 0 57 | m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3} 58 | m_Name: 59 | m_EditorClassIdentifier: 60 | m_Material: {fileID: 0} 61 | m_Color: {r: 0.101960786, g: 0.101960786, b: 0.101960786, a: 1} 62 | m_RaycastTarget: 1 63 | m_OnCullStateChanged: 64 | m_PersistentCalls: 65 | m_Calls: [] 66 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 67 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 68 | m_Sprite: {fileID: 0} 69 | m_Type: 1 70 | m_PreserveAspect: 0 71 | m_FillCenter: 1 72 | m_FillMethod: 4 73 | m_FillAmount: 1 74 | m_FillClockwise: 1 75 | m_FillOrigin: 0 76 | --- !u!114 &114179957108913134 77 | MonoBehaviour: 78 | m_ObjectHideFlags: 1 79 | m_PrefabParentObject: {fileID: 0} 80 | m_PrefabInternal: {fileID: 100100000} 81 | m_GameObject: {fileID: 1805104338052196} 82 | m_Enabled: 1 83 | m_EditorHideFlags: 0 84 | m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3} 85 | m_Name: 86 | m_EditorClassIdentifier: 87 | m_Material: {fileID: 0} 88 | m_Color: {r: 1, g: 1, b: 1, a: 1} 89 | m_RaycastTarget: 1 90 | m_OnCullStateChanged: 91 | m_PersistentCalls: 92 | m_Calls: [] 93 | m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI, 94 | Version=1.0.0.0, Culture=neutral, PublicKeyToken=null 95 | m_FontData: 96 | m_Font: {fileID: 12800000, guid: 13b6f1fadcc079a4e926219788ac2cac, type: 3} 97 | m_FontSize: 16 98 | m_FontStyle: 0 99 | m_BestFit: 0 100 | m_MinSize: 1 101 | m_MaxSize: 40 102 | m_Alignment: 4 103 | m_AlignByGeometry: 0 104 | m_RichText: 1 105 | m_HorizontalOverflow: 0 106 | m_VerticalOverflow: 0 107 | m_LineSpacing: 1 108 | m_Text: Button 109 | --- !u!114 &114545557767982820 110 | MonoBehaviour: 111 | m_ObjectHideFlags: 1 112 | m_PrefabParentObject: {fileID: 0} 113 | m_PrefabInternal: {fileID: 100100000} 114 | m_GameObject: {fileID: 1720035648580356} 115 | m_Enabled: 1 116 | m_EditorHideFlags: 0 117 | m_Script: {fileID: 1392445389, guid: f70555f144d8491a825f0804e09c671c, type: 3} 118 | m_Name: 119 | m_EditorClassIdentifier: 120 | m_Navigation: 121 | m_Mode: 3 122 | m_SelectOnUp: {fileID: 0} 123 | m_SelectOnDown: {fileID: 0} 124 | m_SelectOnLeft: {fileID: 0} 125 | m_SelectOnRight: {fileID: 0} 126 | m_Transition: 1 127 | m_Colors: 128 | m_NormalColor: {r: 1, g: 1, b: 1, a: 1} 129 | m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} 130 | m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} 131 | m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} 132 | m_ColorMultiplier: 1 133 | m_FadeDuration: 0.1 134 | m_SpriteState: 135 | m_HighlightedSprite: {fileID: 0} 136 | m_PressedSprite: {fileID: 0} 137 | m_DisabledSprite: {fileID: 0} 138 | m_AnimationTriggers: 139 | m_NormalTrigger: Normal 140 | m_HighlightedTrigger: Highlighted 141 | m_PressedTrigger: Pressed 142 | m_DisabledTrigger: Disabled 143 | m_Interactable: 1 144 | m_TargetGraphic: {fileID: 114035183591211752} 145 | m_OnClick: 146 | m_PersistentCalls: 147 | m_Calls: [] 148 | m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0, 149 | Culture=neutral, PublicKeyToken=null 150 | --- !u!222 &222259499446264290 151 | CanvasRenderer: 152 | m_ObjectHideFlags: 1 153 | m_PrefabParentObject: {fileID: 0} 154 | m_PrefabInternal: {fileID: 100100000} 155 | m_GameObject: {fileID: 1805104338052196} 156 | --- !u!222 &222515929049185436 157 | CanvasRenderer: 158 | m_ObjectHideFlags: 1 159 | m_PrefabParentObject: {fileID: 0} 160 | m_PrefabInternal: {fileID: 100100000} 161 | m_GameObject: {fileID: 1720035648580356} 162 | --- !u!224 &224167832618591166 163 | RectTransform: 164 | m_ObjectHideFlags: 1 165 | m_PrefabParentObject: {fileID: 0} 166 | m_PrefabInternal: {fileID: 100100000} 167 | m_GameObject: {fileID: 1720035648580356} 168 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 169 | m_LocalPosition: {x: 0, y: 0, z: 0} 170 | m_LocalScale: {x: 1, y: 1, z: 1} 171 | m_Children: 172 | - {fileID: 224543470262659484} 173 | m_Father: {fileID: 0} 174 | m_RootOrder: 0 175 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 176 | m_AnchorMin: {x: 0, y: 0} 177 | m_AnchorMax: {x: 0, y: 1} 178 | m_AnchoredPosition: {x: 5, y: 5} 179 | m_SizeDelta: {x: 100, y: -10} 180 | m_Pivot: {x: 0, y: 0} 181 | --- !u!224 &224543470262659484 182 | RectTransform: 183 | m_ObjectHideFlags: 1 184 | m_PrefabParentObject: {fileID: 0} 185 | m_PrefabInternal: {fileID: 100100000} 186 | m_GameObject: {fileID: 1805104338052196} 187 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 188 | m_LocalPosition: {x: 0, y: 0, z: 0} 189 | m_LocalScale: {x: 1, y: 1, z: 1} 190 | m_Children: [] 191 | m_Father: {fileID: 224167832618591166} 192 | m_RootOrder: 0 193 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 194 | m_AnchorMin: {x: 0, y: 0} 195 | m_AnchorMax: {x: 1, y: 1} 196 | m_AnchoredPosition: {x: 0, y: 0} 197 | m_SizeDelta: {x: 0, y: 0} 198 | m_Pivot: {x: 0.5, y: 0.5} 199 | -------------------------------------------------------------------------------- /Assets/Prefabs/ToolbarButton.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0722287016c48040bdc4843ec03465b 3 | timeCreated: 1525292510 4 | licenseType: Free 5 | NativeFormatImporter: 6 | mainObjectFileID: 100100000 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c415e29ebd8e2d64084112471706e9da 3 | folderAsset: yes 4 | timeCreated: 1525797154 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Resources/framework.txt: -------------------------------------------------------------------------------- 1 | // Why is this a .txt file instead of a .js or .oss file? That's because Unity is stupid. 2 | 3 | var UnityEngine = importNamespace('UnityEngine'); 4 | var OsuPlayground = importNamespace('OsuPlayground'); 5 | var Vector2 = UnityEngine.Vector2; 6 | var CurveType = OsuPlayground.HitObjects.CurveType 7 | 8 | function add(a, b) { 9 | return new Vector2(a.x + b.x, a.y + b.y); 10 | } 11 | function subtract(a, b) { 12 | return new Vector2(a.x - b.x, a.y - b.y); 13 | } 14 | function multiply(a, b) { 15 | return new Vector2(a.x * b.x, a.y * b.y); 16 | } 17 | function divide(a, b) { 18 | return new Vector2(a.x / b.x, a.y / b.y); 19 | } 20 | function scale(a, b) { 21 | return new Vector2(a.x * b, a.y * b); 22 | } 23 | function normalize(p) { 24 | var w = Math.sqrt(p.x * p.x + p.y * p.y); 25 | return new Vector2(p.x / w, p.y / w); 26 | } 27 | 28 | function rotate(point, around, angle) { 29 | var temporaryPoint = subtract(point, around); 30 | 31 | var cos = Math.cos(angle); 32 | var sin = Math.sin(angle); 33 | 34 | var tx = temporaryPoint.x; 35 | var ty = temporaryPoint.y; 36 | var nx = (cos * tx) - (sin * ty); 37 | var ny = (sin * tx) + (cos * ty); 38 | 39 | return add(new Vector2(nx, ny), around); 40 | } 41 | 42 | function distance(a, b) { 43 | return Math.sqrt((a.x - b.x) * (a.x - b.x) + (a.y - b.y) * (a.y - b.y)); 44 | } 45 | 46 | Math.lerp = function(from, to, t) { 47 | return (1 - t) * from + t * to; 48 | }; 49 | 50 | Math.PHI = (1 + Math.sqrt(5)) / 2; 51 | 52 | function lerp(from, to, t) { 53 | return new Vector2(Math.lerp(from.x, to.x, t), Math.lerp(from.y, to.y, t)); 54 | } -------------------------------------------------------------------------------- /Assets/Resources/framework.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70a42a667ae375848a36c0245fbc34c7 3 | timeCreated: 1525797896 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 03c43bbccfbcbfd4a8fa6da253172d22 3 | folderAsset: yes 4 | timeCreated: 1524784468 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scenes/Screen.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 29f7c6e251ef1114cb8a675c56ba12a0 3 | timeCreated: 1525198643 4 | licenseType: Free 5 | DefaultImporter: 6 | externalObjects: {} 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6382f8c93d419c84c872b26b4ae416f3 3 | folderAsset: yes 4 | timeCreated: 1524784697 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/Bindables.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e9c3d45e35e899a42bb2717ebfd0621e 3 | folderAsset: yes 4 | timeCreated: 1525713808 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Bindables/Bindable.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OsuPlayground.Bindables 4 | { 5 | public abstract class Bindable 6 | { } 7 | 8 | /// 9 | /// A class for making globally accessible values from immutable underlying types. 10 | /// 11 | public class Bindable : Bindable 12 | { 13 | private T value; 14 | 15 | /// 16 | /// The value of this . 17 | /// 18 | public virtual T Value 19 | { 20 | get { return this.value; } 21 | set 22 | { 23 | this.value = value; 24 | 25 | this.TriggerValueChange(); 26 | } 27 | } 28 | 29 | private event Action valueChanged; 30 | /// 31 | /// An event fired whenever is changed. 32 | /// 33 | public event Action ValueChanged 34 | { 35 | add 36 | { 37 | valueChanged += value; 38 | this.TriggerValueChange(); 39 | } 40 | remove 41 | { 42 | valueChanged -= value; 43 | } 44 | } 45 | 46 | /// 47 | /// Converts a value into a representing that value. 48 | /// 49 | public static implicit operator Bindable(T other) => new Bindable(other); 50 | 51 | /// 52 | /// Creates a with a specified value. 53 | /// 54 | public Bindable(T value) 55 | { 56 | this.value = value; 57 | } 58 | 59 | private void TriggerValueChange() 60 | { 61 | if (valueChanged != null) 62 | { 63 | valueChanged.Invoke(this.value); 64 | } 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /Assets/Scripts/Bindables/Bindable.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a04b0d39f4a948c4dbde97b4ea7b7761 3 | timeCreated: 1525713809 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Bindables/BindableList.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | 4 | namespace OsuPlayground.Bindables 5 | { 6 | /// 7 | /// A utility class to avoid having to use a directly. 8 | /// 9 | public class BindableList : IEnumerable 10 | { 11 | private Dictionary bindables = new Dictionary(); 12 | 13 | public IEnumerator GetEnumerator() => ((IEnumerable)this.bindables).GetEnumerator(); 14 | 15 | /// 16 | /// Creates a new and adds it to the list. 17 | /// 18 | /// The name of the new . 19 | /// The value of the new . 20 | /// The created by this operation. 21 | public Bindable Add(string name, T value) 22 | { 23 | var newBindable = new Bindable(value); 24 | this.bindables.Add(name, newBindable); 25 | return newBindable; 26 | } 27 | 28 | /// 29 | /// Gets a by its name. 30 | /// 31 | /// The name of the to return. 32 | /// The found . 33 | public Bindable Get(string name) => (Bindable)this.bindables[name]; 34 | 35 | /// 36 | /// Gets the value of a by its name. 37 | /// 38 | /// The name of the to return the value of. 39 | /// The value of the found . 40 | public T Value(string name) => Get(name).Value; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Assets/Scripts/Bindables/BindableList.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7e8ae3683c0cdd4880e5451d1f63f2d 3 | timeCreated: 1525713809 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Constants.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace OsuPlayground 4 | { 5 | public static class Constants 6 | { 7 | /// 8 | /// Defines how many vertices a circle should have. 9 | /// 10 | public const int CIRCLE_RESOLUTION = 24; 11 | 12 | public const float TOOLBAR_HEIGHT = 40; 13 | public const float OPTIONS_WIDTH = 350; 14 | 15 | public static readonly Color TOOLBAR_COLOR = new Color(0.05f, 0.05f, 0.05f); 16 | public static readonly Color OPTIONS_COLOR = new Color(0.05f, 0.05f, 0.05f); 17 | public static readonly Color PLAYFIELD_COLOR = Color.black; 18 | 19 | public static readonly Color BORDER_COLOR = Color.white; 20 | public static readonly Color BODY_COLOR = new Color(0.15f, 0.15f, 0.15f); 21 | 22 | /// 23 | /// Defines the size of a circle's body relative to its border. 24 | /// 25 | public const float BODY_SIZE_MULTIPLIER = 0.85f; 26 | /// 27 | /// Defines the size of a tick relative to its parent's size. 28 | /// 29 | public const float TICK_SIZE_MULTIPLIER = 0.125f; 30 | 31 | /// 32 | /// Defines the size of a circle at CS4. Used for text size calculation. 33 | /// 34 | public const float BASE_CIRCLE_RADIUS = 36.48f; 35 | /// 36 | /// The size of text at CS4. 37 | /// 38 | public const float BASE_TEXT_SIZE = 35f; 39 | 40 | public static readonly Color HANDLE_COLOR = Color.yellow; 41 | public static readonly Color MULTIPLE_HANDLE_COLOR = Color.blue; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /Assets/Scripts/Constants.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e84f2f16d14e3f240bff5847dd4adb0e 3 | timeCreated: 1525361977 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2b527bfe8ecae747b183fec84669e1c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ApplicationBuilder.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using UnityEditor; 4 | 5 | public static class ApplicationBuilder 6 | { 7 | public static void Build() 8 | { 9 | var args = Environment.GetCommandLineArgs(); 10 | 11 | string version = null; 12 | string buildFolder = null; 13 | 14 | for (int i = 0; i < args.Length; i++) 15 | { 16 | if (args[i].ToUpperInvariant() == "-VERSION" && (i + 1) < args.Length) 17 | { 18 | version = args[i + 1]; 19 | } 20 | if (args[i].ToUpperInvariant() == "-BUILDFOLDER" && (i + 1) < args.Length) 21 | { 22 | buildFolder = args[i + 1]; 23 | } 24 | } 25 | 26 | if (version == null || buildFolder == null) 27 | { 28 | EditorApplication.Exit(7139); 29 | return; 30 | } 31 | 32 | var scenes = new[] { "Assets/Scenes/Screen.unity" }; 33 | 34 | BuildPipeline.BuildPlayer(new BuildPlayerOptions 35 | { 36 | locationPathName = Path.Combine(buildFolder, $"{version}/osuPlayground-{version}-win32/osuPlayground.exe"), 37 | scenes = scenes, 38 | targetGroup = BuildTargetGroup.Standalone, 39 | target = BuildTarget.StandaloneWindows 40 | }); 41 | BuildPipeline.BuildPlayer(new BuildPlayerOptions 42 | { 43 | locationPathName = Path.Combine(buildFolder, $"{version}/osuPlayground-{version}-win64/osuPlayground.exe"), 44 | scenes = scenes, 45 | targetGroup = BuildTargetGroup.Standalone, 46 | target = BuildTarget.StandaloneWindows64 47 | }); 48 | BuildPipeline.BuildPlayer(new BuildPlayerOptions 49 | { 50 | locationPathName = Path.Combine(buildFolder, $"{version}/osuPlayground-{version}-mac/osuPlayground.app"), 51 | scenes = scenes, 52 | targetGroup = BuildTargetGroup.Standalone, 53 | target = BuildTarget.StandaloneOSX 54 | }); 55 | BuildPipeline.BuildPlayer(new BuildPlayerOptions 56 | { 57 | locationPathName = Path.Combine(buildFolder, $"{version}/osuPlayground-{version}-linux/osuPlayground.x86_64"), 58 | scenes = scenes, 59 | targetGroup = BuildTargetGroup.Standalone, 60 | target = BuildTarget.StandaloneLinux64 61 | }); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Assets/Scripts/Editor/ApplicationBuilder.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3800975122a2b5a43864263f9d1ac787 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 277067bb2bbd81a4baa127da1678b5be 3 | folderAsset: yes 4 | timeCreated: 1525122898 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/BezierApproximator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cac0a570033816540a314aa194afd8b4 3 | timeCreated: 1525127274 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/CatmullApproximator.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | 4 | namespace OsuPlayground.HitObjects 5 | { 6 | // This code was adapted from the following file: 7 | // https://github.com/ppy/osu/blob/master/osu.Game/Rulesets/Objects/CatmullApproximator.cs 8 | public class CatmullApproximator 9 | { 10 | private const int detail = 50; 11 | 12 | private readonly List controlPoints; 13 | 14 | public CatmullApproximator(List controlPoints) 15 | { 16 | this.controlPoints = controlPoints; 17 | } 18 | 19 | public List CreateCatmull() 20 | { 21 | var result = new List(); 22 | 23 | for (int i = 0; i < this.controlPoints.Count - 1; i++) 24 | { 25 | var v1 = i > 0 ? this.controlPoints[i - 1] : this.controlPoints[i]; 26 | var v2 = this.controlPoints[i]; 27 | var v3 = i < this.controlPoints.Count - 1 ? this.controlPoints[i + 1] : v2 + v2 - v1; 28 | var v4 = i < this.controlPoints.Count - 2 ? this.controlPoints[i + 2] : v3 + v3 - v2; 29 | 30 | for (int c = 0; c < detail; c++) 31 | { 32 | result.Add(FindPoint(ref v1, ref v2, ref v3, ref v4, (float)c / detail)); 33 | result.Add(FindPoint(ref v1, ref v2, ref v3, ref v4, (float)(c + 1) / detail)); 34 | } 35 | } 36 | 37 | return result; 38 | } 39 | 40 | private Vector2 FindPoint(ref Vector2 vec1, ref Vector2 vec2, ref Vector2 vec3, ref Vector2 vec4, float t) 41 | { 42 | float t2 = t * t; 43 | float t3 = t * t2; 44 | 45 | Vector2 result = new Vector2( 46 | 0.5f * (2f * vec2.x + (-vec1.x + vec3.x) * t + (2f * vec1.x - 5f * vec2.x + 4f * vec3.x - vec4.x) * t2 + (-vec1.x + 3f * vec2.x - 3f * vec3.x + vec4.x) * t3), 47 | 0.5f * (2f * vec2.y + (-vec1.y + vec3.y) * t + (2f * vec1.y - 5f * vec2.y + 4f * vec3.y - vec4.y) * t2 + (-vec1.y + 3f * vec2.y - 3f * vec3.y + vec4.y) * t3)); 48 | 49 | return result; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/CatmullApproximator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bace5aad3fbf015448f724466fc0f721 3 | timeCreated: 1525127274 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/CircularArcApproximator.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.OsuMath; 2 | using System; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace OsuPlayground.HitObjects 7 | { 8 | // This code was adapted from the following file: 9 | // https://github.com/ppy/osu/blob/master/osu.Game/Rulesets/Objects/CircularArcApproximator.cs 10 | public class CircularArcApproximator 11 | { 12 | private readonly Vector2 a; 13 | private readonly Vector2 b; 14 | private readonly Vector2 c; 15 | 16 | private int amountPoints; 17 | 18 | private const float tolerance = 0.1f; 19 | 20 | public CircularArcApproximator(Vector2 a, Vector2 b, Vector2 c) 21 | { 22 | this.a = a; 23 | this.b = b; 24 | this.c = c; 25 | } 26 | 27 | public List CreateArc() 28 | { 29 | float aSq = (this.b - this.c).sqrMagnitude; 30 | float bSq = (this.a - this.c).sqrMagnitude; 31 | float cSq = (this.a - this.b).sqrMagnitude; 32 | 33 | if (Precision.AlmostEquals(aSq, 0) || Precision.AlmostEquals(bSq, 0) || Precision.AlmostEquals(cSq, 0)) 34 | { 35 | return new List(); 36 | } 37 | 38 | float s = aSq * (bSq + cSq - aSq); 39 | float t = bSq * (aSq + cSq - bSq); 40 | float u = cSq * (aSq + bSq - cSq); 41 | 42 | float sum = s + t + u; 43 | 44 | if (Precision.AlmostEquals(sum, 0)) 45 | { 46 | return new List(); 47 | } 48 | 49 | Vector2 centre = (s * this.a + t * this.b + u * this.c) / sum; 50 | Vector2 dA = this.a - centre; 51 | Vector2 dC = this.c - centre; 52 | 53 | float r = dA.magnitude; 54 | 55 | double thetaStart = Math.Atan2(dA.y, dA.x); 56 | double thetaEnd = Math.Atan2(dC.y, dC.x); 57 | 58 | while (thetaEnd < thetaStart) 59 | { 60 | thetaEnd += 2 * Math.PI; 61 | } 62 | 63 | double dir = 1; 64 | double thetaRange = thetaEnd - thetaStart; 65 | 66 | Vector2 orthoAtoC = this.c - this.a; 67 | orthoAtoC = new Vector2(orthoAtoC.y, -orthoAtoC.x); 68 | if (Vector2.Dot(orthoAtoC, this.b - this.a) < 0) 69 | { 70 | dir = -dir; 71 | thetaRange = 2 * Math.PI - thetaRange; 72 | } 73 | 74 | this.amountPoints = 2 * r <= tolerance ? 2 : Math.Max(2, (int)Math.Ceiling(thetaRange / (2 * Math.Acos(1 - tolerance / r)))); 75 | 76 | List output = new List(this.amountPoints); 77 | 78 | for (int i = 0; i < this.amountPoints; ++i) 79 | { 80 | double fract = (double)i / (this.amountPoints - 1); 81 | double theta = thetaStart + dir * fract * thetaRange; 82 | Vector2 o = new Vector2((float)Math.Cos(theta), (float)Math.Sin(theta)) * r; 83 | output.Add(centre + o); 84 | } 85 | 86 | return output; 87 | } 88 | } 89 | } -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/CircularArcApproximator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f32f7f27e678f5e4a9dec40d5a3ff9be 3 | timeCreated: 1525127274 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/CurveType.cs: -------------------------------------------------------------------------------- 1 | namespace OsuPlayground.HitObjects 2 | { 3 | public enum CurveType 4 | { 5 | Catmull, 6 | Bezier, 7 | Linear, 8 | PerfectCurve 9 | } 10 | } -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/CurveType.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89b3bc9aa9a61654ab21992e6761ee6c 3 | timeCreated: 1525127273 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f57f79970b016f548a2196c683df211b 3 | folderAsset: yes 4 | timeCreated: 1525372242 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36a09f6d243c6cc4ca2939e4867f19e9 3 | folderAsset: yes 4 | timeCreated: 1525372242 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Circle.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.HitObjects.Drawable.Components.Helpers; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace OsuPlayground.HitObjects.Drawable.Components 6 | { 7 | /// 8 | /// Represents both hit circles and slider heads. 9 | /// 10 | public class Circle : MaskableGraphic 11 | { 12 | public Vector2 Position; 13 | public float Radius; 14 | 15 | protected override void OnPopulateMesh(VertexHelper vh) 16 | { 17 | vh.Clear(); 18 | 19 | CircleDrawer.Circle(this.Position, vh, this.Radius, Constants.BORDER_COLOR); 20 | CircleDrawer.Circle(this.Position, vh, this.Radius * Constants.BODY_SIZE_MULTIPLIER, Constants.BODY_COLOR); 21 | 22 | this.GetComponent().radius = this.Radius; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Circle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c5bd3804393b2b240840edabd5b6e6a8 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 313a80bd5c3bbdc49a74328fe49954e8 3 | folderAsset: yes 4 | timeCreated: 1525372242 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers/CircleDrawer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace OsuPlayground.HitObjects.Drawable.Components.Helpers 5 | { 6 | /// 7 | /// Draws a circle. 8 | /// 9 | public static class CircleDrawer 10 | { 11 | public static void Circle(Vector2 position, VertexHelper vh, float radius, Color color) 12 | { 13 | var circlePoints = Constants.CIRCLE_RESOLUTION; 14 | 15 | var vertexIndex = vh.currentVertCount; 16 | 17 | vh.AddVert(MeshHelper.Vertex(position, color)); 18 | 19 | for (int i = 0; i < circlePoints; i++) 20 | { 21 | var offset = new Vector2( 22 | Mathf.Cos(i * 2 * Mathf.PI / (circlePoints)), 23 | Mathf.Sin(i * 2 * Mathf.PI / (circlePoints))); 24 | 25 | vh.AddVert(MeshHelper.Vertex(position + radius * offset, color)); 26 | } 27 | 28 | for (int i = 0; i < circlePoints; i++) 29 | { 30 | vh.AddTriangle( 31 | vertexIndex, 32 | vertexIndex + i % (circlePoints) + 1, 33 | vertexIndex + (i + 1) % (circlePoints) + 1); 34 | } 35 | } 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers/CircleDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 98edf4482fc1f694a9dc85b044f6bb79 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers/LineDrawer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace OsuPlayground.HitObjects.Drawable.Components.Helpers 6 | { 7 | /// 8 | /// Draws a line of arbitrary radius with rounded caps. 9 | /// 10 | public static class LineDrawer 11 | { 12 | /// 13 | /// Instead of calculating something logically, this function instead just draws an entire new segment with every pair of points. 14 | /// This means that there are several orders of magnitude more vertices than necessary, but it's mathematically easy (for me). 15 | /// 16 | public static void Line(List positions, VertexHelper vh, float radius, Color color) 17 | { 18 | var segmentCount = positions.Count - 1; 19 | 20 | if (segmentCount < 1) 21 | { 22 | return; 23 | } 24 | 25 | var vertexIndex = vh.currentVertCount; 26 | 27 | var circlePoints = Constants.CIRCLE_RESOLUTION; 28 | var capPoints = circlePoints / 2 + 1; 29 | 30 | for (int i = 0; i < segmentCount; i++) 31 | { 32 | var from = positions[i]; 33 | var to = positions[i + 1]; 34 | 35 | var angle = Mathf.Atan2(from.y - to.y, from.x - to.x); 36 | var fromAngle = angle - Mathf.PI / 2f; 37 | var toAngle = angle + Mathf.PI / 2f; 38 | 39 | var fromIndex = vh.currentVertCount; 40 | vh.AddVert(MeshHelper.Vertex(from, color)); 41 | 42 | for (int j = 0; j < capPoints; j++) 43 | { 44 | var offset = new Vector2( 45 | Mathf.Cos(fromAngle + j * 2 * Mathf.PI / circlePoints), 46 | Mathf.Sin(fromAngle + j * 2 * Mathf.PI / circlePoints)); 47 | 48 | vh.AddVert(MeshHelper.Vertex(from + radius * offset, color)); 49 | } 50 | 51 | for (int j = 0; j < capPoints; j++) 52 | { 53 | vh.AddTriangle( 54 | vertexIndex, 55 | vertexIndex + (j) % (capPoints) + 1, 56 | vertexIndex + (j + 1) % (capPoints) + 1); 57 | } 58 | 59 | vertexIndex = vh.currentVertCount; 60 | 61 | var toIndex = vh.currentVertCount; 62 | vh.AddVert(MeshHelper.Vertex(to, color)); 63 | 64 | for (int j = 0; j < capPoints; j++) 65 | { 66 | var offset = new Vector2( 67 | Mathf.Cos(toAngle + j * 2 * Mathf.PI / circlePoints), 68 | Mathf.Sin(toAngle + j * 2 * Mathf.PI / circlePoints)); 69 | 70 | vh.AddVert(MeshHelper.Vertex(to + radius * offset, color)); 71 | } 72 | 73 | for (int j = 0; j < capPoints; j++) 74 | { 75 | vh.AddTriangle( 76 | vertexIndex, 77 | vertexIndex + (j) % (capPoints) + 1, 78 | vertexIndex + (j + 1) % (capPoints) + 1); 79 | } 80 | 81 | vh.AddTriangle(toIndex, fromIndex + 1, fromIndex); 82 | vh.AddTriangle(toIndex, toIndex + capPoints, fromIndex + 1); 83 | vh.AddTriangle(fromIndex, toIndex + 1, toIndex); 84 | vh.AddTriangle(fromIndex, fromIndex + capPoints, toIndex + 1); 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers/LineDrawer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab369340f7ddf144daa353abaea683b2 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers/MeshHelper.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace OsuPlayground.HitObjects.Drawable.Components.Helpers 4 | { 5 | /// 6 | /// Creates cool vertices. 7 | /// 8 | public static class MeshHelper 9 | { 10 | public static UIVertex Vertex(Vector2 position, Color color) 11 | { 12 | return new UIVertex 13 | { 14 | position = position, 15 | color = color, 16 | normal = Vector3.forward 17 | }; 18 | } 19 | 20 | public static UIVertex Vertex(float x, float y, Color color) => Vertex(new Vector2(x, y), color); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/Helpers/MeshHelper.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a9cad7195505f540b0756b5936195c1 3 | timeCreated: 1525372242 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/SliderBody.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.HitObjects.Drawable.Components.Helpers; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace OsuPlayground.HitObjects.Drawable.Components 7 | { 8 | public class SliderBody : MaskableGraphic 9 | { 10 | public float Radius; 11 | public List Path; 12 | 13 | protected override void OnPopulateMesh(VertexHelper vh) 14 | { 15 | vh.Clear(); 16 | 17 | LineDrawer.Line(this.Path, vh, this.Radius, Constants.BORDER_COLOR); 18 | LineDrawer.Line(this.Path, vh, this.Radius * Constants.BODY_SIZE_MULTIPLIER, Constants.BODY_COLOR); 19 | 20 | var collider = this.GetComponent(); 21 | collider.center = this.Path[this.Path.Count - 1]; 22 | collider.radius = this.Radius; 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/SliderBody.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 868dbebb16d709043b02472fb40937d6 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/SliderTicks.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.HitObjects.Drawable.Components.Helpers; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace OsuPlayground.HitObjects.Drawable.Components 7 | { 8 | public class SliderTicks : MaskableGraphic 9 | { 10 | public float Radius; 11 | public List Positions; 12 | 13 | protected override void OnPopulateMesh(VertexHelper vh) 14 | { 15 | vh.Clear(); 16 | 17 | foreach (var position in this.Positions) 18 | { 19 | CircleDrawer.Circle(position, vh, this.Radius * Constants.TICK_SIZE_MULTIPLIER, Constants.BORDER_COLOR); 20 | } 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/Components/SliderTicks.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd748c64749fafa4aa5772a8977cf70f 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/DrawableHitCircle.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.OsuMath; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace OsuPlayground.HitObjects.Drawable 6 | { 7 | public class DrawableHitCircle : DrawableHitObject 8 | { 9 | private RectTransform rectTransform; 10 | 11 | private void Awake() => this.rectTransform = this.GetComponent(); 12 | 13 | public void UpdateWith(float radius, float ratio, HitCircle hitCircle, int index) 14 | { 15 | this.Index = index; 16 | 17 | this.rectTransform.anchoredPosition3D = new Vector3(0, 0, index * radius); 18 | 19 | this.Position = hitCircle.Position; 20 | 21 | this.Text.text = index.ToString(); 22 | var textSize = Mathf.RoundToInt(ratio * Constants.BASE_TEXT_SIZE * (radius / Constants.BASE_CIRCLE_RADIUS)); 23 | this.Text.fontSize = textSize; 24 | this.Text.enabled = textSize > 0; 25 | this.Text.rectTransform.anchoredPosition = ratio * this.Position.PlayfieldOffset(); 26 | 27 | this.Circle.rectTransform.anchoredPosition = ratio * this.Position.PlayfieldOffset(); 28 | this.Circle.Radius = ratio * radius; 29 | this.Circle.SetVerticesDirty(); 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/DrawableHitCircle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96ca32d2424c4e24ca4b039786cff2c4 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/DrawableHitObject.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.HitObjects.Drawable.Components; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace OsuPlayground.HitObjects.Drawable 6 | { 7 | public abstract class DrawableHitObject : MonoBehaviour 8 | { 9 | public Vector2 Position; 10 | public int Index; 11 | 12 | public Text Text; 13 | public Circle Circle; 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/DrawableHitObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87c5d3b55e9d4cb459f1b7d8a9b20fe7 3 | timeCreated: 1525372243 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/DrawableSlider.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using System.Linq; 3 | using OsuPlayground.HitObjects.Drawable.Components; 4 | using OsuPlayground.OsuMath; 5 | using UnityEngine; 6 | 7 | namespace OsuPlayground.HitObjects.Drawable 8 | { 9 | public class DrawableSlider : DrawableHitObject 10 | { 11 | public SliderBody Body; 12 | public SliderTicks Ticks; 13 | 14 | public Slider Slider; 15 | 16 | private RectTransform rectTransform; 17 | 18 | private void Awake() => this.rectTransform = this.GetComponent(); 19 | 20 | public void UpdateWith(float radius, float ratio, Slider slider, int index) 21 | { 22 | this.Index = index; 23 | this.Slider = slider; 24 | 25 | this.rectTransform.anchoredPosition3D = new Vector3(0, 0, index * radius); 26 | 27 | this.Position = slider.Position; 28 | 29 | this.Text.text = index.ToString(); 30 | var textSize = Mathf.RoundToInt(ratio * Constants.BASE_TEXT_SIZE * (radius / Constants.BASE_CIRCLE_RADIUS)); 31 | this.Text.fontSize = textSize; 32 | this.Text.enabled = textSize > 0; 33 | this.Text.rectTransform.anchoredPosition = ratio * this.Position.PlayfieldOffset(); 34 | 35 | this.Circle.rectTransform.anchoredPosition = ratio * this.Position.PlayfieldOffset(); 36 | this.Circle.Radius = ratio * radius; 37 | this.Circle.SetVerticesDirty(); 38 | 39 | this.Body.Radius = ratio * radius; 40 | this.Body.Path = slider.GetPath().Select(x => ratio * x.PlayfieldOffset()).ToList(); 41 | this.Body.SetVerticesDirty(); 42 | 43 | // Calculate the positions of ticks and draw them accordingly. 44 | var tickDistance = 100 * Options.SliderMultiplier.Value * Options.SpeedMultiplier.Value / Options.TickRate.Value; 45 | 46 | List tickPositions = new List(); 47 | for (float i = 0; i < slider.Length; i += tickDistance) 48 | { 49 | var tickPosition = slider.PositionAt(i / slider.Length); 50 | tickPositions.Add(ratio * tickPosition.PlayfieldOffset()); 51 | } 52 | 53 | this.Ticks.Radius = ratio * radius; 54 | this.Ticks.Positions = tickPositions; 55 | this.Ticks.SetVerticesDirty(); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Drawable/DrawableSlider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24eb45fab2dbe944c849e88409532cd0 3 | timeCreated: 1525372242 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/HitCircle.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace OsuPlayground.HitObjects 4 | { 5 | public class HitCircle : HitObject 6 | { 7 | public override string ToString() => String.Format("circle: {0},{1}", Math.Round(this.Position.x), Math.Round(this.Position.y)); 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/HitCircle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 435c11d52b99a6d4cb0f6e8459323432 3 | timeCreated: 1525122898 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/HitObject.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace OsuPlayground.HitObjects 4 | { 5 | public abstract class HitObject 6 | { 7 | public Vector2 Position; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/HitObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80b61746c6d0a5e4b856fe96d4af0922 3 | timeCreated: 1525122898 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/HitObjects/Slider.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 05efe2cadb3c3b94aafed9f983bd0da4 3 | timeCreated: 1525127273 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/Options.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.Bindables; 2 | 3 | namespace OsuPlayground 4 | { 5 | public static class Options 6 | { 7 | /// 8 | /// Resets every option. 9 | /// 10 | public static void Reset() 11 | { 12 | ShowOptions = true; 13 | CircleSize = 4; 14 | SliderMultiplier = 1.4f; 15 | SpeedMultiplier = 1; 16 | TickRate = 1; 17 | BeatSnapDivisor = 4; 18 | } 19 | 20 | /// 21 | /// Defines if the options panel should be shown. 22 | /// 23 | public static Bindable ShowOptions = true; 24 | 25 | /// 26 | /// Defines the osu! "Circle Size" value. 27 | /// 28 | public static Bindable CircleSize = 4; 29 | 30 | /// 31 | /// Defines the osu! "slider multiplier" value. Also known as "slider velocity." 32 | /// 33 | public static Bindable SliderMultiplier = 1.4f; 34 | /// 35 | /// Defines the osu! "speed multiplier" value. Also known as "slider velocity multiplier." 36 | /// 37 | public static Bindable SpeedMultiplier = 1; 38 | 39 | /// 40 | /// Defines how often ticks are drawn on a slider's body. 41 | /// 42 | public static Bindable TickRate = 1; 43 | 44 | /// 45 | /// Defines how many beats a measure is divided into, which controls how sliders are shortened when too long. 46 | /// 47 | public static Bindable BeatSnapDivisor = 4; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /Assets/Scripts/Options.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 966ead27447d4074993ceca61d0dd9aa 3 | timeCreated: 1525290053 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/OsuMath.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0badbb669f632840a3e88cc530e3f34 3 | folderAsset: yes 4 | timeCreated: 1525795354 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/OsuMath/Precision.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace OsuPlayground.OsuMath 5 | { 6 | // This code was adapted from the following file: 7 | // https://github.com/ppy/osu-framework/blob/master/osu.Framework/MathUtils/Precision.cs 8 | public static class Precision 9 | { 10 | public const float FLOAT_EPSILON = 1e-3f; 11 | public const double DOUBLE_EPSILON = 1e-7; 12 | 13 | public static bool DefinitelyBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) => value1 - acceptableDifference > value2; 14 | 15 | public static bool DefinitelyBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) => value1 - acceptableDifference > value2; 16 | 17 | public static bool AlmostBigger(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) => value1 > value2 - acceptableDifference; 18 | 19 | public static bool AlmostBigger(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) => value1 > value2 - acceptableDifference; 20 | 21 | public static bool AlmostEquals(float value1, float value2, float acceptableDifference = FLOAT_EPSILON) => Math.Abs(value1 - value2) <= acceptableDifference; 22 | 23 | public static bool AlmostEquals(Vector2 value1, Vector2 value2, float acceptableDifference = FLOAT_EPSILON) => AlmostEquals(value1.x, value2.x, acceptableDifference) && AlmostEquals(value1.y, value2.y, acceptableDifference); 24 | 25 | public static bool AlmostEquals(double value1, double value2, double acceptableDifference = DOUBLE_EPSILON) => Math.Abs(value1 - value2) <= acceptableDifference; 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Assets/Scripts/OsuMath/Precision.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b69998c201be5fe4f969680be065577a 3 | timeCreated: 1525362791 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/OsuMath/VectorMath.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.UI; 2 | using UnityEngine; 3 | 4 | namespace OsuPlayground.OsuMath 5 | { 6 | public static class VectorMath 7 | { 8 | /// 9 | /// Offsets an input position to account for the osu! playfield coordinate system. 10 | /// 11 | public static Vector2 PlayfieldOffset(this Vector2 input) 12 | { 13 | return new Vector2( 14 | input.x - Playfield.WIDTH / 2, 15 | -input.y + Playfield.HEIGHT / 2); 16 | } 17 | 18 | public static Vector2 Rotate(this Vector2 point, float angle) => point.Rotate(Vector3.zero, angle); 19 | 20 | public static Vector2 Rotate(this Vector2 point, Vector2 around, float angle) 21 | { 22 | var temporaryPoint = point - around; 23 | 24 | float sin = Mathf.Sin(angle); 25 | float cos = Mathf.Cos(angle); 26 | 27 | float tx = temporaryPoint.x; 28 | float ty = temporaryPoint.y; 29 | temporaryPoint.x = (cos * tx) - (sin * ty); 30 | temporaryPoint.y = (sin * tx) + (cos * ty); 31 | 32 | return temporaryPoint + around; 33 | } 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /Assets/Scripts/OsuMath/VectorMath.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ea2136f4dfe6da4f9147f0cd1fafb82 3 | timeCreated: 1525362791 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Playground.cs: -------------------------------------------------------------------------------- 1 | using Jint.Runtime; 2 | using OsuPlayground.Scripting; 3 | using OsuPlayground.UI; 4 | using OsuPlayground.UI.Panels; 5 | using SFB; 6 | using System; 7 | using System.IO; 8 | using UnityEngine; 9 | using UnityEngine.UI; 10 | 11 | namespace OsuPlayground 12 | { 13 | /// 14 | /// The main controller for the application. 15 | /// 16 | public class Playground : MonoBehaviour 17 | { 18 | public static GameObject ToolbarButtonPrefab; 19 | 20 | public static GameObject OptionNumberPrefab; 21 | public static GameObject OptionBoolPrefab; 22 | public static GameObject OptionVector2Prefab; 23 | public static GameObject OptionChoicePrefab; 24 | 25 | public static GameObject DrawableHitCirclePrefab; 26 | public static GameObject DrawableSliderPrefab; 27 | 28 | public static GameObject HandlePrefab; 29 | 30 | [Header("Prefabs")] 31 | [SerializeField] 32 | private GameObject toolbarButtonPrefab; 33 | 34 | [SerializeField] 35 | private GameObject optionNumberPrefab; 36 | [SerializeField] 37 | private GameObject optionBoolPrefab; 38 | [SerializeField] 39 | private GameObject optionVector2Prefab; 40 | [SerializeField] 41 | private GameObject optionChoicePrefab; 42 | 43 | [SerializeField] 44 | private GameObject drawableHitCirclePrefab; 45 | [SerializeField] 46 | private GameObject drawableSliderPrefab; 47 | 48 | [SerializeField] 49 | private GameObject handlePrefab; 50 | 51 | [Header("References")] 52 | [SerializeField] 53 | private ScriptManager scriptManager; 54 | [SerializeField] 55 | private OptionsPanel optionsPanel; 56 | [SerializeField] 57 | private ToolbarPanel toolbarPanel; 58 | [SerializeField] 59 | private PlayfieldPanel playfieldPanel; 60 | [SerializeField] 61 | private ErrorPanel errorPanel; 62 | [SerializeField] 63 | private Playfield playfield; 64 | 65 | private void Awake() 66 | { 67 | Options.Reset(); 68 | 69 | ToolbarButtonPrefab = this.toolbarButtonPrefab; 70 | OptionNumberPrefab = this.optionNumberPrefab; 71 | OptionBoolPrefab = this.optionBoolPrefab; 72 | OptionVector2Prefab = this.optionVector2Prefab; 73 | OptionChoicePrefab = this.optionChoicePrefab; 74 | DrawableHitCirclePrefab = this.drawableHitCirclePrefab; 75 | DrawableSliderPrefab = this.drawableSliderPrefab; 76 | HandlePrefab = this.handlePrefab; 77 | 78 | this.scriptManager = FindObjectOfType(); 79 | } 80 | 81 | private void Start() 82 | { 83 | if (!String.IsNullOrWhiteSpace(this.scriptManager.CurrentPath)) 84 | { 85 | this.toolbarPanel.Text.text = Path.GetFileName(this.scriptManager.CurrentPath); 86 | } 87 | 88 | if (!String.IsNullOrWhiteSpace(this.scriptManager.Error)) 89 | { 90 | this.errorPanel.Text.text = this.scriptManager.Error; 91 | this.errorPanel.gameObject.SetActive(true); 92 | this.scriptManager.Error = null; 93 | } 94 | else 95 | { 96 | if (!String.IsNullOrWhiteSpace(this.scriptManager.CurrentPath)) 97 | { 98 | this.scriptManager.Load(); 99 | } 100 | } 101 | 102 | // Blue. 103 | var optionColor = new Color(0.184313725f, 0.631372549f, 0.839215686f); 104 | this.optionsPanel.AddOption(Options.CircleSize, "Circle size", 1, 0, 10, optionColor); 105 | this.optionsPanel.AddOption(Options.SliderMultiplier, "Slider multiplier", 2, 0.4f, 3.6f, optionColor); 106 | this.optionsPanel.AddOption(Options.SpeedMultiplier, "Speed multiplier", 2, 0.1f, 10, optionColor); 107 | this.optionsPanel.AddOption(Options.TickRate, "Tick rate", 1, 4, optionColor); 108 | this.optionsPanel.AddOption(Options.BeatSnapDivisor, "Beat snap", 1, 16, optionColor); 109 | 110 | this.toolbarPanel.AddButton("Load file", this.LoadFile, ToolbarSide.Left); 111 | this.toolbarPanel.AddButton("Reload", this.Reload, ToolbarSide.Left); 112 | this.toolbarPanel.AddButton("Copy code", this.CopyCode, ToolbarSide.Left); 113 | this.toolbarPanel.AddButton("Reset zoom", this.ResetZoom, ToolbarSide.Left); 114 | 115 | this.toolbarPanel.AddButton("Hide", this.ToggleOptions, ToolbarSide.Right); 116 | this.toolbarPanel.AddButton("Open wiki", this.OpenWiki, ToolbarSide.Right); 117 | 118 | try 119 | { 120 | this.scriptManager.StartFunction(); 121 | } 122 | catch (JavaScriptException e) 123 | { 124 | this.scriptManager.ReloadError("Error in start(): " + e.Message); 125 | } 126 | } 127 | 128 | private void Update() 129 | { 130 | try 131 | { 132 | this.scriptManager.UpdateFunction(); 133 | } 134 | catch (JavaScriptException e) 135 | { 136 | this.scriptManager.ReloadError("Error in update(): " + e.Message); 137 | } 138 | } 139 | 140 | private void LoadFile(Button button) 141 | { 142 | // Unity does not provide a way to open a file prompt, so I had to use a library to do it. 143 | // I will admit that the library is wonderful. 144 | StandaloneFileBrowser.OpenFilePanelAsync("Load file", String.Empty, new ExtensionFilter[] 145 | { 146 | new ExtensionFilter("osu!Playground scripts", "oss", "js" ), 147 | new ExtensionFilter("All Files", "*" ), 148 | }, false, files => { 149 | if (files == null || files.Length < 1) 150 | { 151 | return; 152 | } 153 | 154 | this.scriptManager.Reload(files[0]); 155 | }); 156 | } 157 | 158 | private void Reload(Button button) 159 | { 160 | if (String.IsNullOrWhiteSpace(this.scriptManager.CurrentPath)) 161 | { 162 | return; 163 | } 164 | 165 | this.scriptManager.Reload(this.scriptManager.CurrentPath); 166 | } 167 | 168 | private void CopyCode(Button button) => GUIUtility.systemCopyBuffer = this.playfield.LatestHitObjects; 169 | 170 | private void ResetZoom(Button button) 171 | { 172 | this.playfieldPanel.RawOffset = Vector2.zero; 173 | this.playfieldPanel.RawZoom = 0; 174 | } 175 | 176 | private void ToggleOptions(Button button) 177 | { 178 | Options.ShowOptions.Value = !Options.ShowOptions.Value; 179 | 180 | button.GetComponentInChildren().text = Options.ShowOptions.Value ? "Hide" : "Show"; 181 | } 182 | 183 | private void OpenWiki(Button button) => Application.OpenURL("https://github.com/Poyo-SSB/osu-playground/wiki"); 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /Assets/Scripts/Playground.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7629c7db16ae0f34f9cd7635cbe24321 3 | timeCreated: 1525361976 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Scripting.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a75c1432b1e80354bbe88b6358916362 3 | folderAsset: yes 4 | timeCreated: 1525724223 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/Scripting/ScriptManager.cs: -------------------------------------------------------------------------------- 1 | using Jint; 2 | using OsuPlayground.Bindables; 3 | using OsuPlayground.UI; 4 | using OsuPlayground.UI.Handles; 5 | using OsuPlayground.UI.Panels; 6 | using System; 7 | using System.IO; 8 | using UnityEngine; 9 | using UnityEngine.SceneManagement; 10 | 11 | namespace OsuPlayground.Scripting 12 | { 13 | /// 14 | /// Controls the loading of scripts. 15 | /// 16 | public class ScriptManager : MonoBehaviour 17 | { 18 | private string baseCode; 19 | 20 | /// 21 | /// The path to the last script which was attempted to be loaded. 22 | /// 23 | public string CurrentPath; 24 | 25 | /// 26 | /// If not empty, an error message which describes errors in the file located at . 27 | /// 28 | public string Error; 29 | 30 | public Action StartFunction = () => { return; }; 31 | public Action UpdateFunction = () => { return; }; 32 | 33 | private void Awake() 34 | { 35 | // There can only be one. 36 | if (FindObjectsOfType().Length > 1) 37 | { 38 | Destroy(this.gameObject); 39 | } 40 | else 41 | { 42 | DontDestroyOnLoad(this.gameObject); 43 | } 44 | 45 | // Load utility code for injection into user scripts. 46 | this.baseCode = ((TextAsset)Resources.Load("framework")).text; 47 | } 48 | 49 | public void Reload(string path) 50 | { 51 | // Reload the scene to reset everything quickly because I am lazy. 52 | this.CurrentPath = path; 53 | SceneManager.LoadScene(SceneManager.GetActiveScene().name, LoadSceneMode.Single); 54 | } 55 | 56 | public void ReloadError(string error) 57 | { 58 | this.StartFunction = () => { return; }; 59 | this.UpdateFunction = () => { return; }; 60 | SceneManager.LoadScene(SceneManager.GetActiveScene().name, LoadSceneMode.Single); 61 | this.Error = error; 62 | } 63 | 64 | public void Load() 65 | { 66 | var code = File.ReadAllText(this.CurrentPath); 67 | 68 | // Create JavaScript engine and allow access to relevant libraries. 69 | var engine = new Engine(cfg => cfg.AllowClr(typeof(Vector2).Assembly, typeof(Playground).Assembly)); 70 | 71 | // Allow user to do things. 72 | engine.SetValue("Playground", new ScriptUtilites( 73 | new BindableList(), 74 | FindObjectOfType(), 75 | FindObjectOfType(), 76 | FindObjectOfType())); 77 | 78 | try 79 | { 80 | engine.Execute(code + this.baseCode); 81 | } 82 | catch (Exception e) 83 | { 84 | // In the event of a parse error or something, tell the user. 85 | this.ReloadError("Error while loading: " + e.Message); 86 | return; 87 | } 88 | 89 | this.StartFunction = () => engine.Invoke("start"); 90 | this.UpdateFunction = () => engine.Invoke("update"); 91 | } 92 | } 93 | } 94 | -------------------------------------------------------------------------------- /Assets/Scripts/Scripting/ScriptManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0ed1b05492742b4fb7599ccea3a1496 3 | timeCreated: 1525724224 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/Scripting/ScriptUtilities.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.Bindables; 2 | using OsuPlayground.HitObjects; 3 | using OsuPlayground.UI; 4 | using OsuPlayground.UI.Handles; 5 | using OsuPlayground.UI.Panels; 6 | using System.Linq; 7 | using UnityEngine; 8 | 9 | namespace OsuPlayground.Scripting 10 | { 11 | public class ScriptUtilites 12 | { 13 | // Utility constants. 14 | public const int PLAYFIELD_WIDTH = 512; 15 | public const int PLAYFIELD_HEIGHT = 384; 16 | 17 | // Used for creating sidebar options. 18 | private static readonly Color green = new Color(0.525490196f, 0.898039216f, 0.278431373f); 19 | 20 | private BindableList variables; 21 | private Playfield playfield; 22 | private HandleManager handleManager; 23 | private OptionsPanel optionsPanel; 24 | 25 | public ScriptUtilites(BindableList variables, Playfield playfield, HandleManager handleManager, OptionsPanel optionsPanel) 26 | { 27 | this.variables = variables; 28 | this.playfield = playfield; 29 | this.handleManager = handleManager; 30 | this.optionsPanel = optionsPanel; 31 | } 32 | 33 | public Bindable AddFloat(string name, float input) 34 | => this.variables.Add(name, input); 35 | 36 | public Bindable AddInt(string name, int input) 37 | => this.variables.Add(name, input); 38 | 39 | public Bindable AddBool(string name, bool input) 40 | => this.variables.Add(name, input); 41 | 42 | public Bindable AddVector2(string name, Vector2 input) 43 | => this.variables.Add(name, input); 44 | 45 | public Bindable AddChoice(string name, string input) 46 | => this.variables.Add(name, input); 47 | 48 | // Repeated methods like this are a result of the fact that Jint is unwilling to automatically convert values. 49 | // For example, using pure C#, this first function can be called with only numbers, and they will be implicitly converted. 50 | public void AddOptionFloat(Bindable variable, string name, int precision, Bindable min, Bindable max) 51 | => this.optionsPanel.AddOption(variable, name, precision, min, max, green); 52 | public void AddOptionFloat(Bindable variable, string name, int precision, float min, Bindable max) 53 | => this.optionsPanel.AddOption(variable, name, precision, min, max, green); 54 | public void AddOptionFloat(Bindable variable, string name, int precision, Bindable min, float max) 55 | => this.optionsPanel.AddOption(variable, name, precision, min, max, green); 56 | public void AddOptionFloat(Bindable variable, string name, int precision, float min, float max) 57 | => this.optionsPanel.AddOption(variable, name, precision, min, max, green); 58 | 59 | public void AddOptionInt(Bindable variable, string name, Bindable min, Bindable max) 60 | => this.optionsPanel.AddOption(variable, name, min, max, green); 61 | public void AddOptionInt(Bindable variable, string name, int min, Bindable max) 62 | => this.optionsPanel.AddOption(variable, name, min, max, green); 63 | public void AddOptionInt(Bindable variable, string name, Bindable min, int max) 64 | => this.optionsPanel.AddOption(variable, name, min, max, green); 65 | public void AddOptionInt(Bindable variable, string name, int min, int max) 66 | => this.optionsPanel.AddOption(variable, name, min, max, green); 67 | 68 | public void AddOptionBool(Bindable variable, string name) 69 | => this.optionsPanel.AddOption(variable, name, green); 70 | 71 | public void AddOptionVector2(Bindable variable, string name) 72 | { 73 | this.optionsPanel.AddOption(variable, name, green); 74 | // Also create a draggable handle. 75 | this.handleManager.CreateHandle(variable); 76 | } 77 | 78 | public void AddOptionChoice(Bindable variable, string name, object[] values) 79 | => this.optionsPanel.AddOption(variable, name, values.Cast().ToList(), green); 80 | 81 | public float GetValueFloat(string name) 82 | => this.variables.Value(name); 83 | 84 | public int GetValueInt(string name) 85 | => this.variables.Value(name); 86 | 87 | public bool GetValueBool(string name) 88 | => this.variables.Value(name); 89 | 90 | public Vector2 GetValueVector2(string name) 91 | => this.variables.Value(name); 92 | 93 | public string GetValueChoice(string name) 94 | => this.variables.Value(name); 95 | 96 | public HitCircle AddHitCircle(Vector2 position, bool draw) 97 | => this.playfield.HitCircle(position, draw); 98 | public HitCircle AddHitCircle(Vector2 position) 99 | => this.playfield.HitCircle(position, true); 100 | 101 | // Jint passes JavaScript arrays to C# code as objects[], hence the casting. 102 | public Slider AddSlider(CurveType curveType, object[] list) 103 | => this.playfield.Slider(curveType, list.Cast().ToList()); 104 | public Slider AddSlider(CurveType curveType, object[] list, bool draw) 105 | => this.playfield.Slider(curveType, list.Cast().ToList(), draw); 106 | public Slider AddSlider(CurveType curveType, object[] list, bool draw, float length) 107 | => this.playfield.Slider(curveType, list.Cast().ToList(), draw, length); 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /Assets/Scripts/Scripting/ScriptUtilities.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e736007002afc7346b13abdcf6c1524e 3 | timeCreated: 1525724224 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccd22d71f09c2d74f9328c14aa5a5654 3 | folderAsset: yes 4 | timeCreated: 1525199291 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Border.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace OsuPlayground.UI 5 | { 6 | /// 7 | /// Draws a border of a specified width which contains its 's area. 8 | /// 9 | public class Border : MaskableGraphic 10 | { 11 | public float Width = 3; 12 | 13 | private UIVertex[] Quad(params Vector3[] positions) 14 | { 15 | var vertices = new UIVertex[4]; 16 | for (int i = 0; i < 4; i++) 17 | { 18 | vertices[i] = new UIVertex 19 | { 20 | position = positions[i], 21 | color = this.color 22 | }; 23 | } 24 | return vertices; 25 | } 26 | 27 | protected override void OnPopulateMesh(VertexHelper vh) 28 | { 29 | // Manually define eight vertices and triangles. 30 | 31 | vh.Clear(); 32 | 33 | Vector2 from = this.rectTransform.rect.min; 34 | Vector2 to = this.rectTransform.rect.max; 35 | 36 | Vector3 inner0 = new Vector3(to.x, to.y); 37 | Vector3 inner1 = new Vector3(to.x, from.y); 38 | Vector3 inner2 = new Vector3(from.x, from.y); 39 | Vector3 inner3 = new Vector3(from.x, to.y); 40 | Vector3 outer0 = new Vector3(to.x + this.Width, to.y + this.Width); 41 | Vector3 outer1 = new Vector3(to.x + this.Width, from.y - this.Width); 42 | Vector3 outer2 = new Vector3(from.x - this.Width, from.y - this.Width); 43 | Vector3 outer3 = new Vector3(from.x - this.Width, to.y + this.Width); 44 | 45 | vh.AddUIVertexQuad(Quad(inner0, inner1, outer1, outer0)); 46 | vh.AddUIVertexQuad(Quad(inner1, inner2, outer2, outer1)); 47 | vh.AddUIVertexQuad(Quad(inner2, inner3, outer3, outer2)); 48 | vh.AddUIVertexQuad(Quad(inner3, inner0, outer0, outer3)); 49 | } 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Border.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a29c0e6838c8154dba41abd55783c0e 3 | timeCreated: 1525199253 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Handles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e4d59897c808e34398056cd00125da1 3 | folderAsset: yes 4 | timeCreated: 1525451103 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Handles/Handle.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.Bindables; 2 | using OsuPlayground.OsuMath; 3 | using UnityEngine; 4 | using UnityEngine.EventSystems; 5 | using UnityEngine.UI; 6 | 7 | namespace OsuPlayground.UI.Handles 8 | { 9 | public class Handle : MonoBehaviour, IPointerEnterHandler, IPointerExitHandler, IDragHandler, IEndDragHandler 10 | { 11 | [HideInInspector] 12 | public HandleManager Manager; 13 | 14 | private RectTransform rectTransform; 15 | 16 | [SerializeField] 17 | private Image center; 18 | 19 | public Bindable Bound; 20 | 21 | private float ratio; 22 | 23 | private void Awake() => this.rectTransform = this.GetComponent(); 24 | 25 | public void OnDrag(PointerEventData eventData) 26 | { 27 | // Set the color because the handles lag behind by one frame for some reason which I don't care enough to ascertain. 28 | if (eventData.button == PointerEventData.InputButton.Left) 29 | { 30 | this.center.color = Constants.HANDLE_COLOR; 31 | this.Bound.Value += new Vector2(eventData.delta.x, -eventData.delta.y) / this.ratio; 32 | } 33 | else if (eventData.button == PointerEventData.InputButton.Right) 34 | { 35 | this.center.color = Constants.MULTIPLE_HANDLE_COLOR; 36 | this.Manager.MoveAll(new Vector2(eventData.delta.x, -eventData.delta.y) / this.ratio); 37 | } 38 | } 39 | 40 | public void OnEndDrag(PointerEventData eventData) => this.center.color = Color.white; 41 | 42 | public void OnPointerEnter(PointerEventData eventData) => this.center.color = Constants.HANDLE_COLOR; 43 | 44 | public void OnPointerExit(PointerEventData eventData) => this.center.color = Color.white; 45 | 46 | public void UpdatePosition(float ratio) 47 | { 48 | this.ratio = ratio; 49 | this.rectTransform.anchoredPosition = this.Bound.Value.PlayfieldOffset() * ratio; 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /Assets/Scripts/UI/Handles/Handle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3c75be30ed582d428fccec339605762 3 | timeCreated: 1525451104 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Handles/HandleManager.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.Bindables; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace OsuPlayground.UI.Handles 6 | { 7 | public class HandleManager : MonoBehaviour 8 | { 9 | [HideInInspector] 10 | public RectTransform RectTransform; 11 | 12 | private List handles = new List(); 13 | 14 | private void Awake() => this.RectTransform = this.GetComponent(); 15 | 16 | public void CreateHandle(Bindable variable) 17 | { 18 | var handle = Instantiate(Playground.HandlePrefab, this.transform).GetComponent(); 19 | handle.Bound = variable; 20 | handle.Manager = this; 21 | 22 | this.handles.Add(handle); 23 | } 24 | 25 | private void Update() 26 | { 27 | foreach (var handle in this.handles) 28 | { 29 | handle.UpdatePosition(this.RectTransform.rect.width / Playfield.WIDTH); 30 | } 31 | } 32 | 33 | public void MoveAll(Vector2 delta) 34 | { 35 | foreach (var handle in this.handles) 36 | { 37 | handle.Bound.Value += delta; 38 | } 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Handles/HandleManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7da7688236a02a49af76d18c30322c2 3 | timeCreated: 1525451103 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 90936e6e918ebaf4f80e32a145e5dc3d 3 | folderAsset: yes 4 | timeCreated: 1525362970 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/Option.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace OsuPlayground.UI.OptionObjects 5 | { 6 | /// 7 | /// Defines a base class for option objects which are manipulable in the sidebar. 8 | /// 9 | public abstract class Option : MonoBehaviour 10 | { 11 | public Text Text; 12 | public Image ColorBar; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/Option.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e927d456ff8db949af5f4ec7e7c463d 3 | timeCreated: 1525362970 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionBool.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UI; 2 | 3 | namespace OsuPlayground.UI.OptionObjects 4 | { 5 | public class OptionBool : Option 6 | { 7 | public Toggle Toggle; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionBool.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bc0be8b3cf4b0b3488da1cc63a903294 3 | timeCreated: 1525485988 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionChoice.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UI; 2 | 3 | namespace OsuPlayground.UI.OptionObjects 4 | { 5 | public class OptionChoice : Option 6 | { 7 | public Dropdown Dropdown; 8 | } 9 | } 10 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionChoice.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9dc43f42922d0e74bb32d5efe4973404 3 | timeCreated: 1526053984 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionNumber.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UI; 2 | 3 | namespace OsuPlayground.UI.OptionObjects 4 | { 5 | public class OptionNumber : Option 6 | { 7 | public InputField InputField; 8 | public Slider Slider; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionNumber.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0a2502f29d3c4e24585c87198acb0759 3 | timeCreated: 1525362970 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionVector2.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.UI; 2 | 3 | namespace OsuPlayground.UI.OptionObjects 4 | { 5 | public class OptionVector2 : Option 6 | { 7 | public InputField InputFieldX; 8 | public InputField InputFieldY; 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/OptionObjects/OptionVector2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e051ac6349472a645b6de820235de7c6 3 | timeCreated: 1525362970 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/PanelManager.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.UI.Panels; 2 | using UnityEngine; 3 | 4 | namespace OsuPlayground.UI 5 | { 6 | /// 7 | /// Very powerful class. Treat carefully. Controls all panels. 8 | /// 9 | public class PanelManager : MonoBehaviour 10 | { 11 | private RectTransform rectTransform; 12 | 13 | [SerializeField] 14 | private ToolbarPanel toolbar; 15 | [SerializeField] 16 | private OptionsPanel options; 17 | [SerializeField] 18 | private PlayfieldPanel playfield; 19 | 20 | private void Awake() => this.rectTransform = this.GetComponent(); 21 | 22 | /// 23 | /// Positions each panel. 24 | /// 25 | private void Update() 26 | { 27 | var optionsWidth = Options.ShowOptions.Value ? Constants.OPTIONS_WIDTH : 0; 28 | 29 | this.toolbar.Background.color = Constants.TOOLBAR_COLOR; 30 | this.toolbar.RectTransform.anchoredPosition = Vector2.zero; 31 | this.toolbar.RectTransform.sizeDelta = new Vector2(Screen.width, Constants.TOOLBAR_HEIGHT); 32 | 33 | this.options.Background.color = Constants.OPTIONS_COLOR; 34 | this.options.RectTransform.anchoredPosition = new Vector2(Screen.width - optionsWidth, Constants.TOOLBAR_HEIGHT); 35 | this.options.RectTransform.sizeDelta = new Vector2(optionsWidth, Screen.height - Constants.TOOLBAR_HEIGHT); 36 | 37 | this.playfield.Background.color = Constants.PLAYFIELD_COLOR; 38 | this.playfield.RectTransform.anchoredPosition = new Vector2(0, Constants.TOOLBAR_HEIGHT); 39 | this.playfield.RectTransform.sizeDelta = new Vector2(Screen.width - optionsWidth, Screen.height - Constants.TOOLBAR_HEIGHT); 40 | 41 | this.options.CanvasGroup.alpha = Options.ShowOptions.Value ? 1 : 0; 42 | this.options.CanvasGroup.blocksRaycasts = Options.ShowOptions.Value; 43 | } 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/PanelManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6337c051d077ffc4fb1b6ac5180c9228 3 | timeCreated: 1525363296 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7a4e463dbccad44f9cf6a2e23b6b45d 3 | folderAsset: yes 4 | timeCreated: 1525363296 5 | licenseType: Free 6 | DefaultImporter: 7 | externalObjects: {} 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/ErrorPanel.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine.EventSystems; 2 | using UnityEngine.UI; 3 | 4 | namespace OsuPlayground.UI.Panels 5 | { 6 | /// 7 | /// Defines a pseudo-modal window showing an error when a script fails to load. 8 | /// 9 | public class ErrorPanel : Panel, IPointerClickHandler 10 | { 11 | public Text Text; 12 | 13 | public void OnPointerClick(PointerEventData eventData) => this.gameObject.SetActive(false); 14 | } 15 | } 16 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/ErrorPanel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f66d1e1d37ca824c864d12e26a7ae80 3 | timeCreated: 1525800911 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/OptionsPanel.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.Bindables; 2 | using OsuPlayground.UI.OptionObjects; 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Linq; 6 | using UnityEngine; 7 | using UnityEngine.UI; 8 | 9 | namespace OsuPlayground.UI.Panels 10 | { 11 | /// 12 | /// Contains option objects for manipulation. 13 | /// 14 | public class OptionsPanel : Panel 15 | { 16 | [SerializeField] 17 | private RectTransform container; 18 | 19 | public void AddOption(Bindable variable, string name, int precision, Bindable min, Bindable max, Color color) 20 | { 21 | var newObject = Instantiate(Playground.OptionNumberPrefab, this.container); 22 | var component = newObject.GetComponent(); 23 | 24 | component.Text.text = name; 25 | component.ColorBar.color = color; 26 | component.Text.color = color; 27 | component.InputField.textComponent.color = color; 28 | component.Slider.fillRect.GetComponent().color = color; 29 | 30 | var precisionValue = Mathf.Pow(10, precision); 31 | 32 | min.ValueChanged += (value) => component.Slider.minValue = value * precisionValue; 33 | max.ValueChanged += (value) => component.Slider.maxValue = value * precisionValue; 34 | 35 | variable.ValueChanged += (value) => 36 | { 37 | component.InputField.text = value.ToString(); 38 | component.Slider.value = value * precisionValue; 39 | }; 40 | 41 | component.Slider.onValueChanged.AddListener((value) => variable.Value = value / precisionValue); 42 | 43 | component.InputField.onEndEdit.AddListener((value) => 44 | { 45 | float number; 46 | if (Single.TryParse(value, out number)) 47 | { 48 | variable.Value = Mathf.Clamp(number, min.Value, max.Value); 49 | } 50 | }); 51 | } 52 | 53 | public void AddOption(Bindable variable, string name, Bindable min, Bindable max, Color color) 54 | { 55 | var newObject = Instantiate(Playground.OptionNumberPrefab, this.container); 56 | var component = newObject.GetComponent(); 57 | 58 | component.Text.text = name; 59 | component.ColorBar.color = color; 60 | component.Text.color = color; 61 | component.InputField.textComponent.color = color; 62 | component.Slider.fillRect.GetComponent().color = color; 63 | 64 | min.ValueChanged += (value) => component.Slider.minValue = value; 65 | max.ValueChanged += (value) => component.Slider.maxValue = value; 66 | 67 | variable.ValueChanged += (value) => 68 | { 69 | component.InputField.text = value.ToString(); 70 | component.Slider.value = value; 71 | }; 72 | 73 | component.Slider.onValueChanged.AddListener((value) => variable.Value = Mathf.RoundToInt(value)); 74 | 75 | component.InputField.onEndEdit.AddListener((value) => 76 | { 77 | int number; 78 | if (Int32.TryParse(value, out number)) 79 | { 80 | variable.Value = Mathf.Clamp(number, min.Value, max.Value); 81 | } 82 | }); 83 | } 84 | 85 | public void AddOption(Bindable variable, string name, Color color) 86 | { 87 | var newObject = Instantiate(Playground.OptionBoolPrefab, this.container); 88 | var component = newObject.GetComponent(); 89 | 90 | component.Text.text = name; 91 | component.Text.color = color; 92 | component.ColorBar.color = color; 93 | component.Toggle.graphic.color = color; 94 | 95 | variable.ValueChanged += (value) => component.Toggle.isOn = value; 96 | 97 | component.Toggle.onValueChanged.AddListener((value) => variable.Value = value); 98 | } 99 | 100 | public void AddOption(Bindable variable, string name, Color color) 101 | { 102 | var newObject = Instantiate(Playground.OptionVector2Prefab, this.container); 103 | var component = newObject.GetComponent(); 104 | 105 | component.Text.text = name; 106 | component.ColorBar.color = color; 107 | component.Text.color = color; 108 | component.InputFieldX.textComponent.color = color; 109 | component.InputFieldY.textComponent.color = color; 110 | 111 | variable.ValueChanged += (value) => 112 | { 113 | component.InputFieldX.text = Mathf.Round(value.x).ToString(); 114 | component.InputFieldY.text = Mathf.Round(value.y).ToString(); 115 | }; 116 | 117 | component.InputFieldX.onEndEdit.AddListener((value) => 118 | { 119 | float number; 120 | if (Single.TryParse(value, out number)) 121 | { 122 | variable.Value = new Vector2(Mathf.Round(number), Mathf.Round(variable.Value.y)); 123 | } 124 | }); 125 | component.InputFieldY.onEndEdit.AddListener((value) => 126 | { 127 | float number; 128 | if (Single.TryParse(value, out number)) 129 | { 130 | variable.Value = new Vector2(Mathf.Round(variable.Value.x), Mathf.Round(number)); 131 | } 132 | }); 133 | } 134 | 135 | public void AddOption(Bindable variable, string name, List options, Color color) 136 | { 137 | var newObject = Instantiate(Playground.OptionChoicePrefab, this.container); 138 | var component = newObject.GetComponent(); 139 | 140 | component.Text.text = name; 141 | component.Text.color = color; 142 | component.ColorBar.color = color; 143 | component.Dropdown.captionText.color = color; 144 | component.Dropdown.itemText.color = color; 145 | component.Dropdown.options = options.Select(x => new Dropdown.OptionData { 146 | text = x 147 | }).ToList(); 148 | 149 | variable.ValueChanged += (value) => component.Dropdown.value = options.IndexOf(value); 150 | 151 | component.Dropdown.onValueChanged.AddListener((value) => variable.Value = options[value]); 152 | } 153 | } 154 | } 155 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/OptionsPanel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 164f6779c72f0624990d92d31c5ccc5f 3 | timeCreated: 1525363296 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/Panel.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.UI; 3 | 4 | namespace OsuPlayground.UI.Panels 5 | { 6 | /// 7 | /// Defines a base class for UI panels. 8 | /// 9 | [RequireComponent(typeof(RectTransform), typeof(CanvasGroup), typeof(Image))] 10 | public abstract class Panel : MonoBehaviour 11 | { 12 | [HideInInspector] 13 | public RectTransform RectTransform; 14 | [HideInInspector] 15 | public CanvasGroup CanvasGroup; 16 | [HideInInspector] 17 | public Image Background; 18 | 19 | private void Awake() 20 | { 21 | this.RectTransform = this.GetComponent(); 22 | this.CanvasGroup = this.GetComponent(); 23 | this.Background = this.GetComponent(); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/Panel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eda146733fd2ab74dbae86e01a75bcff 3 | timeCreated: 1525363296 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/PlayfieldPanel.cs: -------------------------------------------------------------------------------- 1 | using OsuPlayground.UI.Handles; 2 | using UnityEngine; 3 | using UnityEngine.EventSystems; 4 | using UnityEngine.UI; 5 | 6 | namespace OsuPlayground.UI.Panels 7 | { 8 | /// 9 | /// Defines the main panel containing the cool things. 10 | /// 11 | public class PlayfieldPanel : Panel, IDragHandler, IScrollHandler 12 | { 13 | [SerializeField] 14 | private Border border; 15 | [SerializeField] 16 | private Playfield playfield; 17 | [SerializeField] 18 | private HandleManager handleManager; 19 | [SerializeField] 20 | private Text infoText; 21 | 22 | public Vector2 RawOffset; 23 | public float RawZoom; 24 | 25 | private float zoomFactor; 26 | 27 | private void Update() 28 | { 29 | // This function primarily handles zooming and panning. 30 | 31 | this.zoomFactor = Mathf.Pow(2, this.RawZoom / 4 - 0.25f); 32 | 33 | var availableSpace = this.RectTransform.rect.size; 34 | 35 | var spaceRatio = availableSpace.x / availableSpace.y; 36 | var playfieldRatio = (float)Playfield.WIDTH / Playfield.HEIGHT; 37 | 38 | var multiplier = 0f; 39 | 40 | if (spaceRatio < playfieldRatio) 41 | { 42 | multiplier = availableSpace.x / Playfield.WIDTH; 43 | } 44 | else 45 | { 46 | multiplier = availableSpace.y / Playfield.HEIGHT; 47 | } 48 | 49 | this.border.rectTransform.anchoredPosition = this.RawOffset * this.zoomFactor; 50 | this.border.rectTransform.sizeDelta = multiplier * this.zoomFactor * new Vector2( 51 | Playfield.WIDTH, 52 | Playfield.HEIGHT); 53 | 54 | this.border.SetVerticesDirty(); 55 | 56 | this.playfield.RectTransform.anchoredPosition = this.RawOffset * this.zoomFactor; 57 | this.playfield.RectTransform.sizeDelta = multiplier * this.zoomFactor * new Vector2( 58 | Playfield.WIDTH, 59 | Playfield.HEIGHT); 60 | 61 | this.handleManager.RectTransform.anchoredPosition = this.RawOffset * this.zoomFactor; 62 | this.handleManager.RectTransform.sizeDelta = multiplier * this.zoomFactor * new Vector2( 63 | Playfield.WIDTH, 64 | Playfield.HEIGHT); 65 | } 66 | 67 | private void LateUpdate() => this.infoText.text = this.playfield.HoveredObject; 68 | 69 | public void OnDrag(PointerEventData eventData) 70 | { 71 | if (eventData.button != PointerEventData.InputButton.Left) 72 | { 73 | this.RawOffset += eventData.delta / this.zoomFactor; 74 | } 75 | } 76 | 77 | public void OnScroll(PointerEventData eventData) 78 | { 79 | if (Input.GetKey(KeyCode.LeftControl) || Input.GetKey(KeyCode.RightControl)) 80 | { 81 | this.RawZoom += Mathf.Round(eventData.scrollDelta.y); 82 | this.RawZoom = Mathf.Clamp(this.RawZoom, -20, 12); 83 | } 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/PlayfieldPanel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1fc4819edd6198d4f9f120098ef5d782 3 | timeCreated: 1525363317 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Assets/Scripts/UI/Panels/ToolbarPanel.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using UnityEngine.UI; 4 | 5 | namespace OsuPlayground.UI.Panels 6 | { 7 | public enum ToolbarSide 8 | { 9 | Left, 10 | Right 11 | } 12 | 13 | /// 14 | /// Defines the toolbar at the bottom of the screen and positions buttons within it. 15 | /// 16 | public class ToolbarPanel : Panel 17 | { 18 | public Text Text; 19 | 20 | private float leftButtonPosition = 5; 21 | private float rightButtonPosition = -5; 22 | private GameObject PositionButton(ToolbarSide side) 23 | { 24 | var newObject = Instantiate(Playground.ToolbarButtonPrefab, this.transform); 25 | 26 | var rectTransform = newObject.GetComponent(); 27 | 28 | if (side == ToolbarSide.Left) 29 | { 30 | rectTransform.pivot = new Vector2(0, 0); 31 | rectTransform.anchorMin = new Vector2(0, 0); 32 | rectTransform.anchorMax = new Vector2(0, 1); 33 | rectTransform.anchoredPosition = new Vector2(this.leftButtonPosition, 5); 34 | 35 | this.leftButtonPosition += 105; 36 | } 37 | else 38 | { 39 | rectTransform.pivot = new Vector2(1, 0); 40 | rectTransform.anchorMin = new Vector2(1, 0); 41 | rectTransform.anchorMax = new Vector2(1, 1); 42 | rectTransform.anchoredPosition = new Vector2(this.rightButtonPosition, 5); 43 | 44 | this.rightButtonPosition -= 105; 45 | } 46 | 47 | this.Text.rectTransform.anchoredPosition = new Vector2(this.leftButtonPosition + 5, 5); 48 | this.Text.rectTransform.sizeDelta = new Vector2(this.RectTransform.rect.width + this.rightButtonPosition - this.leftButtonPosition - 10, -10); 49 | 50 | return newObject; 51 | } 52 | 53 | public void AddButton(string label, Action