コード例 #1
0
 private void SpawnBySpike()
 {
     bool[] spike = JAudioAnalysis_simpleSmooth.Instance().SpikeSpectrum;
     for (int idx = 0; idx < spike.Length; ++idx)
     {
         if (spike[idx])
         {
             float x = Mathf.Log(idx + 1);
             InstantiateEnemy(0, false, x / m_maxX);
         }
     }
 }
コード例 #2
0
    private void DebugDrawSpike()
    {
        bool[] spike = JAudioAnalysis_simpleSmooth.Instance().SpikeSpectrum;
        WAudioAnalysis.CacheAndSmoothWithCheck[] spec = JAudioAnalysis_simpleSmooth.Instance().m_spectrumSmoother;
        int draw_enemy_idx = 0;

        for (int i = 1; i < spike.Length - 1; i++)
        {
            float log_i = Mathf.Log(i + 1);
            Color color = Color.red;
            while (m_enemyParam[draw_enemy_idx].width < log_i / m_maxX)
            {
                ++draw_enemy_idx;
                color = Color.green;
            }

            float x = 1.5f;
            Debug.DrawLine(new Vector3(Mathf.Log(i - 1) * x, spike[i - 1] ? -4 : -5, -2), new Vector3(Mathf.Log(i) * x, spike[i - 1] ? -4 : -5, -2), color);

            Debug.DrawLine(new Vector3(Mathf.Log(i - 1) * x, spec[i - 1].result, -2), new Vector3(Mathf.Log(i) * x, spec[i - 1].result, -2), color);
        }
    }