コード例 #1
0
 /**
  * Changes the position of the mesh's verticies
  * Perlin function will be replaced when audio analysis is done
  * */
 private void DetermineMovement(int columns, int rows)
 {
     if (analysis.source.isPlaying)
     {
         speed = analysis.GetComponent <RhythmTool>().pitch;
         verticies[columns].z = 5 * Mathf.PerlinNoise(Time.time / speed + (verticies[columns].x + this.gameObject.transform.position.x) / detailAmount, //Replace the Mathf.Perlin with data collected from AudioSource
                                                      Time.time / speed + (verticies[columns].y + this.gameObject.transform.position.y) / detailAmount) * frequency;
         verticies[columns].z -= rows;
     }
     else
     {
         verticies[columns].z = Mathf.Lerp(verticies[columns].z, defaultVerticies[columns].z, 1f);
     }
 }