mirror of
https://github.com/RHeavenStudioPlus/HeavenStudioPlus.git
synced 2024-11-10 03:35:10 +00:00
Rhythm Rally: Basic gameplay setup
This commit is contained in:
parent
ed979d6d45
commit
d18581074d
15 changed files with 842 additions and 49 deletions
|
@ -37,14 +37,16 @@ namespace NaughtyBezierCurves.Editor
|
|||
EditorGUILayout.PropertyField(this.leftHandleLocalPosition);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.rightHandleLocalPosition.vector3Value = -this.leftHandleLocalPosition.vector3Value;
|
||||
if (this.handleType.enumValueIndex == (int)BezierPoint3D.HandleType.Connected)
|
||||
this.rightHandleLocalPosition.vector3Value = -this.leftHandleLocalPosition.vector3Value;
|
||||
}
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
EditorGUILayout.PropertyField(this.rightHandleLocalPosition);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
this.leftHandleLocalPosition.vector3Value = -this.rightHandleLocalPosition.vector3Value;
|
||||
if (this.handleType.enumValueIndex == (int)BezierPoint3D.HandleType.Connected)
|
||||
this.leftHandleLocalPosition.vector3Value = -this.rightHandleLocalPosition.vector3Value;
|
||||
}
|
||||
|
||||
this.serializedObject.ApplyModifiedProperties();
|
||||
|
|
|
@ -31,7 +31,7 @@ Transform:
|
|||
- {fileID: 3078425781313688086}
|
||||
- {fileID: 4228713593463920381}
|
||||
- {fileID: 4959957736091286558}
|
||||
- {fileID: 1845910055258765698}
|
||||
- {fileID: 227248172885675867}
|
||||
- {fileID: 3001474442492713424}
|
||||
- {fileID: 2651138408829433753}
|
||||
m_Father: {fileID: 3337760827311893485}
|
||||
|
@ -48,7 +48,7 @@ GameObject:
|
|||
- component: {fileID: 1845910055258765698}
|
||||
- component: {fileID: 6371738825610660614}
|
||||
m_Layer: 10
|
||||
m_Name: GameObject
|
||||
m_Name: ServeCurve
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
|
@ -61,16 +61,16 @@ Transform:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 513601240051193262}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalRotation: {x: -0, y: 0.029666247, z: -0, w: 0.9995599}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 8175507810436109978}
|
||||
- {fileID: 8145851341164007221}
|
||||
- {fileID: 5184658146293876446}
|
||||
m_Father: {fileID: 4631944531018638297}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_Father: {fileID: 227248172885675867}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 3.4, z: 0}
|
||||
--- !u!114 &6371738825610660614
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -544,6 +544,53 @@ MeshCollider:
|
|||
m_Convex: 0
|
||||
m_CookingOptions: 30
|
||||
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
|
||||
--- !u!1 &2973188548200904564
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5582897510054026688}
|
||||
- component: {fileID: 489672749043040511}
|
||||
m_Layer: 10
|
||||
m_Name: Point 0
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &5582897510054026688
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2973188548200904564}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 2.1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2492954830728060394}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &489672749043040511
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2973188548200904564}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 2715991891693212353}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: 0, y: -0.5382855, z: 0.5024216}
|
||||
rightHandleLocalPosition: {x: -0, y: 0.5382855, z: -0.5024216}
|
||||
--- !u!1 &3112497704503559489
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -553,6 +600,7 @@ GameObject:
|
|||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3001474442492713424}
|
||||
- component: {fileID: 2423225589381961324}
|
||||
m_Layer: 10
|
||||
m_Name: Paddlers
|
||||
m_TagString: Untagged
|
||||
|
@ -576,6 +624,29 @@ Transform:
|
|||
m_Father: {fileID: 4631944531018638297}
|
||||
m_RootOrder: 5
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &2423225589381961324
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3112497704503559489}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dbf752ba115326446a543da7b734edb8, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
inList: 0
|
||||
lastState: 0
|
||||
state:
|
||||
gameObject: {fileID: 0}
|
||||
early: 0
|
||||
perfect: 0
|
||||
late: 0
|
||||
createBeat: 0
|
||||
isEligible: 0
|
||||
eligibleHitsList: []
|
||||
aceTimes: 0
|
||||
--- !u!1 &3340141389927785323
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -698,7 +769,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3667855830336901894}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.8373877, z: 1.925}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 2.1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1845910055258765698}
|
||||
|
@ -853,7 +924,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4262381482084858378}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.06567192, y: 0.8302344, z: -2.1034844}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -2.1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1845910055258765698}
|
||||
|
@ -873,8 +944,8 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 6371738825610660614}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: -0.42184877, y: 0.749552, z: 0.25117397}
|
||||
rightHandleLocalPosition: {x: 0.42184877, y: -0.749552, z: -0.25117397}
|
||||
leftHandleLocalPosition: {x: 0, y: 0.5382855, z: 0.5024216}
|
||||
rightHandleLocalPosition: {x: -0, y: -0.5382855, z: -0.5024216}
|
||||
--- !u!1 &4412551583113167986
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -900,7 +971,7 @@ Transform:
|
|||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4412551583113167986}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.74140847, z: -0.3736241}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.3736241}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 1845910055258765698}
|
||||
|
@ -920,8 +991,110 @@ MonoBehaviour:
|
|||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 6371738825610660614}
|
||||
handleType: 1
|
||||
leftHandleLocalPosition: {x: 0, y: 0.8176588, z: 0.45496285}
|
||||
rightHandleLocalPosition: {x: 0.22773409, y: 0.8552635, z: -0.3745283}
|
||||
leftHandleLocalPosition: {x: 0, y: 0.55, z: 0.45496285}
|
||||
rightHandleLocalPosition: {x: 0, y: 0.45, z: -0.4549628}
|
||||
--- !u!1 &5224037407349900874
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6753035230022650674}
|
||||
- component: {fileID: 967116196545722175}
|
||||
m_Layer: 10
|
||||
m_Name: Point 1
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &6753035230022650674
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5224037407349900874}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -0.3736241}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2492954830728060394}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &967116196545722175
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5224037407349900874}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 2715991891693212353}
|
||||
handleType: 1
|
||||
leftHandleLocalPosition: {x: 0, y: 0.55, z: 0.45496285}
|
||||
rightHandleLocalPosition: {x: 0, y: 0.45, z: -0.4549628}
|
||||
--- !u!1 &6878547494759724039
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2492954830728060394}
|
||||
- component: {fileID: 2715991891693212353}
|
||||
m_Layer: 10
|
||||
m_Name: ReturnCurve
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2492954830728060394
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6878547494759724039}
|
||||
m_LocalRotation: {x: -0, y: 0.9995599, z: -0, w: -0.029666154}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 5582897510054026688}
|
||||
- {fileID: 6753035230022650674}
|
||||
- {fileID: 2008423486364638542}
|
||||
m_Father: {fileID: 227248172885675867}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 183.4, z: 0}
|
||||
--- !u!114 &2715991891693212353
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6878547494759724039}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 066a41e004f415b4eb74d5e61a2aadbe, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curveColor: {r: 0, g: 1, b: 0, a: 1}
|
||||
startPointColor: {r: 1, g: 0, b: 0, a: 1}
|
||||
endPointColor: {r: 0, g: 0, b: 1, a: 1}
|
||||
sampling: 25
|
||||
keyPoints:
|
||||
- {fileID: 489672749043040511}
|
||||
- {fileID: 967116196545722175}
|
||||
- {fileID: 4405872811281721058}
|
||||
normalizedTime: 0.5
|
||||
--- !u!1 &7041748797742148697
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1086,6 +1259,53 @@ SpriteRenderer:
|
|||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!1 &7366375554666111783
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2008423486364638542}
|
||||
- component: {fileID: 4405872811281721058}
|
||||
m_Layer: 10
|
||||
m_Name: Point 2
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &2008423486364638542
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7366375554666111783}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: -2.1}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children: []
|
||||
m_Father: {fileID: 2492954830728060394}
|
||||
m_RootOrder: 2
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &4405872811281721058
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7366375554666111783}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: b0cca3244f403c24f819a870f31cdc29, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
curve: {fileID: 2715991891693212353}
|
||||
handleType: 0
|
||||
leftHandleLocalPosition: {x: 0, y: 0.5382855, z: 0.5024216}
|
||||
rightHandleLocalPosition: {x: -0, y: -0.5382855, z: -0.5024216}
|
||||
--- !u!1 &8070718553788868724
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1136,9 +1356,50 @@ MonoBehaviour:
|
|||
renderQuadTrans: {fileID: 743597382397742394}
|
||||
cameraPos: {fileID: 6509993024069972873}
|
||||
ball: {fileID: 1668061868608559892}
|
||||
curve3D: {fileID: 6371738825610660614}
|
||||
ballShadow: {fileID: 7207398029238753263}
|
||||
serveCurve: {fileID: 6371738825610660614}
|
||||
returnCurve: {fileID: 2715991891693212353}
|
||||
playerAnim: {fileID: 9089436218394572253}
|
||||
opponentAnim: {fileID: 4559734961269837672}
|
||||
rallySpeed: 1
|
||||
started: 0
|
||||
missed: 0
|
||||
served: 0
|
||||
serveBeat: 0
|
||||
targetBeat: 0
|
||||
paddlers: {fileID: 2423225589381961324}
|
||||
--- !u!1 &9182704984975526523
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 227248172885675867}
|
||||
m_Layer: 10
|
||||
m_Name: Curves
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &227248172885675867
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 9182704984975526523}
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0.712, z: 0}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_Children:
|
||||
- {fileID: 1845910055258765698}
|
||||
- {fileID: 2492954830728060394}
|
||||
m_Father: {fileID: 4631944531018638297}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!1001 &146447278275535207
|
||||
PrefabInstance:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1344,16 +1605,16 @@ PrefabInstance:
|
|||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
--- !u!4 &397144130134918796 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
m_PrefabInstance: {fileID: 146447278275535207}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &1065418898597387318 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
m_PrefabInstance: {fileID: 146447278275535207}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &397144130134918796 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
m_PrefabInstance: {fileID: 146447278275535207}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!95 &4559734961269837672
|
||||
Animator:
|
||||
serializedVersion: 3
|
||||
|
@ -1994,9 +2255,9 @@ PrefabInstance:
|
|||
objectReference: {fileID: 0}
|
||||
m_RemovedComponents: []
|
||||
m_SourcePrefab: {fileID: 100100000, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
--- !u!4 &7291063904195614871 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
--- !u!1 &7954728381481796141 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
m_PrefabInstance: {fileID: 7108288251017691004}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!4 &2075964892847120759 stripped
|
||||
|
@ -2004,9 +2265,9 @@ Transform:
|
|||
m_CorrespondingSourceObject: {fileID: 9109367605909020171, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
m_PrefabInstance: {fileID: 7108288251017691004}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!1 &7954728381481796141 stripped
|
||||
GameObject:
|
||||
m_CorrespondingSourceObject: {fileID: 919132149155446097, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
--- !u!4 &7291063904195614871 stripped
|
||||
Transform:
|
||||
m_CorrespondingSourceObject: {fileID: -8679921383154817045, guid: cebeb8610d89fb34688750080a285ddb, type: 3}
|
||||
m_PrefabInstance: {fileID: 7108288251017691004}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
--- !u!95 &9089436218394572253
|
||||
|
|
8
Assets/Resources/Sfx/games/rhythmRally.meta
Normal file
8
Assets/Resources/Sfx/games/rhythmRally.meta
Normal file
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 4c744f63674c0944696afb5461b82c32
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/Return.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/Return.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: d854894fefdb48d4f935a0441e54ca5b
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/ReturnBounce.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/ReturnBounce.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 173cbb29d51db6d409a6c80bc5a3e46e
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/Serve.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/Serve.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a07419b8c6f9aad4e86ec3a3ba4f727e
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/ServeBounce.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/ServeBounce.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 6d40249697886244897f3513c8005b88
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/Tink.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/Tink.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: f85a462359c62d2488297f10ae8dbad9
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/Tonk.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/Tonk.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: e2ddc1622db075346a98dfb35d80c638
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
22
Assets/Resources/Sfx/games/rhythmRally/Whistle.ogg.meta
Normal file
22
Assets/Resources/Sfx/games/rhythmRally/Whistle.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dba1e0172e3cb8c42acac4831ceb1c54
|
||||
AudioImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 6
|
||||
defaultSettings:
|
||||
loadType: 0
|
||||
sampleRateSetting: 0
|
||||
sampleRateOverride: 44100
|
||||
compressionFormat: 1
|
||||
quality: 1
|
||||
conversionMode: 0
|
||||
platformSettingOverrides: {}
|
||||
forceToMono: 0
|
||||
normalize: 1
|
||||
preloadAudioData: 1
|
||||
loadInBackground: 0
|
||||
ambisonic: 0
|
||||
3D: 1
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,5 +1,27 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1101 &-7775552956130427675
|
||||
AnimatorStateTransition:
|
||||
m_ObjectHideFlags: 1
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name:
|
||||
m_Conditions: []
|
||||
m_DstStateMachine: {fileID: 0}
|
||||
m_DstState: {fileID: 7618035723044257044}
|
||||
m_Solo: 0
|
||||
m_Mute: 0
|
||||
m_IsExit: 0
|
||||
serializedVersion: 3
|
||||
m_TransitionDuration: 0
|
||||
m_TransitionOffset: 0
|
||||
m_ExitTime: 0
|
||||
m_HasExitTime: 1
|
||||
m_HasFixedDuration: 1
|
||||
m_InterruptionSource: 0
|
||||
m_OrderedInterruption: 1
|
||||
m_CanTransitionToSelf: 1
|
||||
--- !u!1102 &-3986917046676279002
|
||||
AnimatorState:
|
||||
serializedVersion: 6
|
||||
|
@ -8,7 +30,7 @@ AnimatorState:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Ready0
|
||||
m_Speed: 2
|
||||
m_Speed: 4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
|
@ -37,7 +59,7 @@ AnimatorStateMachine:
|
|||
m_ChildStates:
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 6416047872712211942}
|
||||
m_Position: {x: 200, y: 190, z: 0}
|
||||
m_Position: {x: 240, y: 260, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 4424825005415695879}
|
||||
m_Position: {x: 290, y: 330, z: 0}
|
||||
|
@ -52,7 +74,7 @@ AnimatorStateMachine:
|
|||
m_Position: {x: 550, y: 330, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 7948488236895607926}
|
||||
m_Position: {x: 250, y: 260, z: 0}
|
||||
m_Position: {x: 200, y: 190, z: 0}
|
||||
- serializedVersion: 1
|
||||
m_State: {fileID: 7618035723044257044}
|
||||
m_Position: {x: 270, y: 120, z: 0}
|
||||
|
@ -96,7 +118,7 @@ AnimatorState:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Ready1
|
||||
m_Speed: 2
|
||||
m_Speed: 4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
|
@ -122,7 +144,7 @@ AnimatorState:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Pose
|
||||
m_Speed: 2
|
||||
m_Speed: 4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
|
@ -148,7 +170,7 @@ AnimatorState:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Beat
|
||||
m_Speed: 2
|
||||
m_Speed: 4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
|
@ -174,7 +196,7 @@ AnimatorState:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: ReadyBeat
|
||||
m_Speed: 2
|
||||
m_Speed: 4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_StateMachineBehaviours: []
|
||||
|
@ -226,9 +248,10 @@ AnimatorState:
|
|||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: Swing
|
||||
m_Speed: 2
|
||||
m_Speed: 4
|
||||
m_CycleOffset: 0
|
||||
m_Transitions: []
|
||||
m_Transitions:
|
||||
- {fileID: -7775552956130427675}
|
||||
m_StateMachineBehaviours: []
|
||||
m_Position: {x: 50, y: 50, z: 0}
|
||||
m_IKOnFeet: 0
|
||||
|
|
101
Assets/Scripts/Games/RhythmRally/Paddlers.cs
Normal file
101
Assets/Scripts/Games/RhythmRally/Paddlers.cs
Normal file
|
@ -0,0 +1,101 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
|
||||
namespace RhythmHeavenMania.Games.RhythmRally
|
||||
{
|
||||
public class Paddlers : PlayerActionObject
|
||||
{
|
||||
private RhythmRally game;
|
||||
private Animator playerAnim;
|
||||
private Animator opponentAnim;
|
||||
private Conductor cond;
|
||||
|
||||
void Awake()
|
||||
{
|
||||
game = RhythmRally.instance;
|
||||
playerAnim = game.playerAnim;
|
||||
opponentAnim = game.opponentAnim;
|
||||
cond = Conductor.instance;
|
||||
}
|
||||
|
||||
void Update()
|
||||
{
|
||||
if (!game.served || game.missed || !game.started) return;
|
||||
|
||||
float stateBeat = Conductor.instance.GetPositionFromMargin(game.targetBeat, 1f);
|
||||
StateCheck(stateBeat);
|
||||
|
||||
if (PlayerInput.Pressed())
|
||||
{
|
||||
if (state.perfect)
|
||||
{
|
||||
Ace();
|
||||
}
|
||||
else if (state.notPerfect())
|
||||
{
|
||||
Miss();
|
||||
Jukebox.PlayOneShot("miss");
|
||||
playerAnim.Play("Swing", 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Play "whoosh" sound here
|
||||
playerAnim.Play("Swing", 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
if (stateBeat > Minigame.EndTime())
|
||||
{
|
||||
Miss();
|
||||
}
|
||||
}
|
||||
|
||||
void Ace()
|
||||
{
|
||||
game.served = false;
|
||||
|
||||
var hitBeat = cond.songPositionInBeats;
|
||||
|
||||
var bounceBeat = game.targetBeat + 1f;
|
||||
|
||||
if (game.rallySpeed == RhythmRally.RallySpeed.Slow)
|
||||
{
|
||||
bounceBeat = game.targetBeat + 2f;
|
||||
}
|
||||
else if (game.rallySpeed == RhythmRally.RallySpeed.SuperFast)
|
||||
{
|
||||
bounceBeat = game.targetBeat + 0.5f;
|
||||
}
|
||||
|
||||
playerAnim.Play("Swing", 0, 0);
|
||||
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("rhythmRally/Return", hitBeat), new MultiSound.Sound("rhythmRally/ReturnBounce", bounceBeat) });
|
||||
}
|
||||
|
||||
void Miss()
|
||||
{
|
||||
game.served = false;
|
||||
game.missed = true;
|
||||
|
||||
var whistleBeat = game.targetBeat + 1f;
|
||||
|
||||
if (game.rallySpeed == RhythmRally.RallySpeed.Slow)
|
||||
{
|
||||
whistleBeat = game.targetBeat + 2f;
|
||||
}
|
||||
else if (game.rallySpeed == RhythmRally.RallySpeed.SuperFast)
|
||||
{
|
||||
whistleBeat = game.targetBeat + 0.5f;
|
||||
}
|
||||
|
||||
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("rhythmRally/Whistle", whistleBeat) });
|
||||
}
|
||||
|
||||
public override void OnAce()
|
||||
{
|
||||
Ace();
|
||||
}
|
||||
}
|
||||
}
|
11
Assets/Scripts/Games/RhythmRally/Paddlers.cs.meta
Normal file
11
Assets/Scripts/Games/RhythmRally/Paddlers.cs.meta
Normal file
|
@ -0,0 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dbf752ba115326446a543da7b734edb8
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
|
@ -1,22 +1,42 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
using NaughtyBezierCurves;
|
||||
using DG.Tweening;
|
||||
|
||||
using RhythmHeavenMania.Util;
|
||||
namespace RhythmHeavenMania.Games.RhythmRally
|
||||
{
|
||||
public class RhythmRally : Minigame
|
||||
{
|
||||
public Transform renderQuadTrans;
|
||||
public enum RallySpeed { Slow, Normal, Fast, SuperFast }
|
||||
|
||||
[Header("Camera")]
|
||||
public Transform renderQuadTrans;
|
||||
public Transform cameraPos;
|
||||
|
||||
public GameObject ball;
|
||||
public NaughtyBezierCurves.BezierCurve3D curve3D;
|
||||
|
||||
[Header("Ball and curve info")]
|
||||
public GameObject ball;
|
||||
public GameObject ballShadow;
|
||||
public BezierCurve3D serveCurve;
|
||||
public BezierCurve3D returnCurve;
|
||||
|
||||
|
||||
[Header("Animators")]
|
||||
public Animator playerAnim;
|
||||
public Animator opponentAnim;
|
||||
|
||||
[Header("Properties")]
|
||||
public RallySpeed rallySpeed = RallySpeed.Normal;
|
||||
public bool started;
|
||||
public bool missed;
|
||||
public bool served;
|
||||
public float serveBeat;
|
||||
public float targetBeat;
|
||||
|
||||
public Paddlers paddlers;
|
||||
|
||||
public GameEvent bop = new GameEvent();
|
||||
|
||||
public static RhythmRally instance;
|
||||
|
@ -26,7 +46,7 @@ namespace RhythmHeavenMania.Games.RhythmRally
|
|||
instance = this;
|
||||
}
|
||||
|
||||
// Start is called before the first frame update
|
||||
|
||||
void Start()
|
||||
{
|
||||
renderQuadTrans.gameObject.SetActive(true);
|
||||
|
@ -40,27 +60,161 @@ namespace RhythmHeavenMania.Games.RhythmRally
|
|||
opponentAnim.Play("Idle", 0, 0);
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
const float tableHitTime = 0.58f;
|
||||
bool opponentServing = false; // Opponent serving this frame?
|
||||
void Update()
|
||||
{
|
||||
var cond = Conductor.instance;
|
||||
var currentBeat = cond.songPositionInBeats;
|
||||
|
||||
var hitBeat = serveBeat; // Beat when the last paddler hit the ball
|
||||
var beatDur1 = 1f; // From paddle to table
|
||||
var beatDur2 = 1f; // From table to other paddle
|
||||
|
||||
ball.transform.position = curve3D.GetPoint(Mathf.Clamp(cond.GetPositionFromBeat(0, 2f), 0, 1));
|
||||
ball.transform.GetChild(0).transform.position = new Vector3(ball.transform.position.x, -0.399f, ball.transform.position.z);
|
||||
var playerState = playerAnim.GetCurrentAnimatorStateInfo(0);
|
||||
var opponentState = opponentAnim.GetCurrentAnimatorStateInfo(0);
|
||||
|
||||
bool playerPrepping = false; // Player using prep animation?
|
||||
bool opponentPrepping = false; // Opponent using prep animation?
|
||||
|
||||
if (started)
|
||||
{
|
||||
// Determine hitBeat and beatDurs.
|
||||
switch (rallySpeed)
|
||||
{
|
||||
case RallySpeed.Normal:
|
||||
if (!served)
|
||||
{
|
||||
hitBeat = serveBeat + 2f;
|
||||
}
|
||||
break;
|
||||
case RallySpeed.Fast:
|
||||
if (!served)
|
||||
{
|
||||
hitBeat = serveBeat + 1f;
|
||||
beatDur1 = 1f;
|
||||
beatDur2 = 2f;
|
||||
}
|
||||
else
|
||||
{
|
||||
beatDur1 = 0.5f;
|
||||
beatDur2 = 0.5f;
|
||||
}
|
||||
break;
|
||||
case RallySpeed.SuperFast:
|
||||
if (!served)
|
||||
{
|
||||
hitBeat = serveBeat + 1f;
|
||||
}
|
||||
|
||||
beatDur1 = 0.5f;
|
||||
beatDur2 = 0.5f;
|
||||
break;
|
||||
case RallySpeed.Slow:
|
||||
if (!served)
|
||||
{
|
||||
hitBeat = serveBeat + 4f;
|
||||
}
|
||||
|
||||
beatDur1 = 2f;
|
||||
beatDur2 = 2f;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
// Ball position.
|
||||
var curveToUse = served ? serveCurve : returnCurve;
|
||||
float curvePosition;
|
||||
|
||||
var hitPosition1 = cond.GetPositionFromBeat(hitBeat, beatDur1);
|
||||
if (hitPosition1 >= 1f)
|
||||
{
|
||||
var hitPosition2 = cond.GetPositionFromBeat(hitBeat + beatDur1, beatDur2);
|
||||
curvePosition = tableHitTime + hitPosition2 * (1f - tableHitTime);
|
||||
}
|
||||
else
|
||||
{
|
||||
curvePosition = hitPosition1 * tableHitTime;
|
||||
}
|
||||
|
||||
if (!missed)
|
||||
{
|
||||
float curveHeight = 1f;
|
||||
if (rallySpeed == RallySpeed.Fast && !served && hitPosition1 >= 1f)
|
||||
curveHeight = 2f;
|
||||
else if (rallySpeed == RallySpeed.Slow)
|
||||
curveHeight = 3f;
|
||||
|
||||
curveToUse.transform.localScale = new Vector3(1f, curveHeight, 1f);
|
||||
ball.transform.position = curveToUse.GetPoint(Mathf.Clamp(curvePosition, 0, 1));
|
||||
}
|
||||
|
||||
// TODO: Make conditional so ball shadow only appears when over table.
|
||||
ballShadow.transform.position = new Vector3(ball.transform.position.x, -0.399f, ball.transform.position.z);
|
||||
|
||||
|
||||
var timeBeforeNextHit = hitBeat + beatDur1 + beatDur2 - currentBeat;
|
||||
|
||||
// Check if the opponent should swing.
|
||||
if (!served && timeBeforeNextHit <= 0f)
|
||||
{
|
||||
List<Beatmap.Entity> rallies = GameManager.instance.Beatmap.entities.FindAll(c => c.datamodel == "rhythmRally/rally" || c.datamodel == "rhythmRally/slow rally");
|
||||
for (int i = 0; i < rallies.Count; i++)
|
||||
{
|
||||
var rally = rallies[i];
|
||||
if (rally.beat - currentBeat <= 0f && rally.beat + rally.length - currentBeat > 0f)
|
||||
{
|
||||
Serve(hitBeat + beatDur1 + beatDur2, rallySpeed);
|
||||
opponentServing = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Check if paddler should do ready animation.
|
||||
bool readyToPrep;
|
||||
if (rallySpeed == RallySpeed.Slow || (!served && rallySpeed == RallySpeed.Fast))
|
||||
readyToPrep = timeBeforeNextHit <= 2f;
|
||||
else
|
||||
readyToPrep = timeBeforeNextHit <= 1f;
|
||||
|
||||
// Paddler ready animation.
|
||||
if (readyToPrep && !opponentServing)
|
||||
{
|
||||
if (served)
|
||||
{
|
||||
playerPrepping = true;
|
||||
if ((playerState.IsName("Swing") && playerAnim.IsAnimationNotPlaying()) || (!playerState.IsName("Swing") && !playerState.IsName("Ready1")))
|
||||
playerAnim.Play("Ready1");
|
||||
}
|
||||
else if (!opponentServing)
|
||||
{
|
||||
opponentPrepping = true;
|
||||
if ((opponentState.IsName("Swing") && opponentAnim.IsAnimationNotPlaying()) || (!opponentState.IsName("Swing") && !opponentState.IsName("Ready1")))
|
||||
opponentAnim.Play("Ready1");
|
||||
|
||||
// If player never swung and is still in ready state, snap them out of it.
|
||||
if (missed && playerState.IsName("Ready1"))
|
||||
playerAnim.Play("Beat");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Paddler bop animation.
|
||||
if (cond.ReportBeat(ref bop.lastReportedBeat, bop.startBeat % 1))
|
||||
{
|
||||
if (cond.songPositionInBeats >= bop.startBeat && cond.songPositionInBeats < bop.startBeat + bop.length)
|
||||
if (currentBeat >= bop.startBeat && currentBeat < bop.startBeat + bop.length)
|
||||
{
|
||||
var playerState = playerAnim.GetCurrentAnimatorStateInfo(0);
|
||||
if (playerAnim.IsAnimationNotPlaying() || playerState.IsName("Idle") || playerState.IsName("Beat"))
|
||||
if (!playerPrepping && (playerAnim.IsAnimationNotPlaying() || playerState.IsName("Idle") || playerState.IsName("Beat")))
|
||||
playerAnim.Play("Beat", 0, 0);
|
||||
|
||||
var opponentState = opponentAnim.GetCurrentAnimatorStateInfo(0);
|
||||
if (opponentAnim.IsAnimationNotPlaying() || opponentState.IsName("Idle") || opponentState.IsName("Beat"))
|
||||
if (!opponentPrepping && !opponentServing && (opponentAnim.IsAnimationNotPlaying() || opponentState.IsName("Idle") || opponentState.IsName("Beat")))
|
||||
opponentAnim.Play("Beat", 0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
opponentServing = false;
|
||||
}
|
||||
|
||||
public void Bop(float beat, float length)
|
||||
|
@ -68,5 +222,80 @@ namespace RhythmHeavenMania.Games.RhythmRally
|
|||
bop.length = length;
|
||||
bop.startBeat = beat;
|
||||
}
|
||||
|
||||
public void Serve(float beat, RallySpeed speed)
|
||||
{
|
||||
served = true;
|
||||
missed = false;
|
||||
started = true;
|
||||
opponentServing = true;
|
||||
|
||||
serveBeat = beat;
|
||||
rallySpeed = speed;
|
||||
|
||||
var bounceBeat = 0f;
|
||||
|
||||
switch (rallySpeed)
|
||||
{
|
||||
case RallySpeed.Normal:
|
||||
targetBeat = serveBeat + 2f;
|
||||
bounceBeat = serveBeat + 1f;
|
||||
break;
|
||||
case RallySpeed.Fast:
|
||||
case RallySpeed.SuperFast:
|
||||
targetBeat = serveBeat + 1f;
|
||||
bounceBeat = serveBeat + 0.5f;
|
||||
break;
|
||||
case RallySpeed.Slow:
|
||||
targetBeat = serveBeat + 4f;
|
||||
bounceBeat = serveBeat + 2f;
|
||||
break;
|
||||
}
|
||||
|
||||
opponentAnim.Play("Swing", 0, 0);
|
||||
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("rhythmRally/Serve", serveBeat), new MultiSound.Sound("rhythmRally/ServeBounce", bounceBeat) });
|
||||
|
||||
paddlers.ResetState();
|
||||
}
|
||||
|
||||
public void PrepareFastRally(float beat, RallySpeed speedChange)
|
||||
{
|
||||
if (speedChange == RallySpeed.Fast)
|
||||
{
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat + 2f, delegate { Serve(beat + 2f, RallySpeed.Fast); })
|
||||
});
|
||||
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("rhythmRally/Tonk", beat),
|
||||
new MultiSound.Sound("rhythmRally/Tink", beat + 0.5f),
|
||||
new MultiSound.Sound("rhythmRally/Tonk", beat + 1f)
|
||||
});
|
||||
}
|
||||
else if (speedChange == RallySpeed.SuperFast)
|
||||
{
|
||||
BeatAction.New(gameObject, new List<BeatAction.Action>()
|
||||
{
|
||||
new BeatAction.Action(beat + 4f, delegate { Serve(beat + 4f, RallySpeed.SuperFast); }),
|
||||
new BeatAction.Action(beat + 6f, delegate { Serve(beat + 6f, RallySpeed.SuperFast); }),
|
||||
new BeatAction.Action(beat + 8f, delegate { Serve(beat + 8f, RallySpeed.SuperFast); }),
|
||||
new BeatAction.Action(beat + 10f, delegate { Serve(beat + 10f, RallySpeed.SuperFast); })
|
||||
});
|
||||
|
||||
MultiSound.Play(new MultiSound.Sound[]
|
||||
{
|
||||
new MultiSound.Sound("rhythmRally/Tonk", beat),
|
||||
new MultiSound.Sound("rhythmRally/Tink", beat + 0.5f),
|
||||
new MultiSound.Sound("rhythmRally/Tonk", beat + 1f),
|
||||
new MultiSound.Sound("rhythmRally/Tink", beat + 1.5f),
|
||||
new MultiSound.Sound("rhythmRally/Tonk", beat + 2f),
|
||||
new MultiSound.Sound("rhythmRally/Tink", beat + 2.5f),
|
||||
new MultiSound.Sound("rhythmRally/Tonk", beat + 3f),
|
||||
new MultiSound.Sound("rhythmRally/Tink", beat + 3.5f)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -217,9 +217,13 @@ namespace RhythmHeavenMania
|
|||
new GameAction("reset tweezer delay", delegate { RhythmTweezers.instance.tweezerBeatOffset = 0f; }, 0.5f),
|
||||
}),
|
||||
|
||||
new Minigame("rhythmRally", "Rhythm Rally", "B888F8", true, false, new List<GameAction>()
|
||||
new Minigame("rhythmRally", "Rhythm Rally \n<color=#eb5454>[WIP don't use]</color>", "B888F8", true, false, new List<GameAction>()
|
||||
{
|
||||
new GameAction("bop", delegate { RhythmRally.instance.Bop(eventCaller.currentEntity.beat, eventCaller.currentEntity.length); }, 0.5f, true),
|
||||
new GameAction("rally", delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Normal); }, 4f, true),
|
||||
new GameAction("slow rally", delegate { RhythmRally.instance.Serve(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Slow); }, 8f, true),
|
||||
new GameAction("fast rally", delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.Fast); }, 6f),
|
||||
new GameAction("superfast rally", delegate { RhythmRally.instance.PrepareFastRally(eventCaller.currentEntity.beat, RhythmRally.RallySpeed.SuperFast); }, 12f),
|
||||
}),
|
||||
/*new Minigame("spaceDance", "Space Dance", "B888F8", new List<GameAction>()
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue