From b88280cfe321d39fd86ad8c99294123034798c45 Mon Sep 17 00:00:00 2001 From: minenice55 Date: Fri, 5 Apr 2024 23:52:45 -0400 Subject: [PATCH] autoswing some game implementations, most games already work fine --- Assets/Scenes/Editor.unity | 1397 ++++++++++++++++- Assets/Scripts/Conductor.cs | 124 +- Assets/Scripts/GameManager.cs | 51 +- Assets/Scripts/Games/FanClub/FanClub.cs | 4 +- Assets/Scripts/Games/FanClub/NtrIdolAmie.cs | 7 +- Assets/Scripts/Games/FanClub/NtrIdolFan.cs | 16 +- Assets/Scripts/Games/KarateMan/KarateMan.cs | 1 + .../Scripts/Games/KarateMan/KarateManPot.cs | 33 +- .../Games/PajamaParty/CtrPillowMonkey.cs | 4 +- .../Games/PajamaParty/CtrPillowPlayer.cs | 14 +- .../Scripts/Games/RhythmTweezers/LongHair.cs | 4 +- .../Games/RhythmTweezers/RhythmTweezers.cs | 8 +- .../Timeline/SpecialTmeline/TempoDialog.cs | 28 + .../TimelineObjs/TempoTimelineObj.cs | 6 + .../Scripts/LevelEditor/Timeline/Timeline.cs | 8 +- Assets/Scripts/Util/AnimationHelpers.cs | 4 +- Assets/Scripts/Util/MultiSound.cs | 7 +- 17 files changed, 1571 insertions(+), 145 deletions(-) diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index 0fe4a634c..5fe0e97e5 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -414,9 +414,9 @@ RectTransform: m_Father: {fileID: 574002313} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: -21} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 0, y: 0.5} --- !u!114 &9435782 @@ -3846,9 +3846,9 @@ RectTransform: m_Father: {fileID: 539838476} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 32, y: -21} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 1, y: 0.5} --- !u!114 &121871281 @@ -4070,9 +4070,9 @@ RectTransform: m_Father: {fileID: 539838476} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 72, y: -21} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 1, y: 0.5} --- !u!114 &129013734 @@ -4206,9 +4206,9 @@ RectTransform: m_Father: {fileID: 539838476} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 112, y: -21} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 1, y: 0.5} --- !u!114 &151246938 @@ -7101,8 +7101,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 826.5, y: -25} - m_SizeDelta: {x: 1629, y: 40} + m_AnchoredPosition: {x: 656.00006, y: -25} + m_SizeDelta: {x: 1288.0001, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &278632245 MonoBehaviour: @@ -7223,6 +7223,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: fd86589935fb46c4db0d3d23d52743a9, type: 3} m_Name: m_EditorClassIdentifier: + conductor: {fileID: 0} --- !u!4 &282924609 Transform: m_ObjectHideFlags: 0 @@ -13013,7 +13014,7 @@ MonoBehaviour: m_TargetGraphic: {fileID: 171581557} m_HandleRect: {fileID: 171581556} m_Direction: 2 - m_Value: 0 + m_Value: 1 m_Size: 1 m_NumberOfSteps: 0 m_OnValueChanged: @@ -15631,7 +15632,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1523, y: -25} + m_AnchoredPosition: {x: 1182.0001, y: -25} m_SizeDelta: {x: 360, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &579899330 @@ -16200,6 +16201,143 @@ MonoBehaviour: m_EditorClassIdentifier: m_Padding: {x: 0, y: 0, z: 0, w: 0} m_Softness: {x: 0, y: 0} +--- !u!1 &590691359 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 590691360} + - component: {fileID: 590691362} + - component: {fileID: 590691361} + m_Layer: 5 + m_Name: SliderStart + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &590691360 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 590691359} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 923757708} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 25, y: -20} + m_SizeDelta: {x: 50, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &590691361 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 590691359} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 0% + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} + m_sharedMaterial: {fileID: 8580487687356851718, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 26 + m_fontSizeBase: 26 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 4 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &590691362 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 590691359} + m_CullTransparentMesh: 1 --- !u!1 &597773738 GameObject: m_ObjectHideFlags: 0 @@ -19461,6 +19599,197 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 704039019} m_CullTransparentMesh: 1 +--- !u!1 &704808990 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 704808991} + - component: {fileID: 704808994} + - component: {fileID: 704808993} + - component: {fileID: 704808992} + m_Layer: 5 + m_Name: ManualInput + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &704808991 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 704808990} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 981306209} + m_Father: {fileID: 923757708} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 436, y: -20} + m_SizeDelta: {x: 64, y: 30} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &704808992 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 704808990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2da0c512f12947e489f739169773d7ca, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 704808993} + m_TextViewport: {fileID: 981306209} + m_TextComponent: {fileID: 1429233489} + m_Placeholder: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_VerticalScrollbarEventHandler: {fileID: 0} + m_LayoutGroup: {fileID: 0} + m_ScrollSensitivity: 1 + m_ContentType: 3 + m_InputType: 0 + m_AsteriskChar: 42 + m_KeyboardType: 2 + m_LineType: 0 + m_HideMobileInput: 0 + m_HideSoftKeyboard: 0 + m_CharacterValidation: 3 + m_RegexValue: + m_GlobalPointSize: 14 + m_CharacterLimit: 0 + m_OnEndEdit: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 788904139} + m_TargetAssemblyTypeName: TempoDialog, Assembly-CSharp + m_MethodName: SetSwing + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 + m_OnSubmit: + m_PersistentCalls: + m_Calls: [] + m_OnSelect: + m_PersistentCalls: + m_Calls: [] + m_OnDeselect: + m_PersistentCalls: + m_Calls: [] + m_OnTextSelection: + m_PersistentCalls: + m_Calls: [] + m_OnEndTextSelection: + m_PersistentCalls: + m_Calls: [] + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] + m_OnTouchScreenKeyboardStatusChanged: + m_PersistentCalls: + m_Calls: [] + m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_CustomCaretColor: 0 + m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412} + m_Text: 100 + m_CaretBlinkRate: 0.85 + m_CaretWidth: 1 + m_ReadOnly: 0 + m_RichText: 1 + m_GlobalFontAsset: {fileID: 11400000, guid: 8597c35f18a008c428fc5870aec75766, type: 2} + m_OnFocusSelectAll: 1 + m_ResetOnDeActivation: 1 + m_KeepTextSelectionVisible: 0 + m_RestoreOriginalTextOnEscape: 1 + m_isRichTextEditingAllowed: 0 + m_LineLimit: 0 + isAlert: 0 + m_InputValidator: {fileID: 0} + m_ShouldActivateOnSelect: 1 +--- !u!114 &704808993 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 704808990} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10911, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &704808994 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 704808990} + m_CullTransparentMesh: 1 --- !u!1 &708484803 GameObject: m_ObjectHideFlags: 0 @@ -19949,6 +20278,82 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 738028139} m_CullTransparentMesh: 1 +--- !u!1 &738634698 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 738634699} + - component: {fileID: 738634701} + - component: {fileID: 738634700} + m_Layer: 5 + m_Name: Handle + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &738634699 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 738634698} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 2062943138} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0.01, y: 0} + m_AnchorMax: {x: 0.01, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &738634700 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 738634698} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10913, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &738634701 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 738634698} + m_CullTransparentMesh: 1 --- !u!1 &743531235 GameObject: m_ObjectHideFlags: 0 @@ -21798,6 +22203,8 @@ MonoBehaviour: dialog: {fileID: 788904138} deleteButton: {fileID: 1876126829} tempoInput: {fileID: 467708510} + swingInput: {fileID: 704808992} + swingSlider: {fileID: 907963053} --- !u!224 &788904140 stripped RectTransform: m_CorrespondingSourceObject: {fileID: 3263607626584268237, guid: 5edde5c03f192d242bc2fa6277914e6e, type: 3} @@ -24474,6 +24881,109 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 891587360} m_CullTransparentMesh: 1 +--- !u!1 &907963051 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 907963052} + - component: {fileID: 907963053} + m_Layer: 5 + m_Name: Slider + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &907963052 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907963051} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2092926359} + - {fileID: 1711155737} + - {fileID: 2062943138} + m_Father: {fileID: 923757708} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 178, y: -20} + m_SizeDelta: {x: 256, y: 20} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &907963053 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 907963051} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 738634700} + m_FillRect: {fileID: 1149904538} + m_HandleRect: {fileID: 738634699} + m_Direction: 0 + m_MinValue: 0 + m_MaxValue: 1 + m_WholeNumbers: 0 + m_Value: 0 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: + - m_Target: {fileID: 788904139} + m_TargetAssemblyTypeName: TempoDialog, Assembly-CSharp + m_MethodName: SwingSliderUpdate + m_Mode: 1 + m_Arguments: + m_ObjectArgument: {fileID: 0} + m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine + m_IntArgument: 0 + m_FloatArgument: 0 + m_StringArgument: + m_BoolArgument: 0 + m_CallState: 2 --- !u!1 &908855313 GameObject: m_ObjectHideFlags: 0 @@ -25185,6 +25695,219 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 921541685} m_CullTransparentMesh: 1 +--- !u!1 &923757707 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 923757708} + - component: {fileID: 923757710} + - component: {fileID: 923757709} + m_Layer: 5 + m_Name: Holder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &923757708 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923757707} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 1 + m_Children: + - {fileID: 590691360} + - {fileID: 907963052} + - {fileID: 2073774546} + - {fileID: 704808991} + m_Father: {fileID: 1922212788} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 935.187, y: -20} + m_SizeDelta: {x: 1288.0001, y: 40} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &923757709 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923757707} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 3 + m_Spacing: 0 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 +--- !u!222 &923757710 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 923757707} + m_CullTransparentMesh: 1 +--- !u!1 &924634313 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 924634314} + - component: {fileID: 924634316} + - component: {fileID: 924634315} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &924634314 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924634313} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1922212788} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 0, y: 5} + m_SizeDelta: {x: 249.18692, y: 50} + m_Pivot: {x: 0, y: 1} +--- !u!114 &924634315 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924634313} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: Swing + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} + m_sharedMaterial: {fileID: 8580487687356851718, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 26 + m_fontSizeBase: 26 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: -97.7 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &924634316 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 924634313} + m_CullTransparentMesh: 1 --- !u!1 &928918819 GameObject: m_ObjectHideFlags: 0 @@ -26437,6 +27160,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 278632244} + - {fileID: 1922212788} m_Father: {fileID: 788904137} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -26479,6 +27203,58 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 980212092} m_CullTransparentMesh: 1 +--- !u!1 &981306208 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 981306209} + - component: {fileID: 981306210} + m_Layer: 5 + m_Name: Text Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &981306209 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 981306208} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1429233488} + m_Father: {fileID: 704808991} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -0.5} + m_SizeDelta: {x: -20, y: -13} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &981306210 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 981306208} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3312d7739989d2b4e91e6319e9a96d76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: {x: -8, y: -5, z: -8, w: -5} + m_Softness: {x: 0, y: 0} --- !u!1 &983551348 GameObject: m_ObjectHideFlags: 0 @@ -30289,6 +31065,82 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1149103344} m_CullTransparentMesh: 1 +--- !u!1 &1149904537 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1149904538} + - component: {fileID: 1149904540} + - component: {fileID: 1149904539} + m_Layer: 5 + m_Name: Fill + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1149904538 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1149904537} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 1711155737} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0.01, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 10, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1149904539 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1149904537} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &1149904540 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1149904537} + m_CullTransparentMesh: 1 --- !u!1 &1150057310 GameObject: m_ObjectHideFlags: 0 @@ -30369,7 +31221,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} m_AnchorMax: {x: 1, y: 0.5} - m_AnchoredPosition: {x: 0, y: 76.00001} + m_AnchoredPosition: {x: 0, y: 136.20409} m_SizeDelta: {x: 0, y: 0} m_Pivot: {x: 0.5, y: 1} --- !u!222 &1154875945 @@ -32168,7 +33020,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: -8.0000305} + m_AnchoredPosition: {x: 0, y: -8} m_SizeDelta: {x: 0, y: -63.99999} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1244621693 @@ -34699,9 +35551,9 @@ RectTransform: m_Father: {fileID: 574002313} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 40, y: -21} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1345846031 @@ -36164,6 +37016,143 @@ MonoBehaviour: tempoLayer: {fileID: 1511927534} musicLayer: {fileID: 954835807} sectionLayer: {fileID: 1647324175} +--- !u!1 &1429233487 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1429233488} + - component: {fileID: 1429233490} + - component: {fileID: 1429233489} + m_Layer: 5 + m_Name: Text + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1429233488 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1429233487} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 981306209} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1429233489 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1429233487} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "100\u200B" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8597c35f18a008c428fc5870aec75766, type: 2} + m_sharedMaterial: {fileID: -6562250930271150993, guid: 8597c35f18a008c428fc5870aec75766, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4281479730 + m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 14 + m_fontSizeBase: 14 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 3 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 0 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 1 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &1429233490 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1429233487} + m_CullTransparentMesh: 1 --- !u!1 &1436105793 GameObject: m_ObjectHideFlags: 0 @@ -39905,8 +40894,8 @@ MonoBehaviour: m_TargetGraphic: {fileID: 1220118245} m_HandleRect: {fileID: 1220118244} m_Direction: 2 - m_Value: 1.0000002 - m_Size: 0.23142865 + m_Value: 1.0000006 + m_Size: 0.73026246 m_NumberOfSteps: 0 m_OnValueChanged: m_PersistentCalls: @@ -41733,6 +42722,43 @@ MonoBehaviour: m_FlexibleWidth: -1 m_FlexibleHeight: -1 m_LayoutPriority: 1 +--- !u!1 &1711155736 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1711155737} + m_Layer: 5 + m_Name: Fill Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1711155737 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1711155736} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1149904538} + m_Father: {fileID: 907963052} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: -5, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &1711526065 GameObject: m_ObjectHideFlags: 0 @@ -43023,9 +44049,9 @@ RectTransform: m_Father: {fileID: 574002313} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 80, y: -21} m_SizeDelta: {x: 32, y: 32} m_Pivot: {x: 0, y: 0.5} --- !u!114 &1783491359 @@ -44907,7 +45933,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 1523, y: -25} + m_AnchoredPosition: {x: 1182.0001, y: -25} m_SizeDelta: {x: 360, y: 40} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1876126829 @@ -46424,6 +47450,71 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1922199512} m_CullTransparentMesh: 1 +--- !u!1 &1922212787 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1922212788} + - component: {fileID: 1922212789} + m_Layer: 5 + m_Name: Swing + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1922212788 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1922212787} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 924634314} + - {fileID: 923757708} + m_Father: {fileID: 980212093} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 809.5935, y: -69} + m_SizeDelta: {x: 1595.187, y: 40} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &1922212789 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1922212787} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 16 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 3 + m_Spacing: 42 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 1 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &1926088904 GameObject: m_ObjectHideFlags: 0 @@ -49920,6 +51011,43 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2057361809} m_CullTransparentMesh: 1 +--- !u!1 &2062943137 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2062943138} + m_Layer: 5 + m_Name: Handle Slide Area + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2062943138 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2062943137} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 738634699} + m_Father: {fileID: 907963052} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: -20, y: 0} + m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &2066632679 GameObject: m_ObjectHideFlags: 0 @@ -50046,6 +51174,143 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2067576960} m_CullTransparentMesh: 1 +--- !u!1 &2073774545 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2073774546} + - component: {fileID: 2073774548} + - component: {fileID: 2073774547} + m_Layer: 5 + m_Name: SliderEnd + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2073774546 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2073774545} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 923757708} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 355, y: -20} + m_SizeDelta: {x: 98, y: 50} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2073774547 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2073774545} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 100% + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} + m_sharedMaterial: {fileID: 8580487687356851718, guid: 4810e200fa0cb24438bac52343d7674b, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 26 + m_fontSizeBase: 26 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_TextWrappingMode: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_ActiveFontFeatures: 6e72656b + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_EmojiFallbackSupport: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!222 &2073774548 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2073774545} + m_CullTransparentMesh: 1 --- !u!1 &2080479825 GameObject: m_ObjectHideFlags: 0 @@ -50503,6 +51768,82 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2090385544} m_CullTransparentMesh: 1 +--- !u!1 &2092926358 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2092926359} + - component: {fileID: 2092926361} + - component: {fileID: 2092926360} + m_Layer: 5 + m_Name: Background + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2092926359 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2092926358} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 907963052} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.25} + m_AnchorMax: {x: 1, y: 0.75} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &2092926360 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2092926358} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0} + m_Type: 1 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!222 &2092926361 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2092926358} + m_CullTransparentMesh: 1 --- !u!1 &2094676608 GameObject: m_ObjectHideFlags: 0 @@ -51695,7 +53036,7 @@ PrefabInstance: objectReference: {fileID: 0} - target: {fileID: 8995444695224805070, guid: 51bd6620194834c4c9118dd0f64b1b3d, type: 3} propertyPath: m_AnchoredPosition.y - value: -49.999985 + value: -50 objectReference: {fileID: 0} - target: {fileID: 8995444695466730802, guid: 51bd6620194834c4c9118dd0f64b1b3d, type: 3} propertyPath: tabs.Array.size diff --git a/Assets/Scripts/Conductor.cs b/Assets/Scripts/Conductor.cs index 6beeb4514..e15d44b28 100644 --- a/Assets/Scripts/Conductor.cs +++ b/Assets/Scripts/Conductor.cs @@ -23,11 +23,11 @@ namespace HeavenStudio // Song beats per minute // This is determined by the song you're trying to sync up to - public float songBpm; + public float songBpm { get; private set; } // The number of seconds for each song beat public float secPerBeat => (float)secPerBeatAsDouble; - public double secPerBeatAsDouble; + public double secPerBeatAsDouble { get; private set; } // The number of seconds for each song beat, inversely scaled to song pitch (higer pitch = shorter time) public float pitchedSecPerBeat => (float)pitchedSecPerBeatAsDouble; @@ -39,9 +39,11 @@ namespace HeavenStudio public double songPositionAsDouble => songPos; // Current song position, in beats - public double songPosBeat; // for Conductor use only - public float songPositionInBeats => (float)songPosBeat; - public double songPositionInBeatsAsDouble => songPosBeat; + public double songPosBeat { get; private set; } + public float songPositionInBeats => (float)songPositionInBeatsAsDouble; + public double songPositionInBeatsAsDouble { get; private set; } + public float unswungSongPositionInBeats => (float)songPosBeat; + public double unswungSongPositionInBeatsAsDouble => songPosBeat; // Current time of the song private double time; @@ -80,7 +82,7 @@ namespace HeavenStudio // Metronome tick sound enabled public bool metronome = false; - Util.Sound metronomeSound; + Util.MultiSound metronomeSound; private int _metronomeTally = 0; // pitch values @@ -99,7 +101,7 @@ namespace HeavenStudio if (isPaused || deferTimeKeeping) return; if (pitch != 0 && pitch != timelinePitch) { - Debug.Log("added pitch change " + pitch * minigamePitch + " at " + absTime); + // Debug.Log("added pitch change " + pitch * minigamePitch + " at " + absTime); addedPitchChanges.Add(new AddedPitchChange { time = absTime, pitch = pitch * minigamePitch }); } @@ -107,10 +109,13 @@ namespace HeavenStudio if (musicSource != null && musicSource.clip != null) { musicSource.pitch = SongPitch; - time = MapTimeToPitchChanges(absTime + absTimeAdjust); - songPos = startPos + time; - songPosBeat = GetBeatFromSongPos(songPos); - SeekMusicToTime(songPos, firstBeatOffset); + if (isPlaying) + { + time = MapTimeToPitchChanges(absTime + absTimeAdjust); + songPos = startPos + time; + songPosBeat = GetBeatFromSongPos(songPos); + SeekMusicToTime(songPos, firstBeatOffset); + } } } @@ -119,7 +124,7 @@ namespace HeavenStudio if (isPaused || deferTimeKeeping || !isPlaying) return; if (pitch != 0 && pitch != minigamePitch) { - Debug.Log("added pitch change " + pitch * timelinePitch + " at " + absTime); + // Debug.Log("added pitch change " + pitch * timelinePitch + " at " + absTime); addedPitchChanges.Add(new AddedPitchChange { time = absTime, pitch = pitch * timelinePitch }); } @@ -127,10 +132,13 @@ namespace HeavenStudio if (musicSource != null && musicSource.clip != null) { musicSource.pitch = SongPitch; - time = MapTimeToPitchChanges(absTime + absTimeAdjust); - songPos = startPos + time; - songPosBeat = GetBeatFromSongPos(songPos); - SeekMusicToTime(songPos, firstBeatOffset); + if (isPlaying) + { + time = MapTimeToPitchChanges(absTime + absTimeAdjust); + songPos = startPos + time; + songPosBeat = GetBeatFromSongPos(songPos); + SeekMusicToTime(songPos, firstBeatOffset); + } } } @@ -170,6 +178,8 @@ namespace HeavenStudio { deferTimeKeeping = true; songPosBeat = beat; + absTime = 0; + startTime = DateTime.Now; } public void Play(double beat) @@ -224,6 +234,7 @@ namespace HeavenStudio _metronomeTally = 0; startTime = DateTime.Now; + absTime = 0; absTimeAdjust = 0; deferTimeKeeping = musicSource.clip != null; @@ -241,7 +252,8 @@ namespace HeavenStudio { deferTimeKeeping = false; // Debug.Log($"dsptime: {dsp}, deferred timekeeping for {DateTime.Now - startTime} seconds (delta dsp {dsp - dspStart})"); - startTime += TimeSpan.FromSeconds(dsp - dspStart); + startTime = DateTime.Now; + absTime = 0; absTimeAdjust = 0; dspStart = dsp; } @@ -400,6 +412,7 @@ namespace HeavenStudio songPos = startPos + time; songPosBeat = GetBeatFromSongPos(songPos); + songPositionInBeatsAsDouble = GetSwungBeat(songPosBeat); } } @@ -431,7 +444,14 @@ namespace HeavenStudio { if (songPositionInBeatsAsDouble >= Math.Ceiling(startBeat) + _metronomeTally) { - if (metronome) metronomeSound = Util.SoundByte.PlayOneShot("metronome", Math.Ceiling(startBeat) + _metronomeTally); + // if (metronome) metronomeSound = Util.SoundByte.PlayOneShot("metronome", Math.Ceiling(startBeat) + _metronomeTally); + if (metronome) + { + metronomeSound = Util.MultiSound.Play(new List { + new Util.MultiSound.Sound("metronome", Math.Ceiling(startBeat) + _metronomeTally), + new Util.MultiSound.Sound("metronome", Math.Ceiling(startBeat) + _metronomeTally + 0.5, 1.5f, 0.5f) + }, false, true); + } _metronomeTally++; } } @@ -439,7 +459,7 @@ namespace HeavenStudio { if (metronomeSound != null) { - metronomeSound.Stop(); + // metronomeSound.StopAll(); metronomeSound = null; } } @@ -460,9 +480,9 @@ namespace HeavenStudio return result; } - public float GetLoopPositionFromBeat(float beatOffset, float length, bool beatClamp = true) + public float GetLoopPositionFromBeat(float beatOffset, float length, bool beatClamp = true, bool ignoreSwing = true) { - float beat = songPositionInBeats; + float beat = ignoreSwing ? unswungSongPositionInBeats : songPositionInBeats; if (beatClamp) { beat = Mathf.Max(beat, 0); @@ -470,9 +490,9 @@ namespace HeavenStudio return Mathf.Repeat((beat / length) + beatOffset, 1); } - public float GetPositionFromBeat(double startBeat, double length, bool beatClamp = true) + public float GetPositionFromBeat(double startBeat, double length, bool beatClamp = true, bool ignoreSwing = true) { - float beat = songPositionInBeats; + float beat = ignoreSwing ? unswungSongPositionInBeats : songPositionInBeats; if (beatClamp) { beat = Mathf.Max(beat, 0); @@ -493,20 +513,11 @@ namespace HeavenStudio var chart = gameManager.Beatmap; if (chart.TempoChanges.Count == 0) return 120f; - float bpm = chart.TempoChanges[0]["tempo"]; - swingRatio = chart.TempoChanges[0]["swing"] + 0.5f; - foreach (RiqEntity t in chart.TempoChanges) - { - if (t.beat > beat) - { - break; - } - bpm = t["tempo"]; - swingRatio = t["swing"] + 0.5f; - } - - return bpm; + RiqEntity tempoChange = chart.TempoChanges.FindLast(t => t.beat <= beat); + tempoChange ??= chart.TempoChanges[0]; + swingRatio = tempoChange["swing"] + 0.5f; + return tempoChange["tempo"]; } public float GetBpmAtBeat(double beat) @@ -521,25 +532,53 @@ namespace HeavenStudio return swingRatio; } + public double GetSwungBeat(double beat) + { + return Math.Floor(beat) + GetSwingOffset(beat, GetSwingRatioAtBeat(beat)); + } + public double GetSwungBeat(double beat, float ratio) { - return beat + GetSwingOffset(beat, ratio); + return Math.Floor(beat) + GetSwingOffset(beat, ratio); } public double GetSwingOffset(double beatFrac, float ratio) { beatFrac %= 1; - if (beatFrac <= 0.5) + if (beatFrac <= ratio) { return 0.5 / ratio * beatFrac; } else { - return 0.5 + (0.5 / (1f - ratio) * (beatFrac - ratio)); + return 0.5 + 0.5 / (1 - ratio) * (beatFrac - ratio); } } - public double GetSongPosFromBeat(double beat) + public double GetUnSwungBeat(double beat) + { + return Math.Floor(beat) + GetUnSwingOffset(beat, GetSwingRatioAtBeat(beat)); + } + + public double GetUnSwungBeat(double beat, float ratio) + { + return Math.Floor(beat) + GetUnSwingOffset(beat, ratio); + } + + public double GetUnSwingOffset(double beatFrac, float ratio) + { + beatFrac %= 1; + if (beatFrac <= ratio) + { + return 2 * ratio * beatFrac; + } + else + { + return 2 * (beatFrac - 0.5f) * (1f - ratio) + ratio; + } + } + + public double GetSongPosFromBeat(double beat, bool ignoreSwing = false) { var chart = gameManager.Beatmap; float bpm = 120f; @@ -548,6 +587,11 @@ namespace HeavenStudio double lastTempoChangeBeat = 0f; + if (!ignoreSwing) + { + beat = GetUnSwungBeat(beat); + } + foreach (RiqEntity t in chart.TempoChanges) { if (t.beat > beat) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 41af2da45..1240f041a 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -236,7 +236,6 @@ namespace HeavenStudio public void NewRemix() { - Debug.Log("Creating new remix"); AudioLoadDone = false; Beatmap = new("1", "HeavenStudio"); Beatmap.data.properties = new(Minigames.propertiesModel); @@ -447,7 +446,7 @@ namespace HeavenStudio var inf = GetGameInfo(gameName); if (inf != null && inf.usesAssetBundle && inf.AssetsLoaded && !inf.SequencesPreloaded) { - Debug.Log($"Preparing game {gameName}"); + // Debug.Log($"Preparing game {gameName}"); PreloadGameSequences(gameName); } eventCaller.CallPreEvent(entity); @@ -462,32 +461,31 @@ namespace HeavenStudio { if (BeatmapEntities() < 1) return; - if (!conductor.isPlaying) + if (conductor.WaitingForDsp || !conductor.isPlaying) return; - Conductor cond = conductor; - double clampedBeat = Math.Max(cond.songPositionInBeatsAsDouble, 0); + double clampedBeat = Math.Max(conductor.songPositionInBeatsAsDouble, 0); if (currentTempoEvent < Beatmap.TempoChanges.Count && currentTempoEvent >= 0) { - if (cond.songPositionInBeatsAsDouble >= tempoBeats[currentTempoEvent]) + if (conductor.songPositionInBeatsAsDouble >= tempoBeats[currentTempoEvent]) { - cond.SetBpm(Beatmap.TempoChanges[currentTempoEvent]["tempo"]); + conductor.SetBpm(Beatmap.TempoChanges[currentTempoEvent]["tempo"]); currentTempoEvent++; } } if (currentVolumeEvent < Beatmap.VolumeChanges.Count && currentVolumeEvent >= 0) { - if (cond.songPositionInBeatsAsDouble >= volumeBeats[currentVolumeEvent]) + if (conductor.songPositionInBeatsAsDouble >= volumeBeats[currentVolumeEvent]) { - cond.SetVolume(Beatmap.VolumeChanges[currentVolumeEvent]["volume"]); + conductor.SetVolume(Beatmap.VolumeChanges[currentVolumeEvent]["volume"]); currentVolumeEvent++; } } if (currentSectionEvent < Beatmap.SectionMarkers.Count && currentSectionEvent >= 0) { - if (cond.songPositionInBeatsAsDouble >= sectionBeats[currentSectionEvent]) + if (conductor.songPositionInBeatsAsDouble >= sectionBeats[currentSectionEvent]) { RiqEntity marker = Beatmap.SectionMarkers[currentSectionEvent]; if (!string.IsNullOrEmpty(marker["sectionName"])) @@ -529,7 +527,7 @@ namespace HeavenStudio } } - if (cond.songPositionInBeatsAsDouble >= Math.Ceiling(_playStartBeat) + _pulseTally) + if (conductor.songPositionInBeatsAsDouble >= Math.Ceiling(_playStartBeat) + _pulseTally) { if (minigame != null) minigame.OnBeatPulse(Math.Ceiling(_playStartBeat) + _pulseTally); onBeatPulse?.Invoke(Math.Ceiling(_playStartBeat) + _pulseTally); @@ -546,7 +544,7 @@ namespace HeavenStudio List entitiesInRange = ListPool.Get(); List fxEntities = ListPool.Get(); // allows for multiple events on the same beat to be executed on the same frame, so no more 1-frame delay - while (currentEvent < eventBeats.Count && clampedBeat >= eventBeats[currentEvent] && conductor.isPlaying) + while (currentEvent < eventBeats.Count && clampedBeat >= eventBeats[currentEvent] && this.conductor.isPlaying) { fxEntities.Clear(); entitiesInRange.Clear(); @@ -602,9 +600,9 @@ namespace HeavenStudio } else { - double currectSectionStart = cond.GetSongPosFromBeat(currentSection.beat); + double currectSectionStart = conductor.GetSongPosFromBeat(currentSection.beat); - SectionProgress = (cond.songPosition - currectSectionStart) / (cond.GetSongPosFromBeat(nextSectionBeat) - currectSectionStart); + SectionProgress = (conductor.songPosition - currectSectionStart) / (conductor.GetSongPosFromBeat(nextSectionBeat) - currectSectionStart); } } @@ -672,7 +670,6 @@ namespace HeavenStudio public void Play(double beat, float delay = 0f) { bool paused = conductor.isPaused; - Debug.Log("Playing at " + beat); _playStartBeat = beat; _pulseTally = 0; _latePulseTally = 0; @@ -721,7 +718,9 @@ namespace HeavenStudio conductor.SetBpm(Beatmap.TempoChanges[0]["tempo"]); conductor.SetVolume(Beatmap.VolumeChanges[0]["volume"]); conductor.firstBeatOffset = Beatmap.data.offset; + conductor.PlaySetup(beat); SetCurrentEventToClosest(beat); + Debug.Log("Playing at " + beat); KillAllSounds(); if (delay > 0) @@ -729,7 +728,6 @@ namespace HeavenStudio yield return new WaitForSeconds(delay); } - conductor.PlaySetup(beat); Minigame miniGame = null; if (minigameObj != null && minigameObj.TryGetComponent(out miniGame)) { @@ -819,6 +817,10 @@ namespace HeavenStudio GlobalGameManager.LoadScene("Judgement", 0.35f, 0f, DestroyGame); CircleCursor.LockCursor(false); } + else + { + conductor.SetBeat(beat); + } Application.backgroundLoadingPriority = ThreadPriority.Normal; } @@ -833,6 +835,8 @@ namespace HeavenStudio SoundByte.PreloadAudioClipAsync("skillStar"); SoundByte.PreloadAudioClipAsync("perfectMiss"); + conductor.SetBeat(beat); + WaitUntil yieldOverlays = new WaitUntil(() => OverlaysManager.OverlaysReady); WaitUntil yieldBeatmap = new WaitUntil(() => Beatmap != null && BeatmapEntities() > 0); WaitUntil yieldAudio = new WaitUntil(() => AudioLoadDone || (ChartLoadError && !GlobalGameManager.IsShowingDialog)); @@ -845,16 +849,16 @@ namespace HeavenStudio } // wait for overlays to be ready - Debug.Log("waiting for overlays"); + // Debug.Log("waiting for overlays"); yield return yieldOverlays; // wait for beatmap to be loaded - Debug.Log("waiting for beatmap"); + // Debug.Log("waiting for beatmap"); yield return yieldBeatmap; //wait for audio clip to be loaded - Debug.Log("waiting for audio"); + // Debug.Log("waiting for audio"); yield return yieldAudio; //wait for games to be loaded - Debug.Log("waiting for minigames"); + // Debug.Log("waiting for minigames"); if (yieldGame != null) yield return yieldGame; @@ -874,7 +878,7 @@ namespace HeavenStudio public void KillAllSounds() { - Debug.Log("Killing all sounds"); + // Debug.Log("Killing all sounds"); SoundObjects.Clear(); SoundByte.KillOneShots(); } @@ -898,9 +902,10 @@ namespace HeavenStudio allGameSwitches = EventCaller.GetAllInGameManagerList("gameManager", new string[] { "switchGame" }); preSequenceBeats = new List(); + string[] seekEntityDatamodel; foreach (RiqEntity entity in Beatmap.Entities) { - string[] seekEntityDatamodel = entity.datamodel.Split('/'); + seekEntityDatamodel = entity.datamodel.Split('/'); double seekTime = eventCaller.GetGameAction(seekEntityDatamodel[0], seekEntityDatamodel[1]).preFunctionLength; preSequenceBeats.Add(entity.beat - seekTime); } @@ -1168,7 +1173,7 @@ namespace HeavenStudio { if (!(inf.AssetsLoaded || inf.AlreadyLoading)) { - Debug.Log($"ASYNC loading assetbundles for game {game}"); + // Debug.Log($"ASYNC loading assetbundles for game {game}"); inf.LoadAssetsAsync().Forget(); } yield return new WaitUntil(() => inf.AssetsLoaded); diff --git a/Assets/Scripts/Games/FanClub/FanClub.cs b/Assets/Scripts/Games/FanClub/FanClub.cs index 41fed6d3a..3f47a0112 100644 --- a/Assets/Scripts/Games/FanClub/FanClub.cs +++ b/Assets/Scripts/Games/FanClub/FanClub.cs @@ -390,7 +390,7 @@ namespace HeavenStudio.Games //idol jumping physics float jumpPos = conductor.GetPositionFromBeat(idolJumpStartTime, 1f); float IDOL_SHADOW_SCALE = 1.18f; - if (conductor.songPositionInBeatsAsDouble >= idolJumpStartTime && conductor.songPositionInBeatsAsDouble < idolJumpStartTime + 1f) + if (conductor.unswungSongPositionInBeatsAsDouble >= idolJumpStartTime && conductor.unswungSongPositionInBeatsAsDouble < idolJumpStartTime + 1f) { hasJumped = true; float yMul = jumpPos * 2f - 1f; @@ -580,7 +580,7 @@ namespace HeavenStudio.Games { DisableBop(beat, length); DisableResponse(beat, length); - idolJumpStartTime = beat; + idolJumpStartTime = conductor.GetUnSwungBeat(beat); //play anim BeatAction.New(instance, new List() diff --git a/Assets/Scripts/Games/FanClub/NtrIdolAmie.cs b/Assets/Scripts/Games/FanClub/NtrIdolAmie.cs index bf4523492..a6240094d 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolAmie.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolAmie.cs @@ -69,7 +69,7 @@ namespace HeavenStudio.Games.Scripts_FanClub //idol jumping physics float jumpPos = cond.GetPositionFromBeat(startJumpTime, 1f); float IDOL_SHADOW_SCALE = 1.18f; - if (cond.songPositionInBeatsAsDouble >= startJumpTime && cond.songPositionInBeatsAsDouble < startJumpTime + 1f) + if (cond.unswungSongPositionInBeatsAsDouble >= startJumpTime && cond.unswungSongPositionInBeatsAsDouble < startJumpTime + 1f) { hasJumped = true; float yMul = jumpPos * 2f - 1f; @@ -77,7 +77,7 @@ namespace HeavenStudio.Games.Scripts_FanClub rootTransform.transform.localPosition = new Vector3(startPostion + stepDistance * AnimCount, rootYPos + (2f * yWeight + 0.25f)); shadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, (1f-yWeight*0.8f) * IDOL_SHADOW_SCALE, 1f); - anim.DoScaledAnimation("Jump", startJumpTime, 1f); + anim.DoScaledAnimation("Jump", startJumpTime, 1f, ignoreSwing: true); } else { @@ -160,12 +160,11 @@ namespace HeavenStudio.Games.Scripts_FanClub { if (startStepBeat != double.MaxValue) return; if (!gameObject.activeInHierarchy) return; - startJumpTime = beat; + startJumpTime = Conductor.instance.GetUnSwungBeat(beat); //play anim BeatAction.New(this, new List() { - // new BeatAction.Action(beat, delegate { anim.Play("Jump", -1, 0); }), new BeatAction.Action(beat + 1f, delegate { anim.Play("Land", -1, 0); }), }); } diff --git a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs index 65ba9a38d..6200add58 100644 --- a/Assets/Scripts/Games/FanClub/NtrIdolFan.cs +++ b/Assets/Scripts/Games/FanClub/NtrIdolFan.cs @@ -116,7 +116,7 @@ namespace HeavenStudio.Games.Scripts_FanClub } if (PlayerInput.GetIsAction(FanClub.InputAction_BasicPressing)) { - if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + 2f && !stopCharge) + if (clappingStartTime != double.MinValue && cond.unswungSongPositionInBeatsAsDouble > clappingStartTime + 2f && !stopCharge) { animator.speed = 1f; animator.Play("FanClapCharge", -1, 0); @@ -131,7 +131,7 @@ namespace HeavenStudio.Games.Scripts_FanClub nonTouchDelay = 0f; stopCharge = true; } - if (clappingStartTime != double.MinValue && cond.songPositionInBeatsAsDouble > clappingStartTime + nonTouchDelay && stopCharge + if (clappingStartTime != double.MinValue && cond.unswungSongPositionInBeatsAsDouble > clappingStartTime + nonTouchDelay && stopCharge && !FanClub.instance.IsExpectingInputNow(FanClub.InputAction_FlickRelease.inputLockCategory)) { if (FanClub.instance.JudgementPaused) @@ -163,14 +163,14 @@ namespace HeavenStudio.Games.Scripts_FanClub } float jumpPos = cond.GetPositionFromBeat(jumpStartTime, 1f); - if (cond.songPositionInBeatsAsDouble >= jumpStartTime && cond.songPositionInBeatsAsDouble < jumpStartTime + 1f) + if (cond.unswungSongPositionInBeatsAsDouble >= jumpStartTime && cond.unswungSongPositionInBeatsAsDouble < jumpStartTime + 1f) { hasJumped = true; float yMul = jumpPos * 2f - 1f; float yWeight = -(yMul*yMul) + 1f; motionRoot.transform.localPosition = new Vector3(0, 3f * yWeight); shadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * 1.4f, (1f-yWeight*0.8f) * 1.4f, 1f); - animator.DoScaledAnimation("FanJump", jumpStartTime); + animator.DoScaledAnimation("FanJump", jumpStartTime, ignoreSwing: true); } else { @@ -205,12 +205,12 @@ namespace HeavenStudio.Games.Scripts_FanClub var cond = Conductor.instance; hasJumped = false; stopBeat = true; - jumpStartTime = -99f; + jumpStartTime = double.MinValue; animator.speed = 1f; animator.Play("FanClap", -1, 0); SoundByte.PlayOneShotGame("fanClub/play_clap"); SoundByte.PlayOneShotGame("fanClub/crap_impact"); - clappingStartTime = cond.songPositionInBeatsAsDouble; + clappingStartTime = cond.unswungSongPositionInBeatsAsDouble; if (doCharge) BeatAction.New(this, new List() @@ -247,7 +247,7 @@ namespace HeavenStudio.Games.Scripts_FanClub var cond = Conductor.instance; animator.Play("FanJump", -1, 0); SoundByte.PlayOneShotGame("fanClub/play_jump"); - jumpStartTime = cond.songPositionInBeatsAsDouble; + jumpStartTime = cond.unswungSongPositionInBeatsAsDouble; clappingStartTime = double.MinValue; stopCharge = false; } @@ -255,7 +255,7 @@ namespace HeavenStudio.Games.Scripts_FanClub public bool IsJumping() { var cond = Conductor.instance; - return (cond.songPositionInBeatsAsDouble >= jumpStartTime && cond.songPositionInBeatsAsDouble < jumpStartTime + 1f); + return (cond.unswungSongPositionInBeatsAsDouble >= jumpStartTime && cond.unswungSongPositionInBeatsAsDouble < jumpStartTime + 1f); } public void Bop() diff --git a/Assets/Scripts/Games/KarateMan/KarateMan.cs b/Assets/Scripts/Games/KarateMan/KarateMan.cs index 78e2171a3..d99bcb643 100644 --- a/Assets/Scripts/Games/KarateMan/KarateMan.cs +++ b/Assets/Scripts/Games/KarateMan/KarateMan.cs @@ -7,6 +7,7 @@ using HeavenStudio.Util; using HeavenStudio.InputSystem; using Jukebox; using System.Linq; +using BurstLinq; namespace HeavenStudio.Games.Loaders { diff --git a/Assets/Scripts/Games/KarateMan/KarateManPot.cs b/Assets/Scripts/Games/KarateMan/KarateManPot.cs index 5768680a4..8085c2518 100644 --- a/Assets/Scripts/Games/KarateMan/KarateManPot.cs +++ b/Assets/Scripts/Games/KarateMan/KarateManPot.cs @@ -38,7 +38,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan public bool KickBarrelContent = false; public bool ShouldGlow = false; - public int OnHitExpression = (int) KarateMan.KarateManFaces.Normal; + public int OnHitExpression = (int)KarateMan.KarateManFaces.Normal; public int comboId = -1; static int _lastCombo = -1; @@ -266,8 +266,6 @@ namespace HeavenStudio.Games.Scripts_KarateMan transform.rotation = Quaternion.Euler(0, 0, transform.rotation.eulerAngles.z + (-360f * Time.deltaTime) + UnityEngine.Random.Range(0f, 360f)); - - ShadowInstance = Instantiate(Shadow, KarateMan.instance.ItemHolder); shadowRenderer = ShadowInstance.GetComponent(); shadowRenderer.color = KarateMan.instance.Joe.Shadows[0].color; @@ -350,7 +348,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan } else if (type == ItemType.KickBall && cond.songPositionInBeatsAsDouble < startBeat + curveTargetBeat + 1f) return; - + Destroy(ShadowInstance.gameObject); Destroy(gameObject); return; @@ -585,9 +583,12 @@ namespace HeavenStudio.Games.Scripts_KarateMan p.Play(); break; case ItemType.KickBarrel: - if (KickBarrelContent) { + if (KickBarrelContent) + { game.CreateItemInstance(startBeat + 1f, "Item03", OnHitExpression, ItemType.KickBall); - } else { + } + else + { if (ShouldGlow) game.Joe.ApplyBombGlow(); game.CreateItemInstance(startBeat + 1f, "Item04", OnHitExpression, ItemType.KickBomb); } @@ -629,7 +630,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan break; } - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; status = FlyStatus.Hit; } @@ -765,7 +766,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (state <= -1f || state >= 1f) { bool straight = joe.Punch(ItemPunchHand(), false, ItemPunchHand() == 2); - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -788,7 +789,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan if (ItemNeedNori() && KarateMan.instance.NoriPerformance < 0.6f) { CreateHitMark(false); - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; status = FlyStatus.HitWeak; SoundByte.PlayOneShotGame("karateman/hitNoNori", forcePlay: true); joe.Punch(3); @@ -815,7 +816,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.ForceFailCombo(Conductor.instance.songPositionInBeatsAsDouble); if (state <= -1f || state >= 1f) { - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -885,7 +886,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.SetShouldComboId(comboId); if (state <= -1f || state >= 1f) { - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -932,7 +933,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan bool straight = joe.Punch(ItemPunchHand()); if (state <= -1f || state >= 1f) { - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -962,7 +963,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.ComboSequence(3); if (state <= -1f || state >= 1f) { - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[5]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -1052,7 +1053,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.Punch(ItemPunchHand()); if (state <= -1f || state >= 1f) { - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[6]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -1114,7 +1115,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan joe.Kick(Conductor.instance.songPositionInBeatsAsDouble); if (state <= -1f || state >= 1f) { - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; CurrentCurve = ItemCurves[8]; curveTargetBeat = 1f; SoundByte.PlayOneShot("miss"); @@ -1140,7 +1141,7 @@ namespace HeavenStudio.Games.Scripts_KarateMan ItemHitEffect(); status = FlyStatus.Hit; CurrentCurve = ItemCurves[7]; - startBeat = Conductor.instance.songPositionInBeatsAsDouble; + startBeat = Conductor.instance.unswungSongPositionInBeatsAsDouble; curveTargetBeat = 3f; KarateMan.instance.Nori.DoHit(); } diff --git a/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs b/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs index 3c39cfec4..7a33d0ad6 100644 --- a/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs +++ b/Assets/Scripts/Games/PajamaParty/CtrPillowMonkey.cs @@ -123,7 +123,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty public void Jump(double beat, int alt = 1) { - startJumpTime = beat; + startJumpTime = Conductor.instance.GetUnSwungBeat(beat); jumpAlt = 0; if (alt > 1) { @@ -140,7 +140,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty public void Throw(double beat, bool highCheck) { anim.DoUnscaledAnimation("MonkeyThrow" + animSuffix); - startThrowTime = beat; + startThrowTime = Conductor.instance.GetUnSwungBeat(beat); Projectile.SetActive(true); if (highCheck) diff --git a/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs b/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs index a37dddbfb..2431bbab4 100644 --- a/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs +++ b/Assets/Scripts/Games/PajamaParty/CtrPillowPlayer.cs @@ -182,7 +182,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty { throwType = false; throwLength = 0.5; - Projectile.GetComponent().DoScaledAnimation("ThrowOut", startThrowTime, throwLength); + Projectile.GetComponent().DoScaledAnimation("ThrowOut", Conductor.instance.GetUnSwungBeat(startThrowTime), throwLength); Projectile.transform.rotation = Quaternion.Euler(0, 0, 360f * UnityEngine.Random.Range(0f, 1f)); } else @@ -310,12 +310,12 @@ namespace HeavenStudio.Games.Scripts_PajamaParty if (state <= -1f || state >= 1f) { SoundByte.PlayOneShot("miss"); - PlayerJump(cond.songPositionInBeatsAsDouble, false, true); + PlayerJump(cond.unswungSongPositionInBeatsAsDouble, false, true); } else { SoundByte.PlayOneShotGame("pajamaParty/jumpJust"); - PlayerJump(cond.songPositionInBeatsAsDouble, false, false); + PlayerJump(cond.unswungSongPositionInBeatsAsDouble, false, false); } caller.CanHit(false); } @@ -328,7 +328,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty if (canJump) { var cond = Conductor.instance; - PlayerThrough(cond.songPositionInBeatsAsDouble); + PlayerThrough(cond.unswungSongPositionInBeatsAsDouble); } } ////// @@ -359,12 +359,12 @@ namespace HeavenStudio.Games.Scripts_PajamaParty { SoundByte.PlayOneShot("miss"); throwNg = true; - EndCharge(cond.songPositionInBeatsAsDouble, true, throwNg); + EndCharge(cond.unswungSongPositionInBeatsAsDouble, true, throwNg); } else { SoundByte.PlayOneShotGame("pajamaParty/throw5"); - EndCharge(cond.songPositionInBeatsAsDouble, true, throwNg); + EndCharge(cond.unswungSongPositionInBeatsAsDouble, true, throwNg); } caller.CanHit(false); } @@ -374,7 +374,7 @@ namespace HeavenStudio.Games.Scripts_PajamaParty if (canCharge) { var cond = Conductor.instance; - PlayerThrough(cond.songPositionInBeatsAsDouble); + PlayerThrough(cond.unswungSongPositionInBeatsAsDouble); } } // diff --git a/Assets/Scripts/Games/RhythmTweezers/LongHair.cs b/Assets/Scripts/Games/RhythmTweezers/LongHair.cs index 80455e27a..e6b627f7d 100644 --- a/Assets/Scripts/Games/RhythmTweezers/LongHair.cs +++ b/Assets/Scripts/Games/RhythmTweezers/LongHair.cs @@ -43,7 +43,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers var hairDirection = new Vector3(tst.x + 0.173f, tst.y) - holder.transform.position; holder.transform.rotation = Quaternion.FromToRotation(Vector3.down, hairDirection); - float normalizedBeat = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f); + float normalizedBeat = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f, ignoreSwing: false); anim.Play("LoopPull", 0, normalizedBeat); tweezers.anim.Play("Tweezers_LongPluck", 0, normalizedBeat); if (!game.IsExpectingInputNow(RhythmTweezers.InputAction_Release) && PlayerInput.GetIsAction(RhythmTweezers.InputAction_Release) && normalizedBeat < 1f) @@ -73,7 +73,7 @@ namespace HeavenStudio.Games.Scripts_RhythmTweezers public void EndEarly() { - var normalized = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f); + var normalized = Conductor.instance.GetPositionFromBeat(inputBeat, 0.5f, ignoreSwing: false); anim.Play("LoopPullReverse", 0, normalized); tweezers.anim.Play("Tweezers_Idle", 0, 0); diff --git a/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs b/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs index 2a1c2d6f3..16eee9878 100644 --- a/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs +++ b/Assets/Scripts/Games/RhythmTweezers/RhythmTweezers.cs @@ -293,7 +293,7 @@ namespace HeavenStudio.Games spawnedHairs.Add(hair); hair.gameObject.SetActive(true); hair.GetComponent().Play("SmallAppear", 0, 1); - float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(beat, 1); + float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(conductor.GetUnSwungBeat(beat), 1); hair.transform.eulerAngles = new Vector3(0, 0, rot); hair.createBeat = beat; } @@ -306,7 +306,7 @@ namespace HeavenStudio.Games spawnedLongs.Add(hair); hair.gameObject.SetActive(true); hair.GetComponent().Play("LongAppear", 0, 1); - float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(beat, 1); + float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(conductor.GetUnSwungBeat(beat), 1); hair.transform.eulerAngles = new Vector3(0, 0, rot); hair.createBeat = beat; } @@ -333,7 +333,7 @@ namespace HeavenStudio.Games }) }); - float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(beat, 1); + float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(conductor.GetUnSwungBeat(beat), 1); hair.transform.eulerAngles = new Vector3(0, 0, rot); hair.createBeat = beat; } @@ -358,7 +358,7 @@ namespace HeavenStudio.Games }) }); - float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(beat, 1); + float rot = -58f + 116 * crHandlerInstance.GetIntervalProgressFromBeat(conductor.GetUnSwungBeat(beat), 1); hair.transform.eulerAngles = new Vector3(0, 0, rot); hair.createBeat = beat; } diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TempoDialog.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TempoDialog.cs index e9590f354..8211b8929 100644 --- a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TempoDialog.cs +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TempoDialog.cs @@ -14,6 +14,8 @@ public class TempoDialog : Dialog [SerializeField] Button deleteButton; [SerializeField] TMP_InputField tempoInput; + [SerializeField] TMP_InputField swingInput; + [SerializeField] Slider swingSlider; public void SwitchTempoDialog() { @@ -28,6 +30,9 @@ public class TempoDialog : Dialog Editor.instance.inAuthorativeMenu = true; ResetAllDialogs(); dialog.SetActive(true); + + swingSlider.maxValue = 0.25f; + swingSlider.minValue = 0; } } @@ -45,6 +50,8 @@ public class TempoDialog : Dialog deleteButton.gameObject.SetActive(!tempoObj.first); tempoInput.text = tempoObj.chartEntity["tempo"].ToString("F"); + swingInput.text = (tempoObj.chartEntity["swing"] * 400).ToString("F"); + swingSlider.value = tempoObj.chartEntity["swing"]; } public void DeleteTempo() @@ -86,4 +93,25 @@ public class TempoDialog : Dialog tempoInput.text = tempoObj.chartEntity["tempo"].ToString("F"); } } + + public void SwingSliderUpdate() + { + if (tempoObj != null) + { + tempoObj.SetSwing(System.MathF.Round(swingSlider.value, 4)); + swingInput.text = (tempoObj.chartEntity["swing"] * 400).ToString("F"); + swingSlider.value = tempoObj.chartEntity["swing"]; + } + } + + public void SetSwing() + { + if (tempoObj != null) + { + float swing = float.Parse(swingInput.text); + tempoObj.SetSwing(swing * 0.25f / 100f); + swingInput.text = (tempoObj.chartEntity["swing"] * 400).ToString("F"); + swingSlider.value = tempoObj.chartEntity["swing"]; + } + } } diff --git a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs index 809924c9f..eaea27474 100644 --- a/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs +++ b/Assets/Scripts/LevelEditor/Timeline/SpecialTmeline/TimelineObjs/TempoTimelineObj.cs @@ -62,6 +62,12 @@ namespace HeavenStudio.Editor.Track SetX(chartEntity); } + public void SetSwing(float swing) + { + chartEntity["swing"] = Mathf.Clamp(swing, 0, 0.5f); + UpdateTempo(); + } + public override void Init() { UpdateTempo(); diff --git a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs index 02914c252..610272d5b 100644 --- a/Assets/Scripts/LevelEditor/Timeline/Timeline.cs +++ b/Assets/Scripts/LevelEditor/Timeline/Timeline.cs @@ -476,7 +476,7 @@ namespace HeavenStudio.Editor.Track if (Conductor.instance.metronome) { var startBeat = Mathf.FloorToInt(Conductor.instance.songPositionInBeats - 0.5f); - var nm = Conductor.instance.GetLoopPositionFromBeat(0.5f, 1f); + var nm = Conductor.instance.GetLoopPositionFromBeat(0.5f, 1f, ignoreSwing: false); var loop = (startBeat % 2 == 0) ? Mathf.SmoothStep(-1.1f, 1f, nm) : Mathf.SmoothStep(1f, -1f, nm); rot = loop * 45f; @@ -674,16 +674,14 @@ namespace HeavenStudio.Editor.Track public void Play(bool fromStart, float time) { - // if (fromStart) Stop(); - + GameManager.instance.SafePlay(time, 0, false); if (!Conductor.instance.isPaused) { TimelineSongPosLine = Instantiate(TimelineSongPosLineRef, TimelineSongPosLineRef.parent).GetComponent(); TimelineSongPosLine.gameObject.SetActive(true); + TimelineSongPosLine.transform.localPosition = new Vector3(time * PixelsPerBeat, TimelineSongPosLine.transform.localPosition.y); } - GameManager.instance.SafePlay(time, 0, false); - SetTimeButtonColors(false, true, true); } diff --git a/Assets/Scripts/Util/AnimationHelpers.cs b/Assets/Scripts/Util/AnimationHelpers.cs index 52610a4a7..03565169b 100644 --- a/Assets/Scripts/Util/AnimationHelpers.cs +++ b/Assets/Scripts/Util/AnimationHelpers.cs @@ -34,10 +34,10 @@ namespace HeavenStudio.Util /// duration of animation (progress 1.0) /// multiplier for animation progress (smaller values make animation slower) /// animator layer to play animation on - public static void DoScaledAnimation(this Animator anim, string animName, double startTime, double length = 1, float timeScale = 1f, int animLayer = -1, bool clamp = false) + public static void DoScaledAnimation(this Animator anim, string animName, double startTime, double length = 1, float timeScale = 1f, int animLayer = -1, bool clamp = false, bool ignoreSwing = true) { if (anim == null) return; - float pos = Conductor.instance.GetPositionFromBeat(startTime, length) * timeScale; + float pos = Conductor.instance.GetPositionFromBeat(startTime, length, ignoreSwing: ignoreSwing) * timeScale; if (clamp) pos = Mathf.Clamp01(pos); anim.Play(animName, animLayer, pos); anim.speed = 1f; //not 0 so these can still play their script events diff --git a/Assets/Scripts/Util/MultiSound.cs b/Assets/Scripts/Util/MultiSound.cs index 1722ed88b..d79143dbf 100644 --- a/Assets/Scripts/Util/MultiSound.cs +++ b/Assets/Scripts/Util/MultiSound.cs @@ -1,7 +1,6 @@ using System.Collections; using System.Collections.Generic; using System.Linq; -using BurstLinq; using UnityEngine; using Cysharp.Threading.Tasks; @@ -108,12 +107,16 @@ namespace HeavenStudio.Util Destroy(gameObject); } - public void StopAll() + public void StopAll(bool destroy = false) { foreach (Util.Sound sound in playingSounds) { sound.Stop(); } + if (destroy) + { + Destroy(gameObject); + } } } } \ No newline at end of file