Exemple #1
0
 protected virtual void OnReceiveRhythm(int _value)
 {
     if (_value % m_syncFrequency == 0)
     {
         if (m_isAffected && m_affector != null)
         {
             if (m_affector.GetMultiplier() > 0)
             {
                 Action();
             }
         }
         else
         {
             Action();
         }
     }
 }
    // Update is called once per frame
    void Update()
    {
        switch (m_syncType)
        {
        case Enums.SyncType.Bar:                m_tmp = m_audioManager.GetCurrentBarTime();             break;

        case Enums.SyncType.Beat:               m_tmp = m_audioManager.GetCurrentBeatTime();    break;

        case Enums.SyncType.SubBeat:    m_tmp = m_audioManager.GetCurrentSubBeatTime(); break;
        }

        m_tmp = m_tmp - (int)m_tmp;

        if (m_isAffected && m_affector != null)
        {
            Action(m_curve.Evaluate(m_tmp) * m_affector.GetMultiplier());
        }
        else
        {
            Action(m_curve.Evaluate(m_tmp));
        }
    }