Example #1
0
        GameObject AddFirstCar(Note n)
        {
            GameObject target;

            if (n.length > 1 || isInEditing)
            {
                target = Instantiate(locomotive, spawnPoint);
            }
            else
            {
                if (n.note == "speed")
                {
                    target = Instantiate(speedUp, spawnPoint);
                }
                else if (n.note == "slow")
                {
                    target = Instantiate(slowDown, spawnPoint);
                }
                else
                {
                    target = Instantiate(only, spawnPoint);
                }
            }
            firstCar = target;
            NoteView view = target.AddComponent <NoteView>();

            noteViews.Add(view);
            view.note      = n;
            view.inEditing = isInEditing;
            if (editor)
            {
                view.editor = editor;
            }
            return(target);
        }
Example #2
0
 public Press(NoteView view, GameObject target, TrackButtonGlow buttonGlow)
 {
     this.note       = view.GetNote();
     this.noteView   = view;
     this.target     = target;
     this.buttonGlow = buttonGlow;
     targetTime      = note.length / Player.songSpeed;
 }
Example #3
0
 public void UpdatePress(GameObject car, NoteView view)
 {
     if (currentPress != null)
     {
         previousPress = currentPress;
     }
     view.SetupProgression();
     currentPress = new Press(view, car, buttonGlow);
     hasExited    = false;
 }
Example #4
0
        void OnTriggerEnter(Collider col)
        {
            Debug.Log("Entered");
            Note     note = null;
            NoteView view = col.gameObject.GetComponent <NoteView>();

            if (view != null)
            {
                note = col.gameObject.GetComponent <NoteView>().GetNote();
            }
            else if (col.gameObject.GetComponent <MoveCarUp>() != null)
            {
                col.gameObject.GetComponent <MoveCarUp>().LiftCar();
            }

            if (view != null && (col.tag == "First" || col.tag == "Only"))
            {
                Debug.Log("Change Press");
                trackPlayer.UpdatePress(col.gameObject, view);
            }
        }