private void Shake() { if (m_currentDuration < m_activeScreenShakeData.Duration) { if (m_activeScreenShakeData.ShakeType == ScreenShakeType.SET) { m_cinemachinePerlinChannel.m_FrequencyGain = m_activeScreenShakeData.Frequency; m_cinemachinePerlinChannel.m_AmplitudeGain = m_activeScreenShakeData.Amplitude; } else { if (m_cinemachinePerlinChannel.m_FrequencyGain < m_activeScreenShakeData.MaxFrequency) { m_cinemachinePerlinChannel.m_FrequencyGain += m_activeScreenShakeData.Frequency; } if (m_cinemachinePerlinChannel.m_AmplitudeGain < m_activeScreenShakeData.MaxAmplitude) { m_cinemachinePerlinChannel.m_AmplitudeGain += m_activeScreenShakeData.Amplitude; } } m_currentDuration += Time.deltaTime; } else { m_currentDuration = 0; m_activeScreenShakeData = null; } }
private void StartScreenShake(ScreenShakeData p_data) { m_activeScreenShakeData = p_data; }