public void Refresh() { if (noteDetails.inverted != BeatMap.Inverted) { meshRenderer.enabled = false; InfoDisplay display = GetComponent <InfoDisplay>(); if (display != null) { display.gameObject.SetActive(false); } } else { meshRenderer.enabled = true; InfoDisplay display = GetComponent <InfoDisplay>(); if (display != null) { display.gameObject.SetActive(true); } } Material newMaterial = new Material(materials[BeatSaberJSONClass. BSNote.GetBSaberCutDirection(noteDetails.slashDirection)]); Color newColor = GetNoteColor(noteDetails.color); newMaterial.color = newColor; meshRenderer.material = newMaterial; InfoDisplay infoDisplay = GetComponentInChildren <InfoDisplay>(); if (infoDisplay != null) { infoDisplay.Refresh(); } }
private void Initialize() { infoDisplay = GetComponentInChildren <InfoDisplay>(); if (infoDisplay == null) { Debug.LogError("InfoDisplay not present"); } infoDisplay.SetText(beatNumber.ToString()); textInitalized = true; }
private void Start() { infoDisplay = GetComponentInChildren <InfoDisplay>(); }