Пример #1
0
        void LayoutTune()
        {
            if (tune == null)
            {
                return;
            }

            notes       = new NoteCreator(cache);
            cache.color = color;

            timeSignature = GetTimeSignature();

            Vector3 scale = this.gameObject.transform.localScale;

            this.gameObject.transform.localScale = Vector3.one;

            beams = Beam.CreateBeams(tune);
            SetupVoiceLayouts();

            scoreContainer = new GameObject("Score");
            scoreContainer.transform.parent        = this.transform;
            scoreContainer.transform.localPosition = Vector3.zero;

            PrepareScoreLines();

            for (int i = 0; i < layouts[0].scoreLines.Count; i++)
            {
                PositionScoreLine(i);
            }

            scoreContainer.transform.localScale  = new Vector3(layoutScale, layoutScale, layoutScale);
            this.gameObject.transform.localScale = scale;
        }
Пример #2
0
        public CustomStaff(GameObject parent, SpriteAtlas spriteAtlas, TextMeshPro textPrefab)
        {
            var staffContainer = new GameObject("Custom Staff");

            staffContainer.transform.parent        = parent.transform;
            staffContainer.transform.localPosition = Vector3.zero;
            this.container = staffContainer;

            cache = new SpriteCache(spriteAtlas, textPrefab);
            notes = new NoteCreator(cache);
        }