Performance Improvements (#173)

* improve performance with new render settings

- fix letterboxing losing camera references

* fin in missing params?

needs testing

* finish default param check

* scale jump animation of fan club spectators

* fix missing references in a karate man method

* more liberal use of Double in conductor

beatkeeping is now absolute instead of being additive

* optimize Conductor more

reduce caching from constantly sorting tempo changes despite game manager doing it for us
moved metronome logic to LateUpdate
This commit is contained in:
minenice55 2022-09-22 22:05:04 -04:00 committed by GitHub
parent af8dd6142e
commit 695f6671fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
26 changed files with 398 additions and 248 deletions

View file

@ -1,5 +1,56 @@
%YAML 1.1 %YAML 1.1
%TAG !u! tag:unity3d.com,2011: %TAG !u! tag:unity3d.com,2011:
--- !u!1 &5584137290458315811
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 455520442982280351}
- component: {fileID: 6060748659854770895}
m_Layer: 0
m_Name: LetterboxFullscreen
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &455520442982280351
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5584137290458315811}
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_Children: []
m_Father: {fileID: 6234653029009288364}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &6060748659854770895
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5584137290458315811}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e188ee899633d0b49870a5ae38b7359d, type: 3}
m_Name:
m_EditorClassIdentifier:
ratio: {x: 16, y: 9}
forceRatioOnAwake: 1
listenForWindowChanges: 1
createCameraForLetterBoxRendering: 0
findCamerasAutomatically: 1
letterBoxCameraColor: {r: 0, g: 0, b: 0, a: 1}
cameras: []
letterBoxCamera: {fileID: 5997098664667581191}
--- !u!1 &6234653028281991659 --- !u!1 &6234653028281991659
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -202,9 +253,85 @@ Transform:
- {fileID: 6234653028453841262} - {fileID: 6234653028453841262}
- {fileID: 6234653028281991656} - {fileID: 6234653028281991656}
- {fileID: 1942359490671534657} - {fileID: 1942359490671534657}
- {fileID: 455520442982280351}
- {fileID: 3022914124654306410}
m_Father: {fileID: 0} m_Father: {fileID: 0}
m_RootOrder: 0 m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &7745146194305554249
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3022914124654306410}
- component: {fileID: 5997098664667581191}
m_Layer: 0
m_Name: LetterboxBgCam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &3022914124654306410
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7745146194305554249}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 6234653029009288364}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!20 &5997098664667581191
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7745146194305554249}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -100
m_CullingMask:
serializedVersion: 2
m_Bits: 0
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!1 &8463691957270393964 --- !u!1 &8463691957270393964
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -100,6 +100,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.5
value: {x: -0.521, y: 2.32, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -141,6 +150,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.5
value: {x: 0.521, y: 2.32, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -198,6 +216,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334} outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
- serializedVersion: 3
time: 0.5
value: {x: 0, y: 1.63, z: 0}
inSlope: {x: Infinity, y: Infinity, z: Infinity}
outSlope: {x: Infinity, y: Infinity, z: Infinity}
tangentMode: 0
weightedMode: 0
inWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
outWeight: {x: 0.33333334, y: 0.33333334, z: 0.33333334}
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -333,6 +360,8 @@ AnimationClip:
value: {fileID: -198993962868910611, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3} value: {fileID: -198993962868910611, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
- time: 0.033333335 - time: 0.033333335
value: {fileID: 1143994186590036386, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3} value: {fileID: 1143994186590036386, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
- time: 0.5
value: {fileID: 1143994186590036386, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
attribute: m_Sprite attribute: m_Sprite
path: root_motion/Body/fan_Body00 path: root_motion/Body/fan_Body00
classID: 212 classID: 212
@ -491,12 +520,13 @@ AnimationClip:
- {fileID: 3272263371775538141, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3} - {fileID: 3272263371775538141, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
- {fileID: -198993962868910611, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3} - {fileID: -198993962868910611, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
- {fileID: 1143994186590036386, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3} - {fileID: 1143994186590036386, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
- {fileID: 1143994186590036386, guid: 3ceb27c8c676e7a428cf6e15cd11b7ef, type: 3}
m_AnimationClipSettings: m_AnimationClipSettings:
serializedVersion: 2 serializedVersion: 2
m_AdditiveReferencePoseClip: {fileID: 0} m_AdditiveReferencePoseClip: {fileID: 0}
m_AdditiveReferencePoseTime: 0 m_AdditiveReferencePoseTime: 0
m_StartTime: 0 m_StartTime: 0
m_StopTime: 0.050000004 m_StopTime: 0.51666665
m_OrientationOffsetY: 0 m_OrientationOffsetY: 0
m_Level: 0 m_Level: 0
m_CycleOffset: 0.05 m_CycleOffset: 0.05
@ -533,6 +563,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: -0.521
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -561,6 +600,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 2.32
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -589,6 +637,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -807,6 +864,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0.521
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -835,6 +901,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 2.32
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -863,6 +938,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -1157,6 +1241,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -1185,6 +1278,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 1.63
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4
@ -1213,6 +1315,15 @@ AnimationClip:
weightedMode: 0 weightedMode: 0
inWeight: 0.33333334 inWeight: 0.33333334
outWeight: 0.33333334 outWeight: 0.33333334
- serializedVersion: 3
time: 0.5
value: 0
inSlope: Infinity
outSlope: Infinity
tangentMode: 103
weightedMode: 0
inWeight: 0.33333334
outWeight: 0.33333334
m_PreInfinity: 2 m_PreInfinity: 2
m_PostInfinity: 2 m_PostInfinity: 2
m_RotationOrder: 4 m_RotationOrder: 4

View file

@ -3041,57 +3041,6 @@ MonoBehaviour:
m_Name: m_Name:
m_EditorClassIdentifier: m_EditorClassIdentifier:
Content: {fileID: 1750038561} Content: {fileID: 1750038561}
--- !u!1 &89978021
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 89978023}
- component: {fileID: 89978022}
m_Layer: 0
m_Name: LetterboxFullscreen
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &89978022
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 89978021}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e188ee899633d0b49870a5ae38b7359d, type: 3}
m_Name:
m_EditorClassIdentifier:
ratio: {x: 16, y: 9}
forceRatioOnAwake: 1
listenForWindowChanges: 1
createCameraForLetterBoxRendering: 0
findCamerasAutomatically: 1
letterBoxCameraColor: {r: 0, g: 0, b: 0, a: 1}
cameras: []
letterBoxCamera: {fileID: 1186982022}
--- !u!4 &89978023
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 89978021}
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_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &93132552 --- !u!1 &93132552
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -4820,7 +4769,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 0} m_AnchorMax: {x: 1, y: 0}
m_AnchoredPosition: {x: -289.15005, y: 2} m_AnchoredPosition: {x: -289.15002, y: 2}
m_SizeDelta: {x: -578.29, y: 49.92} m_SizeDelta: {x: -578.29, y: 49.92}
m_Pivot: {x: 0.5, y: 0} m_Pivot: {x: 0.5, y: 0}
--- !u!114 &156962255 --- !u!114 &156962255
@ -5203,7 +5152,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &172566393 --- !u!114 &172566393
@ -10484,7 +10433,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 0} m_AnchorMax: {x: 0.5, y: 0}
m_AnchoredPosition: {x: -0.0050354004, y: 0.000061035156} m_AnchoredPosition: {x: -0.0050354004, y: 0}
m_SizeDelta: {x: 1280, y: 281.88} m_SizeDelta: {x: 1280, y: 281.88}
m_Pivot: {x: 0.5, y: 0} m_Pivot: {x: 0.5, y: 0}
--- !u!114 &382658482 --- !u!114 &382658482
@ -11823,7 +11772,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &435667403 --- !u!114 &435667403
@ -12269,7 +12218,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &454315226 --- !u!114 &454315226
@ -14758,7 +14707,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 119.83, y: -19.690994} m_AnchoredPosition: {x: 119.83, y: -19.690979}
m_SizeDelta: {x: 578.29, y: -43.6} m_SizeDelta: {x: 578.29, y: -43.6}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &546272878 --- !u!114 &546272878
@ -15986,7 +15935,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -49.99994} m_AnchoredPosition: {x: 0, y: -50}
m_SizeDelta: {x: -48, y: -148} m_SizeDelta: {x: -48, y: -148}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &572765323 --- !u!114 &572765323
@ -17475,7 +17424,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 704039020} m_HandleRect: {fileID: 704039020}
m_Direction: 0 m_Direction: 0
m_Value: 0 m_Value: 0
m_Size: 0.03287128 m_Size: 0.032871276
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
@ -19222,7 +19171,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &673880752 --- !u!114 &673880752
@ -25344,8 +25293,8 @@ MonoBehaviour:
m_TargetGraphic: {fileID: 1589389272} m_TargetGraphic: {fileID: 1589389272}
m_HandleRect: {fileID: 1589389271} m_HandleRect: {fileID: 1589389271}
m_Direction: 2 m_Direction: 2
m_Value: 1 m_Value: 0
m_Size: 0.9999893 m_Size: 1
m_NumberOfSteps: 0 m_NumberOfSteps: 0
m_OnValueChanged: m_OnValueChanged:
m_PersistentCalls: m_PersistentCalls:
@ -25843,7 +25792,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &926134725 --- !u!114 &926134725
@ -26534,7 +26483,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &948189509 --- !u!114 &948189509
@ -29483,7 +29432,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0} m_AnchorMin: {x: 0.5, y: 0}
m_AnchorMax: {x: 0.5, y: 1} m_AnchorMax: {x: 0.5, y: 1}
m_AnchoredPosition: {x: 120.830025, y: -19.690964} m_AnchoredPosition: {x: 120.830025, y: -19.690979}
m_SizeDelta: {x: 576.29, y: -43.38} m_SizeDelta: {x: 576.29, y: -43.38}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1056099133 --- !u!114 &1056099133
@ -30892,7 +30841,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -408.98004, y: -17} m_AnchoredPosition: {x: -408.97998, y: -17}
m_SizeDelta: {x: -817.96, y: -46.29} m_SizeDelta: {x: -817.96, y: -46.29}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &1118147045 --- !u!1 &1118147045
@ -32369,7 +32318,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 1, y: 0.5} m_AnchorMax: {x: 1, y: 0.5}
m_AnchoredPosition: {x: 0, y: 129.90404} m_AnchoredPosition: {x: 0, y: 129.8829}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 1}
--- !u!114 &1154875944 --- !u!114 &1154875944
@ -33172,7 +33121,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -49.99991} m_AnchoredPosition: {x: 0, y: -49.999878}
m_SizeDelta: {x: -48, y: -148} m_SizeDelta: {x: -48, y: -148}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1182686745 --- !u!114 &1182686745
@ -33411,80 +33360,6 @@ CanvasRenderer:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1186810248} m_GameObject: {fileID: 1186810248}
m_CullTransparentMesh: 1 m_CullTransparentMesh: 1
--- !u!1 &1186982020
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1186982023}
- component: {fileID: 1186982022}
m_Layer: 0
m_Name: LetterboxBgCam
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!20 &1186982022
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1186982020}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_FocalLength: 50
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -100
m_CullingMask:
serializedVersion: 2
m_Bits: 0
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1186982023
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1186982020}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1192611371 --- !u!1 &1192611371
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -38150,7 +38025,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: -0.0012207031, y: 0.000061035156} m_AnchoredPosition: {x: -0.0012207031, y: 0}
m_SizeDelta: {x: 0, y: -0.000030517578} m_SizeDelta: {x: 0, y: -0.000030517578}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1336470763 --- !u!114 &1336470763
@ -39252,7 +39127,7 @@ MonoBehaviour:
m_EditorClassIdentifier: m_EditorClassIdentifier:
MainCanvas: {fileID: 1791483802} MainCanvas: {fileID: 1791483802}
EditorCamera: {fileID: 2047408675} EditorCamera: {fileID: 2047408675}
GameLetterbox: {fileID: 89978021} GameLetterbox: {fileID: 0}
ScreenRenderTexture: {fileID: 8400000, guid: d3f3d6ca32122da4d9e3a8e7aa2ede16, type: 2} ScreenRenderTexture: {fileID: 8400000, guid: d3f3d6ca32122da4d9e3a8e7aa2ede16, type: 2}
Screen: {fileID: 558010761} Screen: {fileID: 558010761}
GridGameSelector: {fileID: 1154875943} GridGameSelector: {fileID: 1154875943}
@ -39277,6 +39152,7 @@ MonoBehaviour:
- {fileID: 1265865542} - {fileID: 1265865542}
- {fileID: 1336470763} - {fileID: 1336470763}
- {fileID: 1946344932} - {fileID: 1946344932}
- {fileID: 292323699}
tooltipText: {fileID: 1196204504} tooltipText: {fileID: 1196204504}
fullscreen: 0 fullscreen: 0
discordDuringTesting: 0 discordDuringTesting: 0
@ -45885,7 +45761,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 111.50012, y: -29.533981} m_AnchoredPosition: {x: 111.50012, y: -29.533966}
m_SizeDelta: {x: 223, y: -108.27} m_SizeDelta: {x: 223, y: -108.27}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1671351976 --- !u!114 &1671351976
@ -49282,7 +49158,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: -84.99002} m_AnchoredPosition: {x: 0, y: -84.99005}
m_SizeDelta: {x: 320, y: -84.99} m_SizeDelta: {x: 320, y: -84.99}
m_Pivot: {x: 0, y: 1} m_Pivot: {x: 0, y: 1}
--- !u!1 &1852819572 --- !u!1 &1852819572
@ -52665,7 +52541,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -29.530014} m_AnchoredPosition: {x: 0, y: -29.529999}
m_SizeDelta: {x: 0, y: -108.26} m_SizeDelta: {x: 0, y: -108.26}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1980243267 --- !u!114 &1980243267
@ -56143,7 +56019,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -39.001007} m_AnchoredPosition: {x: 0, y: -39.000977}
m_SizeDelta: {x: 0, y: -78.32001} m_SizeDelta: {x: 0, y: -78.32001}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &2122610459 --- !u!114 &2122610459

