├── .gitignore ├── .vscode └── settings.json ├── Assets ├── MusicEffectPack.meta ├── MusicEffectPack │ ├── BGM_GAME.mp3 │ ├── BGM_GAME.mp3.meta │ ├── Materials.meta │ ├── Materials │ │ ├── HitEff.mat │ │ ├── HitEff.mat.meta │ │ ├── Line.mat │ │ ├── Line.mat.meta │ │ ├── TouchEffectMat.mat │ │ └── TouchEffectMat.mat.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── Effects.meta │ │ ├── Effects │ │ │ ├── Effects.prefab │ │ │ ├── Effects.prefab.meta │ │ │ ├── HitEff.prefab │ │ │ ├── HitEff.prefab.meta │ │ │ ├── TouchEffectManger.prefab │ │ │ └── TouchEffectManger.prefab.meta │ │ ├── Notes0.prefab │ │ ├── Notes0.prefab.meta │ │ ├── Notes1.prefab │ │ ├── Notes1.prefab.meta │ │ ├── Notes2.prefab │ │ ├── Notes2.prefab.meta │ │ ├── Notes3.prefab │ │ ├── Notes3.prefab.meta │ │ ├── Notes4.prefab │ │ └── Notes4.prefab.meta │ ├── Resources.meta │ ├── Resources │ │ ├── CSV.meta │ │ └── CSV │ │ │ ├── TestTiming.csv │ │ │ └── TestTiming.csv.meta │ ├── Scenes.meta │ ├── Scenes │ │ ├── GameScene.unity │ │ ├── GameScene.unity.meta │ │ ├── NotesTimingMakeScene.unity │ │ └── NotesTimingMakeScene.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── EffectManager.cs │ │ ├── EffectManager.cs.meta │ │ ├── GameController.cs │ │ ├── GameController.cs.meta │ │ ├── GameUtil.cs │ │ ├── GameUtil.cs.meta │ │ ├── NotesScript.cs │ │ ├── NotesScript.cs.meta │ │ ├── SingletonMonoBehaviour.cs │ │ ├── SingletonMonoBehaviour.cs.meta │ │ ├── TouchEffectManager.cs │ │ └── TouchEffectManager.cs.meta ├── TimingMaker.meta └── TimingMaker │ ├── CSVWriter.cs │ ├── CSVWriter.cs.meta │ ├── NotesTimingMaker.cs │ └── NotesTimingMaker.cs.meta ├── AssetsTest.csv ├── Packages └── manifest.json └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset └── UnityConnectSettings.asset /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | Temp/ 5 | Obj/ 6 | UnityGenerated/ 7 | Library/ 8 | 9 | # ===================================== # 10 | # Visual Studio / MonoDevelop generated # 11 | # ===================================== # 12 | ExportedObj/ 13 | *.svd 14 | *.userprefs 15 | *.csproj 16 | *.pidb 17 | *.suo 18 | *.sln 19 | *.user 20 | *.unityproj 21 | *.booproj 22 | 23 | # ============ # 24 | # OS generated # 25 | # ============ # 26 | .DS_Store 27 | .DS_Store? 28 | ._* 29 | .Spotlight-V100 30 | .Trashes 31 | Icon? 32 | ehthumbs.db 33 | Thumbs.db 34 | 35 | # ============ # 36 | # Build # 37 | # ============ # 38 | *.html 39 | *.unity3d 40 | 41 | # ============ # 42 | # for others # 43 | # ============ # 44 | 45 | *.log #log files, for some plugins 46 | *.pyc #python bytecode cache, for some plugins. 47 | sysinfo.txt #Unity3D Generated File On Crash Reports -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | { 2 | "files.exclude": 3 | { 4 | "**/.DS_Store":true, 5 | "**/.git":true, 6 | "**/.gitignore":true, 7 | "**/.gitmodules":true, 8 | "**/*.booproj":true, 9 | "**/*.pidb":true, 10 | "**/*.suo":true, 11 | "**/*.user":true, 12 | "**/*.userprefs":true, 13 | "**/*.unityproj":true, 14 | "**/*.dll":true, 15 | "**/*.exe":true, 16 | "**/*.pdf":true, 17 | "**/*.mid":true, 18 | "**/*.midi":true, 19 | "**/*.wav":true, 20 | "**/*.gif":true, 21 | "**/*.ico":true, 22 | "**/*.jpg":true, 23 | "**/*.jpeg":true, 24 | "**/*.png":true, 25 | "**/*.psd":true, 26 | "**/*.tga":true, 27 | "**/*.tif":true, 28 | "**/*.tiff":true, 29 | "**/*.3ds":true, 30 | "**/*.3DS":true, 31 | "**/*.fbx":true, 32 | "**/*.FBX":true, 33 | "**/*.lxo":true, 34 | "**/*.LXO":true, 35 | "**/*.ma":true, 36 | "**/*.MA":true, 37 | "**/*.obj":true, 38 | "**/*.OBJ":true, 39 | "**/*.asset":true, 40 | "**/*.cubemap":true, 41 | "**/*.flare":true, 42 | "**/*.mat":true, 43 | "**/*.meta":true, 44 | "**/*.prefab":true, 45 | "**/*.unity":true, 46 | "build/":true, 47 | "Build/":true, 48 | "Library/":true, 49 | "library/":true, 50 | "obj/":true, 51 | "Obj/":true, 52 | "ProjectSettings/":true, 53 | "temp/":true, 54 | "Temp/":true 55 | } 56 | } -------------------------------------------------------------------------------- /Assets/MusicEffectPack.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ed280f81434734ef5b85b6e6bca24acc 3 | folderAsset: yes 4 | timeCreated: 1477184642 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/BGM_GAME.mp3: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/BGM_GAME.mp3 -------------------------------------------------------------------------------- /Assets/MusicEffectPack/BGM_GAME.mp3.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce8786e1b71064991ab07d9838f79795 3 | timeCreated: 1473234157 4 | licenseType: Free 5 | AudioImporter: 6 | serializedVersion: 6 7 | defaultSettings: 8 | loadType: 0 9 | sampleRateSetting: 0 10 | sampleRateOverride: 44100 11 | compressionFormat: 1 12 | quality: 1 13 | conversionMode: 0 14 | platformSettingOverrides: {} 15 | forceToMono: 0 16 | normalize: 1 17 | preloadAudioData: 1 18 | loadInBackground: 0 19 | 3D: 1 20 | userData: 21 | assetBundleName: 22 | assetBundleVariant: 23 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89d44a271c4874b2180ac0c581f302ee 3 | folderAsset: yes 4 | timeCreated: 1472891093 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials/HitEff.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Materials/HitEff.mat -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials/HitEff.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d9678d469d5041c3887cbcea64eaddf 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials/Line.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Materials/Line.mat -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials/Line.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b6b1720dbdc0b454dac94bb4e3bc4c14 3 | timeCreated: 1472891088 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials/TouchEffectMat.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Materials/TouchEffectMat.mat -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Materials/TouchEffectMat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2c4bd36f8c574de9ad3df6406db1c62 3 | timeCreated: 1477185413 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6baf16ddc68624bf298d0a91be45d099 3 | folderAsset: yes 4 | timeCreated: 1472891011 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3eff952e0cc6041738244df0d79af328 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects/Effects.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Effects/Effects.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects/Effects.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be51da8471dd6495f80d2364ef024550 3 | timeCreated: 1477185201 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects/HitEff.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Effects/HitEff.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects/HitEff.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84b482c23c63d47ca9e530ac24781056 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 100100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects/TouchEffectManger.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Effects/TouchEffectManger.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Effects/TouchEffectManger.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 887fb61229bb444948f8266051387f7a 3 | timeCreated: 1477186622 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes0.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Notes0.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes0.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: baa2846b5e8ee46fdac2f0b22ab24049 3 | timeCreated: 1472952262 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes1.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Notes1.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f41efc4f923504758ae0fa470c4e19a3 3 | timeCreated: 1472952265 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes2.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Notes2.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes2.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 37308cc95051f4a79a763cc57f542ad0 3 | timeCreated: 1472952269 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes3.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Notes3.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes3.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3cdf59d2531a4a919a5f66cb35daa07 3 | timeCreated: 1472952273 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes4.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Prefabs/Notes4.prefab -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Prefabs/Notes4.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3a701b6103c34353a8b86f7981f9d2b 3 | timeCreated: 1472952276 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d5a85ada59324b8380259ada4fc8046 3 | folderAsset: yes 4 | timeCreated: 1472892477 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Resources/CSV.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c7d7989d39dd40d3b9f5059b7b8abe9 3 | folderAsset: yes 4 | timeCreated: 1472892488 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Resources/CSV/TestTiming.csv: -------------------------------------------------------------------------------- 1 | 2.676105,1 2 | 2.805828,3 3 | 2.97453,1 4 | 3.289391,2 5 | 3.622102,3 6 | 3.774727,4 7 | 4.258121,2 8 | 4.53867,4 9 | 4.705946,2 10 | 4.874768,3 11 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Resources/CSV/TestTiming.csv.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3cba34717e9044fb8a8f1e82bf6778d 3 | timeCreated: 1472954033 4 | licenseType: Free 5 | TextScriptImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 614612a9f44654cd5b472ded9607779e 3 | folderAsset: yes 4 | timeCreated: 1472890805 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scenes/GameScene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Scenes/GameScene.unity -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scenes/GameScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5fc41459ed09f40e7b7a87f477de903c 3 | timeCreated: 1472890799 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scenes/NotesTimingMakeScene.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/Assets/MusicEffectPack/Scenes/NotesTimingMakeScene.unity -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scenes/NotesTimingMakeScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 190ee1844f1bf44b48e9075a71c1db66 3 | timeCreated: 1472889059 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b30e8c73cf9943018aeda254c1097ee 3 | folderAsset: yes 4 | timeCreated: 1472890687 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/EffectManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class EffectManager : SingletonMonoBehaviour { 5 | 6 | public ParticleSystem[] particles; 7 | 8 | public void PlayEffect(int num){ 9 | particles [num].Play (true); 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/EffectManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7bc38dbd6f89543a29182bf0a243beb7 3 | timeCreated: 1477184672 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/GameController.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.IO; 4 | using System; 5 | using UnityEngine.UI; 6 | 7 | public class GameController : MonoBehaviour { 8 | 9 | public GameObject[] notes; 10 | private float[] _timing; 11 | private int[] _lineNum; 12 | 13 | public string filePass; 14 | private int _notesCount = 0; 15 | 16 | private AudioSource _audioSource; 17 | private float _startTime = 0; 18 | 19 | public float timeOffset = -1; 20 | 21 | private bool _isPlaying = false; 22 | public GameObject startButton; 23 | 24 | public Text scoreText; 25 | private int _score = 0; 26 | 27 | void Start(){ 28 | _audioSource = GameObject.Find ("GameMusic").GetComponent (); 29 | _timing = new float[1024]; 30 | _lineNum = new int[1024]; 31 | LoadCSV (); 32 | } 33 | 34 | void Update () { 35 | if (_isPlaying) { 36 | CheckNextNotes (); 37 | scoreText.text = _score.ToString (); 38 | } 39 | 40 | } 41 | 42 | public void StartGame(){ 43 | startButton.SetActive (false); 44 | _startTime = Time.time; 45 | _audioSource.Play (); 46 | _isPlaying = true; 47 | } 48 | 49 | void CheckNextNotes(){ 50 | while (_timing [_notesCount] + timeOffset < GetMusicTime () && _timing [_notesCount] != 0) { 51 | SpawnNotes (_lineNum[_notesCount]); 52 | _notesCount++; 53 | } 54 | } 55 | 56 | void SpawnNotes(int num){ 57 | Instantiate (notes[num], 58 | new Vector3 (-4.0f + (2.0f * num), 10.0f, 0), 59 | Quaternion.identity); 60 | } 61 | 62 | void LoadCSV(){ 63 | int i = 0, j; 64 | TextAsset csv = Resources.Load (filePass) as TextAsset; 65 | StringReader reader = new StringReader (csv.text); 66 | while (reader.Peek () > -1) { 67 | 68 | string line = reader.ReadLine (); 69 | string[] values = line.Split (','); 70 | for (j = 0; j < values.Length; j++) { 71 | _timing [i] = float.Parse( values [0] ); 72 | _lineNum [i] = int.Parse( values [1] ); 73 | } 74 | i++; 75 | } 76 | } 77 | 78 | float GetMusicTime(){ 79 | return Time.time - _startTime; 80 | } 81 | 82 | public void GoodTimingFunc(int num){ 83 | Debug.Log ("Line:" + num + " good!"); 84 | Debug.Log (GetMusicTime()); 85 | // 追加 86 | EffectManager.Instance.PlayEffect(num); 87 | _score++; 88 | } 89 | } 90 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/GameController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 630413e0d375940f8a6c0214c9d93a85 3 | timeCreated: 1472891162 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/GameUtil.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public static class GameUtil { 6 | 7 | public static KeyCode GetKeyCodeByLineNum (int lineNum) { 8 | switch (lineNum) { 9 | case 0: 10 | return KeyCode.D; 11 | case 1: 12 | return KeyCode.F; 13 | case 2: 14 | return KeyCode.G; 15 | case 3: 16 | return KeyCode.H; 17 | case 4: 18 | return KeyCode.J; 19 | default: 20 | return KeyCode.None; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/GameUtil.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c581822af0c04d34ba5045baeaedf32 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/NotesScript.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using UnityEngine; 3 | 4 | public class NotesScript : MonoBehaviour { 5 | 6 | public int lineNum; 7 | private GameController _gameManager; 8 | private bool isInLine = false; 9 | private KeyCode _lineKey; 10 | 11 | void Start () { 12 | _gameManager = GameObject.Find ("GameManager").GetComponent (); 13 | _lineKey = GameUtil.GetKeyCodeByLineNum(lineNum); 14 | } 15 | 16 | void Update () { 17 | this.transform.position += Vector3.down * 10 * Time.deltaTime; 18 | 19 | if (this.transform.position.y < -5.0f) { 20 | Debug.Log ("false"); 21 | Destroy (this.gameObject); 22 | } 23 | 24 | if(isInLine){ 25 | CheckInput(_lineKey); 26 | } 27 | } 28 | 29 | void OnTriggerEnter (Collider other) { 30 | isInLine = true; 31 | } 32 | 33 | void OnTriggerExit (Collider other) { 34 | isInLine = false; 35 | } 36 | 37 | void CheckInput (KeyCode key) { 38 | 39 | if (Input.GetKeyDown (key)) { 40 | _gameManager.GoodTimingFunc (lineNum); 41 | Destroy (this.gameObject); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/NotesScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb6e155161e9647038c815958d8157e7 3 | timeCreated: 1472894627 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/SingletonMonoBehaviour.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System; 3 | 4 | public abstract class SingletonMonoBehaviour : MonoBehaviour where T : MonoBehaviour{ 5 | 6 | private static T instance; 7 | public static T Instance 8 | { 9 | get{ 10 | if (instance == null) { 11 | Type t = typeof(T); 12 | 13 | instance = (T)FindObjectOfType (t); 14 | if (instance == null) { 15 | Debug.LogError (t + " をアタッチしているGameObjectはありません"); 16 | } 17 | } 18 | 19 | return instance; 20 | } 21 | } 22 | 23 | virtual protected void Awake(){ 24 | // 他のゲームオブジェクトにアタッチされているか調べる 25 | // アタッチされている場合は破棄する。 26 | CheckInstance(); 27 | } 28 | 29 | protected bool CheckInstance(){ 30 | if (instance == null) { 31 | instance = this as T; 32 | return true; 33 | } else if( Instance == this ){ 34 | return true; 35 | } 36 | 37 | Destroy (this); 38 | return false; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/SingletonMonoBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 251eab443e6234473965e77263fc32ac 3 | timeCreated: 1477185077 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/TouchEffectManager.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class TouchEffectManager : SingletonMonoBehaviour { 5 | 6 | private GameObject[] _touchEffects; 7 | 8 | void Start(){ 9 | _touchEffects = new GameObject[5]; 10 | for (int i = 0; i < 5; i++) { 11 | _touchEffects [i] = this.transform.GetChild (i).gameObject; 12 | } 13 | } 14 | 15 | void Update() 16 | { 17 | for(int i = 0; i < 5; i++ ){ 18 | CheckInput(GameUtil.GetKeyCodeByLineNum(i), i); 19 | } 20 | } 21 | 22 | void CheckInput(KeyCode key, int num) { 23 | if (Input.GetKeyDown (key)) { 24 | PlayEffect (num); 25 | } 26 | } 27 | 28 | public void PlayEffect(int num){ 29 | StartCoroutine (TouchEffect (num)); 30 | } 31 | 32 | IEnumerator TouchEffect(int num){ 33 | if (_touchEffects [num].activeInHierarchy) 34 | yield break; 35 | 36 | _touchEffects [num].SetActive (true); 37 | yield return new WaitForSeconds (0.1f); 38 | _touchEffects [num].SetActive (false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/MusicEffectPack/Scripts/TouchEffectManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1dc185a066a54e17870e1a2d9fc8b50 3 | timeCreated: 1477185527 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/TimingMaker.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16c1dfccca3204b8e82293fe8e96e9d4 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/TimingMaker/CSVWriter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.IO; 4 | 5 | public class CSVWriter : MonoBehaviour { 6 | 7 | public string fileName; // 保存するファイル名 8 | 9 | // CSVに書き込む処理 10 | public void WriteCSV(string txt){ 11 | StreamWriter streamWriter; 12 | FileInfo fileInfo; 13 | fileInfo = new FileInfo (Application.dataPath +"/"+ fileName + ".csv"); 14 | streamWriter = fileInfo.AppendText (); 15 | streamWriter.WriteLine (txt); 16 | streamWriter.Flush(); 17 | streamWriter.Close (); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Assets/TimingMaker/CSVWriter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80b44cb3007f54e6482ba2985088ff59 3 | timeCreated: 1472887305 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/TimingMaker/NotesTimingMaker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class NotesTimingMaker : MonoBehaviour { 5 | 6 | private AudioSource _audioSource; 7 | private float _startTime = 0; 8 | private CSVWriter _CSVWriter; 9 | 10 | private bool _isPlaying = false; 11 | public GameObject startButton; 12 | 13 | void Start () { 14 | _audioSource = GameObject.Find("GameMusic").GetComponent (); 15 | _CSVWriter = GameObject.Find ("CSVWriter").GetComponent (); 16 | } 17 | 18 | void Update () { 19 | if (_isPlaying) { 20 | DetectKeys (); 21 | } 22 | } 23 | 24 | public void StartMusic(){ 25 | startButton.SetActive (false); 26 | _audioSource.Play (); 27 | _startTime = Time.time; 28 | _isPlaying = true; 29 | } 30 | 31 | void DetectKeys(){ 32 | if (Input.GetKeyDown (KeyCode.D)) { 33 | WriteNotesTiming (0); 34 | } 35 | 36 | if (Input.GetKeyDown (KeyCode.F)) { 37 | WriteNotesTiming (1); 38 | } 39 | 40 | if (Input.GetKeyDown (KeyCode.Space)) { 41 | WriteNotesTiming (2); 42 | } 43 | 44 | if (Input.GetKeyDown (KeyCode.J)) { 45 | WriteNotesTiming (3); 46 | } 47 | 48 | if (Input.GetKeyDown (KeyCode.K)) { 49 | WriteNotesTiming (4); 50 | } 51 | } 52 | 53 | void WriteNotesTiming(int num){ 54 | Debug.Log (GetTiming ()); 55 | _CSVWriter.WriteCSV (GetTiming ().ToString () + "," + num.ToString()); 56 | } 57 | 58 | float GetTiming(){ 59 | return Time.time - _startTime; 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /Assets/TimingMaker/NotesTimingMaker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 88c7f40f254844ade8d2d69778473bea 3 | timeCreated: 1472889182 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /AssetsTest.csv: -------------------------------------------------------------------------------- 1 | Hello,World 2 | Hello,World 3 | Hello,World 4 | Hello,World 5 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "2.0.16", 5 | "com.unity.package-manager-ui": "1.9.11", 6 | "com.unity.purchasing": "2.0.3", 7 | "com.unity.textmeshpro": "1.2.4", 8 | "com.unity.modules.ai": "1.0.0", 9 | "com.unity.modules.animation": "1.0.0", 10 | "com.unity.modules.assetbundle": "1.0.0", 11 | "com.unity.modules.audio": "1.0.0", 12 | "com.unity.modules.cloth": "1.0.0", 13 | "com.unity.modules.director": "1.0.0", 14 | "com.unity.modules.imageconversion": "1.0.0", 15 | "com.unity.modules.imgui": "1.0.0", 16 | "com.unity.modules.jsonserialize": "1.0.0", 17 | "com.unity.modules.particlesystem": "1.0.0", 18 | "com.unity.modules.physics": "1.0.0", 19 | "com.unity.modules.physics2d": "1.0.0", 20 | "com.unity.modules.screencapture": "1.0.0", 21 | "com.unity.modules.terrain": "1.0.0", 22 | "com.unity.modules.terrainphysics": "1.0.0", 23 | "com.unity.modules.tilemap": "1.0.0", 24 | "com.unity.modules.ui": "1.0.0", 25 | "com.unity.modules.uielements": "1.0.0", 26 | "com.unity.modules.umbra": "1.0.0", 27 | "com.unity.modules.unityanalytics": "1.0.0", 28 | "com.unity.modules.unitywebrequest": "1.0.0", 29 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 30 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 31 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 32 | "com.unity.modules.unitywebrequestwww": "1.0.0", 33 | "com.unity.modules.vehicles": "1.0.0", 34 | "com.unity.modules.video": "1.0.0", 35 | "com.unity.modules.vr": "1.0.0", 36 | "com.unity.modules.wind": "1.0.0", 37 | "com.unity.modules.xr": "1.0.0" 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/PresetManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2018.2.2f1 2 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/teach310/SimpleMusicGame/44c8d13185eaaef8667d52a1f372dbe58a1def6b/ProjectSettings/UnityConnectSettings.asset --------------------------------------------------------------------------------