Пример #1
0
 //Render all beats to the track
 void RenderBeats()
 {
     DestroyBeats();
     foreach (Beat b in track.beats)
     {
         Transform beat;
         Utils.CreateUIImage(beatPrefab, new Vector2(Utils.TransformToTimelinePos(b.time), 0), _beatParent, out beat);
         UIBeatManager bm = beat.GetComponent <UIBeatManager>();
         bm.Set(b, this);
         _beats.Add(bm);
     }
     UpdateBeats();
 }
Пример #2
0
        //Set the inital values of the Track
        public void Set(Track track)
        {
            instance       = gameObject;
            _left          = _beatParent.position.x;
            _image         = instance.GetComponent <Image>();
            this.track     = track;
            _image.color   = track.color;
            trackName.text = track.name;
            RenderBeats();

            Transform beat;

            Utils.CreateUIImage(beatPrefab, Vector2.zero, _beatParent, out beat);
            _prevBeat = beat.GetComponent <UIBeatManager>();
            _prevBeat.Set(new Beat(0f), this);
            beat.gameObject.SetActive(false);
        }