View file

@ -355,6 +355,21 @@ namespace HeavenStudio
if (!dynamicData.ContainsKey(param.propertyName)) if (!dynamicData.ContainsKey(param.propertyName))
{ {
type = param.parameter.GetType(); type = param.parameter.GetType();
//FUTURE: attempt to convert to a new entity if a converter exists for this datamodel
//add property if it doesn't exist
if (!e.DynamicData.ContainsKey(param.propertyName))
{
Debug.LogWarning($"Property {param.propertyName} does not exist in the entity's dynamic data! Adding...");
if (type == typeof(EntityTypes.Integer))
dynamicData.Add(param.propertyName, (int)param.parameter);
else if (type == typeof(EntityTypes.Float))
dynamicData.Add(param.propertyName, (float)param.parameter);
else if (type.IsEnum && param.propertyName != "ease")
dynamicData.Add(param.propertyName, (int)param.parameter);
else
dynamicData.Add(param.propertyName, Convert.ChangeType(param.parameter, type));
continue;
}
pType = e[param.propertyName].GetType(); pType = e[param.propertyName].GetType();
if (pType == type) if (pType == type)
{ {

View file

@ -1,7 +1,6 @@
using System.Collections; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
using UnityEngine.Audio;
using Starpelly; using Starpelly;
@ -21,15 +20,15 @@ namespace HeavenStudio
public float pitchedSecPerBeat => (secPerBeat / musicSource.pitch); public float pitchedSecPerBeat => (secPerBeat / musicSource.pitch);
// Current song position, in seconds // Current song position, in seconds
private float songPos; // for Conductor use only private double songPos; // for Conductor use only
public float songPosition; public float songPosition => (float) songPos;
// Current song position, in beats // Current song position, in beats
private float songPosBeat; // for Conductor use only private double songPosBeat; // for Conductor use only
public float songPositionInBeats; public float songPositionInBeats => (float) songPosBeat;
// Current time of the song // Current time of the song
private float time; private double time;
double lastAbsTime; double lastAbsTime;
@ -54,7 +53,7 @@ namespace HeavenStudio
// Metronome tick sound enabled // Metronome tick sound enabled
public bool metronome = false; public bool metronome = false;
public float timeSinceLastTempoChange = 0; public float timeSinceLastTempoChange = Single.MinValue;
private bool beat; private bool beat;
@ -67,7 +66,7 @@ namespace HeavenStudio
public void SetBeat(float beat) public void SetBeat(float beat)
{ {
float secFromBeat = GetSongPosFromBeat(beat); float secFromBeat = (float) GetSongPosFromBeat(beat);
if (musicSource.clip != null) if (musicSource.clip != null)
{ {
@ -79,11 +78,11 @@ namespace HeavenStudio
GameManager.instance.SetCurrentEventToClosest(beat); GameManager.instance.SetCurrentEventToClosest(beat);
songPosBeat = beat; songPosBeat = beat;
songPositionInBeats = songPosBeat;
} }
public void Play(float beat) public void Play(float beat)
{ {
GameManager.instance.SortEventsList();
bool negativeOffset = firstBeatOffset < 0f; bool negativeOffset = firstBeatOffset < 0f;
bool negativeStartTime = false; bool negativeStartTime = false;
@ -119,12 +118,12 @@ namespace HeavenStudio
if (musicStartTime < 0f) if (musicStartTime < 0f)
{ {
musicSource.time = startPos; musicSource.time = (float) startPos;
musicSource.PlayScheduled(AudioSettings.dspTime - firstBeatOffset / musicSource.pitch); musicSource.PlayScheduled(AudioSettings.dspTime - firstBeatOffset / musicSource.pitch);
} }
else else
{ {
musicSource.time = musicStartTime; musicSource.time = (float) musicStartTime;
musicSource.PlayScheduled(AudioSettings.dspTime); musicSource.PlayScheduled(AudioSettings.dspTime);
} }
} }
@ -132,11 +131,11 @@ namespace HeavenStudio
{ {
if (negativeStartTime) if (negativeStartTime)
{ {
musicSource.time = startPos; musicSource.time = (float) startPos;
} }
else else
{ {
musicSource.time = startPos + firstBeatOffset; musicSource.time = (float) startPos + firstBeatOffset;
} }
musicSource.PlayScheduled(AudioSettings.dspTime); musicSource.PlayScheduled(AudioSettings.dspTime);
@ -160,7 +159,6 @@ namespace HeavenStudio
this.time = time; this.time = time;
songPosBeat = 0; songPosBeat = 0;
songPositionInBeats = 0;
isPlaying = false; isPlaying = false;
isPaused = false; isPaused = false;
@ -171,33 +169,31 @@ namespace HeavenStudio
public void Update() public void Update()
{ {
secPerBeat = 60f / songBpm;
if (isPlaying) if (isPlaying)
{ {
double absTime = Time.realtimeSinceStartupAsDouble; double absTime = Time.realtimeSinceStartupAsDouble;
float dt = (float) (absTime - lastAbsTime) * musicSource.pitch; double dt = (absTime - lastAbsTime) * musicSource.pitch;
lastAbsTime = absTime; lastAbsTime = absTime;
time += dt; time += dt;
songPos = time; songPos = time;
songPosition = songPos;
songPosBeat += (dt / secPerBeat); songPosBeat = GetBeatFromSongPos(songPos - firstBeatOffset);
songPositionInBeats = songPosBeat; }
// songPositionInBeats = Time.deltaTime / secPerBeat; }
if (metronome) public void LateUpdate()
{
if (metronome)
{
if (ReportBeat(ref lastReportedBeat))
{ {
if (ReportBeat(ref lastReportedBeat)) Util.Jukebox.PlayOneShot("metronome");
{ }
Util.Jukebox.PlayOneShot("metronome"); else if (songPositionInBeats < lastReportedBeat)
} {
else if (songPositionInBeats < lastReportedBeat) lastReportedBeat = Mathf.Round(songPositionInBeats);
{
lastReportedBeat = Mathf.Round(songPositionInBeats);
}
} }
} }
} }
@ -242,87 +238,60 @@ namespace HeavenStudio
return GetBeatFromPosition(position, targetBeat - margin, margin); return GetBeatFromPosition(position, targetBeat - margin, margin);
} }
private List<Beatmap.TempoChange> GetSortedTempoChanges(Beatmap chart)
{
//iterate over all tempo changes, adding to counter
List<Beatmap.TempoChange> tempoChanges = chart.tempoChanges;
tempoChanges.Sort((x, y) => x.beat.CompareTo(y.beat)); //sorts all tempo changes by ascending time (GameManager already does this but juste en cas...)
return tempoChanges;
}
private List<DynamicBeatmap.TempoChange> GetSortedTempoChanges(DynamicBeatmap chart) private List<DynamicBeatmap.TempoChange> GetSortedTempoChanges(DynamicBeatmap chart)
{ {
//iterate over all tempo changes, adding to counter GameManager.instance.SortEventsList();
List<DynamicBeatmap.TempoChange> tempoChanges = chart.tempoChanges; return GameManager.instance.Beatmap.tempoChanges;
tempoChanges.Sort((x, y) => x.beat.CompareTo(y.beat)); //sorts all tempo changes by ascending time (GameManager already does this but juste en cas...)
return tempoChanges;
} }
public float GetSongPosFromBeat(float beat) public double GetSongPosFromBeat(float beat)
{ {
var chart = GameManager.instance.Beatmap; var chart = GameManager.instance.Beatmap;
SetBpm(chart.bpm); SetBpm(chart.bpm);
//initial counter double counter = 0f;
float counter = 0f;
//time of last tempo change, to know how much to add to counter
float lastTempoChangeBeat = 0f; float lastTempoChangeBeat = 0f;
//iterate over all tempo changes, adding to counter foreach (var t in GameManager.instance.Beatmap.tempoChanges)
var tempoChanges = GetSortedTempoChanges(chart);
foreach (var t in tempoChanges)
{ {
if (t.beat > beat) if (t.beat > beat)
{ {
// this tempo change is past our requested time, abort
break; break;
} }
// Debug.Log("tempo change at " + t.beat);
counter += (t.beat - lastTempoChangeBeat) * secPerBeat; counter += (t.beat - lastTempoChangeBeat) * secPerBeat;
// Debug.Log("counter is now " + counter);
// now update to new bpm
SetBpm(t.tempo); SetBpm(t.tempo);
lastTempoChangeBeat = t.beat; lastTempoChangeBeat = t.beat;
} }
//passed all past tempo changes, now extrapolate from last tempo change until requested position
counter += (beat - lastTempoChangeBeat) * secPerBeat; counter += (beat - lastTempoChangeBeat) * secPerBeat;
// Debug.Log("GetSongPosFromBeat returning " + counter);
return counter; return counter;
} }
//thank you @wooningcharithri#7419 for the psuedo-code //thank you @wooningcharithri#7419 for the psuedo-code
private float BeatsToSecs(float beats, float bpm) private double BeatsToSecs(double beats, float bpm)
{ {
// Debug.Log("BeatsToSecs returning " + beats / bpm * 60);
return beats / bpm * 60f; return beats / bpm * 60f;
} }
private float SecsToBeats(float s, float bpm) private double SecsToBeats(double s, float bpm)
{ {
// Debug.Log("SecsToBeats returning " + s / 60f / bpm);
return s / 60f * bpm; return s / 60f * bpm;
} }
public float GetBeatFromSongPos(float seconds) public double GetBeatFromSongPos(double seconds)
{ {
// Debug.Log("Getting beat of seconds " + seconds); double lastTempoChangeBeat = 0f;
var chart = GameManager.instance.Beatmap; double counterSeconds = -firstBeatOffset;
float lastTempoChangeBeat = 0f; float lastBpm = GameManager.instance.Beatmap.bpm;
float lastBpm = chart.bpm;
float counterSeconds = -firstBeatOffset;
var tempoChanges = GetSortedTempoChanges(chart); foreach (var t in GameManager.instance.Beatmap.tempoChanges)
foreach (var t in tempoChanges)
{ {
float beatToNext = t.beat - lastTempoChangeBeat; double beatToNext = t.beat - lastTempoChangeBeat;
float secToNext = BeatsToSecs(beatToNext, lastBpm); double secToNext = BeatsToSecs(beatToNext, lastBpm);
float nextSecs = counterSeconds + secToNext; double nextSecs = counterSeconds + secToNext;
// Debug.Log("nextSecs is " + nextSecs + ", seconds " + seconds);
if (nextSecs >= seconds) if (nextSecs >= seconds)
break; break;
@ -330,9 +299,6 @@ namespace HeavenStudio
lastBpm = t.tempo; lastBpm = t.tempo;
counterSeconds = nextSecs; counterSeconds = nextSecs;
} }
// Debug.Log("lastTempoChangeBeat is " + lastTempoChangeBeat + ", counterSeconds is " + counterSeconds);
return lastTempoChangeBeat + SecsToBeats(seconds - counterSeconds, lastBpm); return lastTempoChangeBeat + SecsToBeats(seconds - counterSeconds, lastBpm);
} }
// //
@ -357,7 +323,7 @@ namespace HeavenStudio
public float SongLengthInBeats() public float SongLengthInBeats()
{ {
if (!musicSource.clip) return 0; if (!musicSource.clip) return 0;
return GetBeatFromSongPos(musicSource.clip.length); return (float) GetBeatFromSongPos(musicSource.clip.length);
} }
public bool SongPosLessThanClipLength(float t) public bool SongPosLessThanClipLength(float t)
@ -368,6 +334,14 @@ namespace HeavenStudio
return false; return false;
} }
public bool SongPosLessThanClipLength(double t)
{
if (musicSource.clip != null)
return t < musicSource.clip.length;
else
return false;
}
public bool NotStopped() public bool NotStopped()
{ {
return Conductor.instance.isPlaying == true || Conductor.instance.isPaused == true; return Conductor.instance.isPlaying == true || Conductor.instance.isPaused == true;

View file

@ -21,6 +21,7 @@ namespace HeavenStudio
[Header("Components")] [Header("Components")]
public TextAsset txt; public TextAsset txt;
public Camera GameCamera, CursorCam, OverlayCamera; public Camera GameCamera, CursorCam, OverlayCamera;
public GameObject GameLetterbox;
public CircleCursor CircleCursor; public CircleCursor CircleCursor;
[HideInInspector] public GameObject GamesHolder; [HideInInspector] public GameObject GamesHolder;
public Games.Global.Flash fade; public Games.Global.Flash fade;
@ -237,7 +238,6 @@ namespace HeavenStudio
if (Conductor.instance.songPositionInBeats >= tempoChanges[currentTempoEvent]) if (Conductor.instance.songPositionInBeats >= tempoChanges[currentTempoEvent])
{ {
Conductor.instance.SetBpm(Beatmap.tempoChanges[currentTempoEvent].tempo); Conductor.instance.SetBpm(Beatmap.tempoChanges[currentTempoEvent].tempo);
Conductor.instance.timeSinceLastTempoChange = Time.time;
currentTempoEvent++; currentTempoEvent++;
} }
} }

View file

@ -189,6 +189,21 @@ namespace HeavenStudio.Games
//coin.perfectOnly = true; //coin.perfectOnly = true;
} }
public void TossCoin(float beat)
{
if (coin != null) return;
//Play sound and animations
Jukebox.PlayOneShotGame("coinToss/throw");
handAnimator.Play("Throw", 0, 0);
//Game state says the hand is throwing the coin
isThrowing = true;
this.audienceReacting = false;
coin = ScheduleInput(beat, 6f, InputType.STANDARD_DOWN, CatchSuccess, CatchMiss, CatchEmpty);
//coin.perfectOnly = true;
}
public void CatchSuccess(PlayerActionEvent caller, float state) public void CatchSuccess(PlayerActionEvent caller, float state)
{ {
Jukebox.PlayOneShotGame("coinToss/catch"); Jukebox.PlayOneShotGame("coinToss/catch");

View file

@ -108,6 +108,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
{ {
if (clappingStartTime != Single.MinValue && cond.songPositionInBeats > clappingStartTime + 2f && !stopCharge) if (clappingStartTime != Single.MinValue && cond.songPositionInBeats > clappingStartTime + 2f && !stopCharge)
{ {
animator.speed = 1f;
animator.Play("FanClapCharge", -1, 0); animator.Play("FanClapCharge", -1, 0);
stopCharge = true; stopCharge = true;
} }
@ -120,6 +121,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
} }
else else
{ {
animator.speed = 1f;
animator.Play("FanFree", -1, 0); animator.Play("FanFree", -1, 0);
stopBeat = false; stopBeat = false;
clappingStartTime = Single.MinValue; clappingStartTime = Single.MinValue;
@ -135,7 +137,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
float yWeight = -(yMul*yMul) + 1f; float yWeight = -(yMul*yMul) + 1f;
motionRoot.transform.localPosition = new Vector3(0, 3f * yWeight); 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); shadow.transform.localScale = new Vector3((1f-yWeight*0.8f) * 1.4f, (1f-yWeight*0.8f) * 1.4f, 1f);
animator.Play("FanJump", -1, 0); animator.DoScaledAnimation("FanJump", jumpStartTime);
} }
else else
{ {
@ -150,6 +152,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
stopBeat = false; stopBeat = false;
} }
} }
animator.speed = 1f;
hasJumped = false; hasJumped = false;
} }
} }
@ -165,6 +168,7 @@ namespace HeavenStudio.Games.Scripts_FanClub
hasJumped = false; hasJumped = false;
stopBeat = true; stopBeat = true;
jumpStartTime = -99f; jumpStartTime = -99f;
animator.speed = 1f;
animator.Play("FanClap", -1, 0); animator.Play("FanClap", -1, 0);
Jukebox.PlayOneShotGame("fanClub/play_clap"); Jukebox.PlayOneShotGame("fanClub/play_clap");
Jukebox.PlayOneShotGame("fanClub/crap_impact"); Jukebox.PlayOneShotGame("fanClub/crap_impact");
@ -219,7 +223,10 @@ namespace HeavenStudio.Games.Scripts_FanClub
public void Bop() public void Bop()
{ {
if (!stopBeat) if (!stopBeat)
{
animator.speed = 1f;
animator.Play("FanBeat"); animator.Play("FanBeat");
}
} }
public void ClapParticle() public void ClapParticle()

