private void Start() { scoreManager = FindObjectOfType <ScoreManager>(); bmsLoader = FindObjectOfType <BmsLoader>(); gameManager = FindObjectOfType <GameManager>(); startGame(); }
public void StopGame() { BmsLoader bmsLoader = FindObjectOfType <BmsLoader>(); bmsLoader.DestroyAllObject(); if (AudioManager.instance.isBGMPlaying()) { AudioManager.instance.stopBGM(); } isGameStart = false; }
private void ChangeSelectedIndex(int newIndex) { // 譜面IDを0~譜面数-1 の間に収める selectedIndex = Mathf.Clamp(newIndex, 0, beatmapCount - 1); selectedBmsLoader = bmsLoaders[selectedIndex]; // 楽曲情報 var title = selectedBmsLoader.headerData["TITLE"]; var artist = selectedBmsLoader.headerData["ARTIST"]; var playLevel = selectedBmsLoader.headerData["PLAYLEVEL"]; var notesCount = selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.Single) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.BlueSingle) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.YellowSingle) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.Appear) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.BlueAppear) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.YellowAppear) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.BlueSlash) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.YellowSlash) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.Stream) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.Slash) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.BlueSlash) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.YellowSlash) + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.Long) * 2 + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.BlueLong) * 2 + selectedBmsLoader.noteProperties .Count(x => x.noteType == NoteType.YellowLong) * 2; var minBpm = selectedBmsLoader.tempoChanges.Min(x => x.tempo); var maxBpm = selectedBmsLoader.tempoChanges.Max(x => x.tempo); // テキストを変更 var text = string.Format(informationTextFormat, title, artist, playLevel, notesCount, minBpm, maxBpm ); textInformation.text = text; }
public void startGame() { if (gameManager == null) { gameManager = FindObjectOfType <GameManager>(); } BmsLoader bmsLoader = FindObjectOfType <BmsLoader>(); string musicName = gameManager.getMusicName(); bmsLoader.BmsLoad(musicName); Debug.Log("music: " + AudioManager.instance.isBGMPlaying()); isGameStart = true; }
public float audioOffset; // 音源再生オフセット // (コンストラクタ)BMSファイルを読み込み public Beatmap(string filePath) { // BMSファイルの入っているフォルダの絶対パス var bmsDirectory = new FileInfo(filePath).DirectoryName; var bmsLoader = new BmsLoader(filePath); noteProperties = bmsLoader.noteProperties; tempoChanges = bmsLoader.tempoChanges; // 音源が指定されている時 if (bmsLoader.headerData.ContainsKey("WAV01")) { // 楽曲ファイルの絶対パス(フォルダ名とファイル名をつなげる) audioFilePath = bmsDirectory + "/" + bmsLoader.headerData["WAV01"]; } // 音源再生オフセットを設定 audioOffset = bmsLoader.audioOffset; }
private void Start() { // 譜面を検索するフォルダパス var beatmapDirectory = Application.dataPath + "/../Beatmaps"; // BMSファイル一覧を取得・設定 beatmapPaths = Directory.GetFiles(beatmapDirectory, "*.bms", SearchOption.AllDirectories); // 譜面情報を読み込み bmsLoaders = beatmapPaths.Select(path => new BmsLoader(path)).ToList(); selectedBmsLoader = bmsLoaders[selectedIndex]; beatmapCount = bmsLoaders.Count(); // 初期状態のテキスト内容をフォーマットとして保持 informationTextFormat = textInformation.text; scrollSpeedTextFormat = textScrollSpeed.text; // 初期状態でテキストを更新 ChangeSelectedIndex(selectedIndex); ChangeScrollSpeed(scrollSpeed); }
// Start is called before the first frame update void Start() { bmsLoader = FindObjectOfType <BmsLoader>(); scoreManager = FindObjectOfType <ScoreManager>(); effectManager = FindObjectOfType <EffectManager>(); scoreManager.initialize(); if (this.gameObject.name.CompareTo("JudgementLine1") == 0) { KeyboardKey = KeyCode.A; } else if (this.gameObject.name.CompareTo("JudgementLine2") == 0) { KeyboardKey = KeyCode.S; } else if (this.gameObject.name.CompareTo("JudgementLine3") == 0) { KeyboardKey = KeyCode.D; } else if (this.gameObject.name.CompareTo("JudgementLine4") == 0) { KeyboardKey = KeyCode.F; } else if (this.gameObject.name.CompareTo("JudgementLine5") == 0) { KeyboardKey = KeyCode.G; } else if (this.gameObject.name.CompareTo("JudgementLine6") == 0) { KeyboardKey = KeyCode.H; } else if (this.gameObject.name.CompareTo("JudgementLine7") == 0) { KeyboardKey = KeyCode.J; } Debug.Log(this.gameObject.name + KeyboardKey); }
// Start is called before the first frame update void Start() { bmsLoader = FindObjectOfType <BmsLoader>(); scoreManager = FindObjectOfType <ScoreManager>(); effectManager = FindObjectOfType <EffectManager>(); stageManager = FindObjectOfType <StageManager>(); scoreManager.initialize(); if (this.gameObject.name.CompareTo("JudgementLine1") == 0) { minX = 140; maxX = 500; maxY = 500; line_num = 0; } else if (this.gameObject.name.CompareTo("JudgementLine2") == 0) { minX = 520; maxX = 740; maxY = 500; line_num = 1; } else if (this.gameObject.name.CompareTo("JudgementLine3") == 0) { minX = 800; maxX = 1080; maxY = 500; line_num = 2; } else if (this.gameObject.name.CompareTo("JudgementLine4") == 0) { minX = 1100; maxX = 1380; maxY = 500; line_num = 3; } else if (this.gameObject.name.CompareTo("JudgementLine5") == 0) { minX = 1400; maxX = 1700; maxY = 500; line_num = 4; } //if (this.gameObject.name.CompareTo("JudgementLine1") == 0) //{ // KeyboardKey = KeyCode.A; // line_num = 0; //} //else if (this.gameObject.name.CompareTo("JudgementLine2") == 0) //{ // KeyboardKey = KeyCode.S; // line_num = 1; //} //else if (this.gameObject.name.CompareTo("JudgementLine3") == 0) //{ // KeyboardKey = KeyCode.D; // line_num = 2; //} //else if (this.gameObject.name.CompareTo("JudgementLine4") == 0) //{ // KeyboardKey = KeyCode.F; // line_num = 3; //} //else if (this.gameObject.name.CompareTo("JudgementLine5") == 0) //{ // KeyboardKey = KeyCode.G; // line_num = 4; //} }
// Start is called before the first frame update void Start() { bmsLoader = FindObjectOfType <BmsLoader>(); }