public override void OnInspectorGUI()
        {
            serializedObject.Update();

            SerializedProperty prop = serializedObject.FindProperty("m_handleRepeatedAudio");

            EditorGUILayout.PropertyField(prop);
            WingroveGroupInformation wgi = (WingroveGroupInformation)target;
            float timeTilFinished        = wgi.GetTimeUntilFinished();

            if (timeTilFinished == float.MaxValue)
            {
                GUILayout.Label("Time until finished: float.maxValue -- looping sounds");
            }
            else
            {
                if (timeTilFinished == -1)
                {
                    GUILayout.Label(System.String.Format("Time until finished {0:00.00} -- looping sounds", timeTilFinished));
                }
                else
                {
                    GUILayout.Label(System.String.Format("Time until finished {0:00.00}", wgi.GetTimeUntilFinished()));
                }
            }
            GUILayout.Label(wgi.IsAnyPlaying() ? "Active" : "Inactive");



            serializedObject.ApplyModifiedProperties();

            Repaint();
        }
 public float GetTimeUntilFinished(WingroveGroupInformation.HandleRepeatingAudio handleRepeats)
 {
     float result = 0.0f;
     foreach (ActiveCue cue in m_currentActiveCues)
     {
         result = Mathf.Max(cue.GetTimeUntilFinished(handleRepeats), result);
     }
     return result;
 }
 public float GetTimeUntilFinished(WingroveGroupInformation.HandleRepeatingAudio handleRepeat)
 {
     float timeRemaining =
         (m_audioClipSource.GetAudioClip().samples - m_currentPosition) /
         (float)(m_audioClipSource.GetAudioClip().frequency * GetMixPitch());
     if (m_audioClipSource.GetLooping())
     {
         switch(handleRepeat)
         {
             case WingroveGroupInformation.HandleRepeatingAudio.IgnoreRepeatingAudio:
                 timeRemaining = 0.0f;
                 break;
             case WingroveGroupInformation.HandleRepeatingAudio.ReturnFloatMax:
             case WingroveGroupInformation.HandleRepeatingAudio.ReturnNegativeOne:
                 timeRemaining = float.MaxValue;
                 break;
             case WingroveGroupInformation.HandleRepeatingAudio.GiveTimeUntilLoop:
             default:
                 break;
         }
     }
     if (m_currentState == CueState.PlayingFadeOut)
     {
         if (m_fadeSpeed != 0)
         {
             timeRemaining = Mathf.Min(m_fadeT / m_fadeSpeed, timeRemaining);
         }
     }
     return timeRemaining;
 }