View file

@ -945,6 +945,9 @@ namespace HeavenStudio.Games
void UpdateFilterColour(Color bgColor, Color filterColor) void UpdateFilterColour(Color bgColor, Color filterColor)
{ {
bgGradientRenderer = BGGradient.GetComponent<SpriteRenderer>();
bgBloodRenderer = BGBlood.GetComponent<SpriteRenderer>();
bgRadialRenderer = BGRadial.GetComponent<SpriteRenderer>();
Color col; Color col;
if (textureFilterType == (int) ShadowType.Tinted) if (textureFilterType == (int) ShadowType.Tinted)
col = Color.LerpUnclamped(bgColor, ShadowBlendColor, 0.45f); col = Color.LerpUnclamped(bgColor, ShadowBlendColor, 0.45f);

View file

@ -20,6 +20,7 @@ namespace HeavenStudio
GameObject MainCamera = Cameras.transform.GetChild(0).gameObject; GameObject MainCamera = Cameras.transform.GetChild(0).gameObject;
GameObject CursorCamera = Cameras.transform.GetChild(1).gameObject; GameObject CursorCamera = Cameras.transform.GetChild(1).gameObject;
GameObject OverlayCamera = Cameras.transform.GetChild(2).gameObject; GameObject OverlayCamera = Cameras.transform.GetChild(2).gameObject;
GameObject GameLetterbox = Cameras.transform.GetChild(3).gameObject;
GameObject Cursor = Instantiate(Resources.Load<GameObject>("Prefabs/Cursor")); GameObject Cursor = Instantiate(Resources.Load<GameObject>("Prefabs/Cursor"));
Cursor.name = "Cursor"; Cursor.name = "Cursor";
@ -38,6 +39,7 @@ namespace HeavenStudio
gameManager.GameCamera = MainCamera.GetComponent<Camera>(); gameManager.GameCamera = MainCamera.GetComponent<Camera>();
gameManager.CursorCam = CursorCamera.GetComponent<Camera>(); gameManager.CursorCam = CursorCamera.GetComponent<Camera>();
gameManager.OverlayCamera = OverlayCamera.GetComponent<Camera>(); gameManager.OverlayCamera = OverlayCamera.GetComponent<Camera>();
gameManager.GameLetterbox = GameLetterbox;
GameObject Profiler = Instantiate(Resources.Load<GameObject>("Prefabs/GameProfiler")); GameObject Profiler = Instantiate(Resources.Load<GameObject>("Prefabs/GameProfiler"));
Profiler.name = "GameProfiler"; Profiler.name = "GameProfiler";

View file

@ -30,7 +30,7 @@ namespace HeavenStudio.Editor
[SerializeField] public Camera EditorCamera; [SerializeField] public Camera EditorCamera;
// [SerializeField] public GameObject EditorLetterbox; // [SerializeField] public GameObject EditorLetterbox;
[SerializeField] public GameObject GameLetterbox; public GameObject GameLetterbox;
[Header("Rect")] [Header("Rect")]
[SerializeField] private RenderTexture ScreenRenderTexture; [SerializeField] private RenderTexture ScreenRenderTexture;
@ -93,6 +93,7 @@ namespace HeavenStudio.Editor
GameCamera.instance.camera.targetTexture = ScreenRenderTexture; GameCamera.instance.camera.targetTexture = ScreenRenderTexture;
GameManager.instance.CursorCam.targetTexture = ScreenRenderTexture; GameManager.instance.CursorCam.targetTexture = ScreenRenderTexture;
GameManager.instance.OverlayCamera.targetTexture = ScreenRenderTexture; GameManager.instance.OverlayCamera.targetTexture = ScreenRenderTexture;
GameLetterbox = GameManager.instance.GameLetterbox;
Screen.texture = ScreenRenderTexture; Screen.texture = ScreenRenderTexture;
GameManager.instance.Init(); GameManager.instance.Init();

View file

@ -332,7 +332,7 @@ namespace HeavenStudio.Editor.Track
if (!Conductor.instance.isPlaying && !Conductor.instance.isPaused) if (!Conductor.instance.isPlaying && !Conductor.instance.isPaused)
{ {
SongBeat.text = $"Beat {string.Format("{0:0.000}", TimelineSlider.localPosition.x)}"; SongBeat.text = $"Beat {string.Format("{0:0.000}", TimelineSlider.localPosition.x)}";
SongPos.text = FormatTime(Conductor.instance.GetSongPosFromBeat(TimelineSlider.localPosition.x)); SongPos.text = FormatTime((float) Conductor.instance.GetSongPosFromBeat(TimelineSlider.localPosition.x));
} }
else else
{ {

View file

@ -1,5 +1,5 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 1516953164 CRC: 2362860034
AssetBundleManifest: AssetBundleManifest:
AssetBundleInfos: AssetBundleInfos:
Info_0: Info_0:

Binary file not shown.

View file

@ -1,9 +1,9 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 1091441775 CRC: 1499416464
Hashes: Hashes:
AssetFileHash: AssetFileHash:
serializedVersion: 2 serializedVersion: 2
Hash: f85b652eadac4ff300c579adfa67313b Hash: 7dbbb737179d1cc7db1edb0a31c7e1ab
TypeTreeHash: TypeTreeHash:
serializedVersion: 2 serializedVersion: 2
Hash: 2b92e6f111bbb24dabe3a2c56ea02b28 Hash: 2b92e6f111bbb24dabe3a2c56ea02b28

View file

@ -1,9 +1,9 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 3145129048 CRC: 3719062968
Hashes: Hashes:
AssetFileHash: AssetFileHash:
serializedVersion: 2 serializedVersion: 2
Hash: accf70966bae19a4dbcad02679a20b19 Hash: eee37f302cb3e8cbe079bb5500cb45ed
TypeTreeHash: TypeTreeHash:
serializedVersion: 2 serializedVersion: 2
Hash: 1341d321cd8444a4f78a51a8a0c6daff Hash: 1341d321cd8444a4f78a51a8a0c6daff

View file

@ -1,9 +1,9 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 2094393231 CRC: 2386252366
Hashes: Hashes:
AssetFileHash: AssetFileHash:
serializedVersion: 2 serializedVersion: 2
Hash: a425cbbebe1a8006a4fc4fe6127c84fa Hash: 6f57f7727dc4903488ea4956307caac1
TypeTreeHash: TypeTreeHash:
serializedVersion: 2 serializedVersion: 2
Hash: 6f0c5ebd30d7d3be8aad1c86837b5cc9 Hash: 6f0c5ebd30d7d3be8aad1c86837b5cc9

View file

@ -1,9 +1,9 @@
ManifestFileVersion: 0 ManifestFileVersion: 0
CRC: 3054716629 CRC: 1695511499
Hashes: Hashes:
AssetFileHash: AssetFileHash:
serializedVersion: 2 serializedVersion: 2
Hash: 7de7ed1ceb30a914c04951332a09f02e Hash: 24892cdb3bebaf86064204efdc197727
TypeTreeHash: TypeTreeHash:
serializedVersion: 2 serializedVersion: 2
Hash: 788d5843115df613774b9a4b273d2334 Hash: 788d5843115df613774b9a4b273d2334

View file

@ -7,6 +7,7 @@ PhysicsManager:
m_Gravity: {x: 0, y: -9.81, z: 0} m_Gravity: {x: 0, y: -9.81, z: 0}
m_DefaultMaterial: {fileID: 0} m_DefaultMaterial: {fileID: 0}
m_BounceThreshold: 2 m_BounceThreshold: 2
m_DefaultMaxDepenetrationVelocity: 10
m_SleepThreshold: 0.005 m_SleepThreshold: 0.005
m_DefaultContactOffset: 0.01 m_DefaultContactOffset: 0.01
m_DefaultSolverIterations: 6 m_DefaultSolverIterations: 6
@ -17,7 +18,7 @@ PhysicsManager:
m_ClothInterCollisionDistance: 0.1 m_ClothInterCollisionDistance: 0.1
m_ClothInterCollisionStiffness: 0.2 m_ClothInterCollisionStiffness: 0.2
m_ContactsGeneration: 1 m_ContactsGeneration: 1
m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff m_LayerCollisionMatrix: ff8fffffff8fffffff8fffffff8fffffff8fffffff8fffffff8fffffff8fffffff8fffffff8fffffff8fffffff8fffff0080ffff0080ffff0080ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff
m_AutoSimulation: 1 m_AutoSimulation: 1
m_AutoSyncTransforms: 0 m_AutoSyncTransforms: 0
m_ReuseCollisionCallbacks: 1 m_ReuseCollisionCallbacks: 1

View file

@ -46,7 +46,24 @@ GraphicsSettings:
m_TransparencySortAxis: {x: 0, y: 0, z: 1} m_TransparencySortAxis: {x: 0, y: 0, z: 1}
m_DefaultRenderingPath: 1 m_DefaultRenderingPath: 1
m_DefaultMobileRenderingPath: 1 m_DefaultMobileRenderingPath: 1
m_TierSettings: [] m_TierSettings:
- serializedVersion: 5
m_BuildTarget: 1
m_Tier: 2
m_Settings:
standardShaderQuality: 2
renderingPath: 1
hdrMode: 1
realtimeGICPUUsage: 50
useReflectionProbeBoxProjection: 1
useReflectionProbeBlending: 1
useHDR: 0
useDetailNormalMap: 1
useCascadedShadowMaps: 1
prefer32BitShadowMaps: 0
enableLPPV: 1
useDitherMaskForAlphaBlendedShadows: 1
m_Automatic: 1
m_LightmapStripping: 0 m_LightmapStripping: 0
m_FogStripping: 0 m_FogStripping: 0
m_InstancingStripping: 0 m_InstancingStripping: 0

View file

@ -294,7 +294,7 @@ PlayerSettings:
- m_BuildTarget: iOSSupport - m_BuildTarget: iOSSupport
m_GraphicsJobs: 0 m_GraphicsJobs: 0
- m_BuildTarget: WindowsStandaloneSupport - m_BuildTarget: WindowsStandaloneSupport
m_GraphicsJobs: 0 m_GraphicsJobs: 1
- m_BuildTarget: XboxOnePlayer - m_BuildTarget: XboxOnePlayer
m_GraphicsJobs: 0 m_GraphicsJobs: 0
- m_BuildTarget: LuminSupport - m_BuildTarget: LuminSupport
@ -587,7 +587,8 @@ PlayerSettings:
platformArchitecture: {} platformArchitecture: {}
scriptingBackend: {} scriptingBackend: {}
il2cppCompilerConfiguration: {} il2cppCompilerConfiguration: {}
managedStrippingLevel: {} managedStrippingLevel:
Standalone: 0
incrementalIl2cppBuild: {} incrementalIl2cppBuild: {}
suppressCommonWarnings: 1 suppressCommonWarnings: 1
allowUnsafeCode: 0 allowUnsafeCode: 0

View file

@ -98,7 +98,7 @@ QualitySettings:
softVegetation: 0 softVegetation: 0
realtimeReflectionProbes: 0 realtimeReflectionProbes: 0
billboardsFaceCameraPosition: 0 billboardsFaceCameraPosition: 0
vSyncCount: 1 vSyncCount: 0
lodBias: 0.7 lodBias: 0.7
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0 streamingMipmapsActive: 0
@ -134,7 +134,7 @@ QualitySettings:
softVegetation: 1 softVegetation: 1
realtimeReflectionProbes: 1 realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1 billboardsFaceCameraPosition: 1
vSyncCount: 1 vSyncCount: 0
lodBias: 1 lodBias: 1
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0 streamingMipmapsActive: 0
@ -170,7 +170,7 @@ QualitySettings:
softVegetation: 1 softVegetation: 1
realtimeReflectionProbes: 1 realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1 billboardsFaceCameraPosition: 1
vSyncCount: 1 vSyncCount: 0
lodBias: 1.5 lodBias: 1.5
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0 streamingMipmapsActive: 0
@ -196,7 +196,7 @@ QualitySettings:
shadowDistance: 150 shadowDistance: 150
shadowNearPlaneOffset: 3 shadowNearPlaneOffset: 3
shadowCascade2Split: 0.33333334 shadowCascade2Split: 0.33333334
shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} shadowCascade4Split: {x: 0.06666667, y: 0.19999999, z: 0.45785606}
shadowmaskMode: 1 shadowmaskMode: 1
skinWeights: 255 skinWeights: 255
textureQuality: 0 textureQuality: 0
@ -206,7 +206,7 @@ QualitySettings:
softVegetation: 1 softVegetation: 1
realtimeReflectionProbes: 1 realtimeReflectionProbes: 1
billboardsFaceCameraPosition: 1 billboardsFaceCameraPosition: 1
vSyncCount: 1 vSyncCount: 0
lodBias: 2 lodBias: 2
maximumLODLevel: 0 maximumLODLevel: 0
streamingMipmapsActive: 0 streamingMipmapsActive: 0