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

            UpdatePosition();
        }
Пример #2
0
    void Start()
    {
        //Find the animator for the dancing man.
        this.animationTarget = GameObject.FindObjectOfType <Animator>();

        InitializeLeadIn();

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

        // Initialize events.
        playingKoreo = Koreographer.Instance.GetKoreographyAtIndex(0);
        // Grab all the events out of the Koreography.
        KoreographyTrackBase    rhythmTrack = playingKoreo.GetTrackByID(eventID);
        List <KoreographyEvent> rawEvents   = rhythmTrack.GetAllEvents();

        InitializeMetronomeIfPresent(rawEvents);
        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)
            {
                LaneControllerBeatInfinity 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;
 }