Exemplo n.º 1
0
    private void CreateStemPlayheads()
    {
        if (_song == null)
        {
            return;
        }

        _stemPlayheads = new StemPlayhead[1 + _song.Stems.Length]; // main stem at index 0

        // Create playheads from stems
        if (_song.MainStem != null)
        {
            _stemPlayheads[0] = new StemPlayhead(this, _song.MainStem);
        }
        else
        {
            Debug.LogWarning("[Playhead] Main stem is not set");
        }
        for (int i = 0; i < _song.Stems.Length; ++i)
        {
            if (_song.Stems[i] != null)
            {
                _stemPlayheads[1 + i] = new StemPlayhead(this, _song.Stems[i]);
            }
        }
    }
Exemplo n.º 2
0
        private void OnNote(StemPlayhead playhead, int beat, int subdiv)
        {
            // Set the text to the name of the stem and scale the transform on each note
            _stemText.text            = playhead.Stem.name;
            _noteTransform.localScale = Vector3.one * 1.5f;

//            var color = Color.HSVToRGB(Random.value, 1, 1);
//            _noteTransform.GetComponent<Renderer>().material.color = color;
        }