Beispiel #1
0
 // Update is called once per frame
 void Update()
 {
     if (currentCooldown > 0)
     {
         currentCooldown += Time.deltaTime;
         if (currentCooldown > cooldown)
         {
             currentCooldown = 0;
         }
     }
     timeAlive += Time.deltaTime;
     if (!BeatMap.IsRunning())
     {
         return;
     }
     if (gameObject.activeSelf)
     {
         if (!BeatMap.IsRewinding)
         {
             transform.position += (transform.forward * noteSpeed) * Time.deltaTime;
         }
         else
         {
             transform.position -= (transform.forward * noteSpeed) * Time.deltaTime;
         }
     }
 }
Beispiel #2
0
 private void Update()
 {
     if (!initialized)
     {
         return;
     }
     if (IsGrabbed())
     {
         if (transform.position.z > MAX_Z)
         {
             Vector3 newPosition = transform.position;
             newPosition.z      = MAX_Z;
             transform.position = newPosition;
         }
         else if (transform.position.z < MIN_Z)
         {
             Vector3 newPosition = transform.position;
             newPosition.z      = MIN_Z;
             transform.position = newPosition;
         }
         float relativeBeat = totalBeats - (transform.position.z / zPerBeat) - 45;
         relativeBeat = BeatMap.RoundToRelativeBeat(relativeBeat, BeatMap.currentNoteMode);
         currentTimeBar.GetComponentInChildren <Text>().text = (relativeBeat * totalBeats).ToString();
     }
     else
     {
         currentTimeBar.GetComponentInChildren <Text>().text = BeatMap.GetMostRecentBeat.ToString();
     }
     if (BeatMap.IsRunning())
     {
         //Debug.Log("Current Beat - " + BeatMap.GetCurrentBeat() + " current Z - "
         //+ transform.position.z + " ZDiff - " + (MAX_Z-transform.position.z));
         Vector3 newPosition = transform.position;
         newPosition.z      = MAX_Z - (zPerBeat * BeatMap.GetCurrentBeat());
         transform.position = newPosition;
     }
     if (changes.Count > 0)
     {
         //Debug.LogWarning("Changes detected - " + changes.Count);
         foreach (NoteDetails change in changes)
         {
             littleNoteMap[change].GetComponent <MeshRenderer>().enabled =
                 !littleNoteMap[change].GetComponent <MeshRenderer>().enabled;
             Debug.LogWarning("Meshrendered inverted on game object " + littleNoteMap[change].name);
         }
         changes = new List <NoteDetails>();
     }
 }
Beispiel #3
0
 private void Start()
 {
     currentCooldown = 0;
     meshRenderer    = GetComponent <MeshRenderer>();
     if (thisControl == Controls.PAUSE)
     {
         if (BeatMap.IsRunning())
         {
             meshRenderer.enabled = true;
         }
         else
         {
             meshRenderer.enabled = false;
         }
     }
 }
Beispiel #4
0
 // Update is called once per frame
 void Update()
 {
     if (!textInitalized)
     {
         Initialize();
     }
     if (!BeatMap.IsRunning())
     {
         return;
     }
     if (gameObject.activeSelf)
     {
         if (!BeatMap.IsRewinding)
         {
             transform.position += (transform.forward * Note.noteSpeed) * Time.deltaTime;
         }
         else
         {
             transform.position -= (transform.forward * Note.noteSpeed) * Time.deltaTime;
         }
     }
 }
Beispiel #5
0
 private void Update()
 {
     if (currentCooldown > 0)
     {
         currentCooldown += Time.deltaTime;
     }
     if (currentCooldown > cooldown)
     {
         currentCooldown = 0;
     }
     if (thisControl == Controls.PAUSE)
     {
         if (BeatMap.IsRunning() && !meshRenderer.enabled)
         {
             meshRenderer.enabled = true;
         }
         else if (!BeatMap.IsRunning() && meshRenderer.enabled)
         {
             meshRenderer.enabled = false;
         }
     }
 }