Notes InitNotes(MusicNote musicNote) //ノーツの初期化 { var Note = Instantiate(NoteObj, NoteArea.transform); var NoteScript = Note.GetComponent <Notes>(); //ノーツのスクリプトを読み込む NoteScript.Score = new MusicNote() { NoteType = Rest }; NoteScript.TapID = -1; NoteScript.Speed = GameManager4.SetSpeed(Settings.NotesSpeed); //ノーツのスピード NoteScript.TargetString = Astring; //ノーツの降る弦を取得する NoteScript.TargetPosition = new Vector2(-3200 + 1600f / 12 * 7, 70 + 75); //ノーツのターゲット位置を取得する NoteScript.StartPosition = new Vector2(700, 250 + 75); Note.GetComponent <RectTransform>().anchoredPosition = NoteScript.StartPosition; //ノーツのスタートする位置を設定する NoteScript.Score = musicNote; //ノーツの種類 NoteScript.Size = Settings.Size; var effect = Instantiate(JudgeEffect, EffectArea.transform); NoteScript.Effect = effect.GetComponent <JudgeEffect>(); if (Settings.ShowScale) { effect.GetComponentInChildren <Text>().text = GameManager4.Pitches[(int)musicNote.PitchStep][musicNote.Alter + 1]; } else { effect.GetComponentInChildren <Text>().enabled = false; } NoteScript.PlayingAuto = true; NoteScript.Judge = Judge; effect.GetComponent <RectTransform>().anchoredPosition = NoteScript.TargetPosition + Vector2.up * 50; return(NoteScript); }
protected virtual void Start() { Count = 0; CounterText = gameObject.GetComponent <Text>(); CounterText.text = "0"; GameManager = GameObject.Find("GameManager").GetComponent <GameManager4>(); MusicData = GameManager.Result.MusicData; }
private void Awake() { manager4 = this; }
//Finding GameManager private void Awake() { gameManager = GameObject.FindGameObjectWithTag("GameManager"); gmScript = gameManager.GetComponent <GameManager4>(); first = true; }