General code cleanup
This commit is contained in:
parent
575e47e384
commit
1a7b1b7e07
BIN
Assets/Resources/Music/theclappytrio.ogg
Normal file
BIN
Assets/Resources/Music/theclappytrio.ogg
Normal file
Binary file not shown.
22
Assets/Resources/Music/theclappytrio.ogg.meta
Normal file
22
Assets/Resources/Music/theclappytrio.ogg.meta
Normal file
|
@ -0,0 +1,22 @@
|
|||
fileFormatVersion: 2
|
||||
guid: ebc898cbaf3e679438e83c68552e527f
|
||||
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:
|
|
@ -138,7 +138,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &49975355
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -1359,7 +1359,7 @@ MonoBehaviour:
|
|||
m_Script: {fileID: 11500000, guid: 066f6ce2bdafdfb45a8df77dfb111c22, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
songBpm: 130
|
||||
songBpm: 120
|
||||
secPerBeat: 0
|
||||
songPosition: 0
|
||||
songPositionInBeats: 0
|
||||
|
@ -1381,7 +1381,7 @@ AudioSource:
|
|||
m_Enabled: 1
|
||||
serializedVersion: 4
|
||||
OutputAudioMixerGroup: {fileID: 0}
|
||||
m_audioClip: {fileID: 8300000, guid: 51af38323954a8d44874780ba4577fb4, type: 3}
|
||||
m_audioClip: {fileID: 8300000, guid: ebc898cbaf3e679438e83c68552e527f, type: 3}
|
||||
m_PlayOnAwake: 0
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
|
@ -3884,7 +3884,7 @@ GameObject:
|
|||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!4 &1161847961
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
@ -6634,7 +6634,7 @@ MonoBehaviour:
|
|||
playerEntities: []
|
||||
currentEvent: 0
|
||||
currentPlayerEvent: 0
|
||||
txt: {fileID: 4900000, guid: cbe1a43c8ddc790498fde2e01e66d23e, type: 3}
|
||||
txt: {fileID: 4900000, guid: 13908201c7935ea4c8e9d2a58b006b87, type: 3}
|
||||
startOffset: 1
|
||||
--- !u!212 &2072389418
|
||||
SpriteRenderer:
|
||||
|
|
|
@ -6,7 +6,7 @@ namespace RhythmHeavenMania
|
|||
[Serializable]
|
||||
public class Beatmap
|
||||
{
|
||||
public double bpm;
|
||||
public float bpm;
|
||||
public List<Entity> entities;
|
||||
|
||||
[Serializable]
|
||||
|
@ -14,6 +14,7 @@ namespace RhythmHeavenMania
|
|||
{
|
||||
public float beat;
|
||||
public int track;
|
||||
public float length;
|
||||
public string datamodel;
|
||||
|
||||
public object Clone()
|
||||
|
|
|
@ -104,6 +104,12 @@ namespace RhythmHeavenMania
|
|||
return final;
|
||||
}
|
||||
|
||||
public void SetBpm(float bpm)
|
||||
{
|
||||
this.songBpm = bpm;
|
||||
secPerBeat = 60f / songBpm;
|
||||
}
|
||||
|
||||
public bool InThreshold(float beat)
|
||||
{
|
||||
//Check if the beat sent falls within beatThreshold
|
||||
|
|
|
@ -66,6 +66,10 @@ namespace RhythmHeavenMania
|
|||
new GameAction("prepare", delegate { ForkLifter.instance.ForkLifterHand.Prepare(); }),
|
||||
new GameAction("gulp", delegate { ForkLifterPlayer.instance.Eat(); }),
|
||||
new GameAction("sigh", delegate { Jukebox.PlayOneShot("sigh"); })
|
||||
}),
|
||||
new MiniGame("clappyTrio", new List<GameAction>()
|
||||
{
|
||||
new GameAction("clap", delegate { Debug.Log("bruh"); }, true ),
|
||||
})
|
||||
};
|
||||
|
||||
|
@ -93,7 +97,7 @@ namespace RhythmHeavenMania
|
|||
|
||||
private void Update()
|
||||
{
|
||||
if (GameManager.instance.currentEvent > 0 && GameManager.instance.currentEvent < GameManager.instance.Beatmap.entities.Count)
|
||||
if (GameManager.instance.currentEvent >= 0 && GameManager.instance.currentEvent < GameManager.instance.Beatmap.entities.Count)
|
||||
currentBeat = GameManager.instance.Beatmap.entities[GameManager.instance.currentEvent].beat;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,16 +34,17 @@ namespace RhythmHeavenMania
|
|||
SortEventsList();
|
||||
|
||||
string json = txt.text;
|
||||
Beatmap.entities = JsonConvert.DeserializeObject<List<Beatmap.Entity>>(json);
|
||||
Beatmap = JsonConvert.DeserializeObject<Beatmap>(json);
|
||||
|
||||
SortEventsList();
|
||||
|
||||
StartCoroutine(Begin());
|
||||
|
||||
GlobalGameManager.Init();
|
||||
|
||||
eventCaller = GetComponent<EventCaller>();
|
||||
eventCaller.Init();
|
||||
Conductor.instance.SetBpm(Beatmap.bpm);
|
||||
|
||||
StartCoroutine(Begin());
|
||||
}
|
||||
|
||||
private IEnumerator Begin()
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
[
|
||||
{
|
||||
"bpm": 130,
|
||||
"entities": [
|
||||
{
|
||||
"beat": 9,
|
||||
"datamodel": "forkLifter/pea"
|
||||
|
@ -423,10 +425,201 @@
|
|||
"beat": 201,
|
||||
"datamodel": "forkLifter/sigh"
|
||||
},
|
||||
{"beat":8.0,"datamodel":"forkLifter/prepare"},{"beat":12.0,"datamodel":"forkLifter/prepare"},{"beat":17.0,"datamodel":"forkLifter/prepare"},{"beat":20.0,"datamodel":"forkLifter/prepare"},{"beat":24.0,"datamodel":"forkLifter/prepare"},{"beat":28.0,"datamodel":"forkLifter/prepare"},{"beat":33.0,"datamodel":"forkLifter/prepare"},{"beat":36.0,"datamodel":"forkLifter/prepare"},{"beat":40.0,"datamodel":"forkLifter/prepare"},{"beat":44.0,"datamodel":"forkLifter/prepare"},{"beat":48.0,"datamodel":"forkLifter/prepare"},{"beat":52.0,"datamodel":"forkLifter/prepare"},{"beat":56.0,"datamodel":"forkLifter/prepare"},{"beat":61.0,"datamodel":"forkLifter/prepare"},{"beat":64.0,"datamodel":"forkLifter/prepare"},{"beat":68.0,"datamodel":"forkLifter/prepare"},{"beat":72.0,"datamodel":"forkLifter/prepare"},{"beat":76.0,"datamodel":"forkLifter/prepare"},{"beat":80.0,"datamodel":"forkLifter/prepare"},{"beat":84.5,"datamodel":"forkLifter/prepare"},{"beat":89.0,"datamodel":"forkLifter/prepare"},{"beat":92.0,"datamodel":"forkLifter/prepare"},{"beat":97.0,"datamodel":"forkLifter/prepare"},{"beat":100.0,"datamodel":"forkLifter/prepare"},{"beat":104.0,"datamodel":"forkLifter/prepare"},{"beat":108.0,"datamodel":"forkLifter/prepare"},{"beat":113.0,"datamodel":"forkLifter/prepare"},{"beat":116.0,"datamodel":"forkLifter/prepare"},{"beat":120.0,"datamodel":"forkLifter/prepare"},{"beat":124.0,"datamodel":"forkLifter/prepare"},{"beat":129.0,"datamodel":"forkLifter/prepare"},{"beat":132.0,"datamodel":"forkLifter/prepare"},{"beat":136.5,"datamodel":"forkLifter/prepare"},{"beat":140.0,"datamodel":"forkLifter/prepare"},{"beat":144.5,"datamodel":"forkLifter/prepare"},{"beat":148.0,"datamodel":"forkLifter/prepare"},{"beat":152.5,"datamodel":"forkLifter/prepare"},{"beat":156.0,"datamodel":"forkLifter/prepare"},{"beat":160.5,"datamodel":"forkLifter/prepare"},{"beat":164.0,"datamodel":"forkLifter/prepare"},{"beat":168.5,"datamodel":"forkLifter/prepare"},{"beat":172.0,"datamodel":"forkLifter/prepare"},{"beat":176.5,"datamodel":"forkLifter/prepare"},{"beat":180.0,"datamodel":"forkLifter/prepare"},{"beat":184.5,"datamodel":"forkLifter/prepare"},{"beat":187.5,"datamodel":"forkLifter/prepare"},{"beat":192.0,"datamodel":"forkLifter/prepare"},{"beat":195.0,"datamodel":"forkLifter/prepare"}
|
||||
,
|
||||
{
|
||||
"beat": 8,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 12,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 17,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 20,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 24,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 28,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 33,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 36,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 40,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 44,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 48,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 52,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 56,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 61,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 64,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 68,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 72,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 76,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 80,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 84.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 89,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 92,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 97,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 100,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 104,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 108,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 113,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 116,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 120,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 124,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 129,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 132,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 136.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 140,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 144.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 148,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 152.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 156,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 160.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 164,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 168.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 172,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 176.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 180,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 184.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 187.5,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 192,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 195,
|
||||
"datamodel": "forkLifter/prepare"
|
||||
},
|
||||
{
|
||||
"beat": 206,
|
||||
"datamodel": "gameManager/end"
|
||||
}
|
||||
]
|
||||
}
|
10
Assets/theclappytrio.json
Normal file
10
Assets/theclappytrio.json
Normal file
|
@ -0,0 +1,10 @@
|
|||
{
|
||||
"bpm": 117.26,
|
||||
"entities": [
|
||||
{
|
||||
"beat": 9,
|
||||
"length": 3,
|
||||
"datamodel": "clappyTrio/clap"
|
||||
}
|
||||
]
|
||||
}
|
7
Assets/theclappytrio.json.meta
Normal file
7
Assets/theclappytrio.json.meta
Normal file
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 13908201c7935ea4c8e9d2a58b006b87
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Loading…
Reference in a new issue