// Prepares the Note Object for use.
        public void Initialize(KoreographyEvent evt, Color color, LaneController laneCont, RhythmGameController gameCont)
        {
            trackedEvent   = evt;
            visuals.color  = color;
            laneController = laneCont;
            gameController = gameCont;

            UpdatePosition();
        }
Beispiel #2
0
        void Start()
        {
            InitializeLeadIn();

            // Initialize all the Lanes.
            for (int i = 0; i < noteLanes.Count; ++i)
            {
                noteLanes[i].Initialize(this);
            }
            Debug.Log(noteLanes.Count);//6

            // Initialize events.
            playingKoreo = Koreographer.Instance.GetKoreographyAtIndex(0);

            // Grab all the events out of the Koreography.
            KoreographyTrack        rhythmTrack = playingKoreo.GetTrackByID(eventID);
            List <KoreographyEvent> rawEvents   = rhythmTrack.GetAllEvents();

            for (int i = 0; i < rawEvents.Count; ++i)
            {
                KoreographyEvent evt     = rawEvents[i];
                string           payload = evt.GetTextValue();

                // Find the right lane.
                for (int j = 0; j < noteLanes.Count; ++j)
                {
                    LaneController lane = noteLanes[j];
                    if (lane.DoesMatchPayload(payload))
                    {
                        // Add the object for input tracking.
                        lane.AddEventToLane(evt);

                        // Break out of the lane searching loop.
                        break;
                    }
                }
            }
        }
 // Resets the Note Object to its default state.
 void Reset()
 {
     trackedEvent   = null;
     laneController = null;
     gameController = null;
 }