Example #1
0
 public void UpdatePosition(ref SoundSystem.SoundHandle sh, Vector3 position)
 {
     if (!IsValid(ref sh))
     {
         GameDebug.LogWarning("Trying to reposition invalid soundhandle");
         return;
     }
     m_Emitters[sh.emitter_idx].source.transform.position = position;
 }
Example #2
0
 void Start()
 {
     // TODO (petera) remove if once we get null soundsystem. Headless check needed
     // for headless clients
     if (!Game.IsHeadless())
     {
         handle = Game.SoundSystem.Play(sound);
     }
 }
Example #3
0
    public void Stop(SoundSystem.SoundHandle sh, float fadeOutTime = 0.0f)
    {
        if (!IsValid(ref sh))
        {
            GameDebug.LogWarning("SoundSystem.Stop(): invalid SoundHandle");
            return;
        }
        var emitter = m_Emitters[sh.emitter_idx];

        if (fadeOutTime == 0.0f)
        {
            emitter.fadeToKill.SetValue(0.0f);
        }
        else
        {
            emitter.fadeToKill.SetValue(1.0f);
            emitter.fadeToKill.MoveTo(0.0f, fadeOutTime);
        }
    }
Example #4
0
    public void SetVisible(bool isVisible)
    {
        var newVal = isVisible ? 1 : 0;

        if (m_isVisible != -1 && newVal == m_isVisible)
        {
            return;
        }
        m_isVisible = newVal;

        if (shellRoot != null)
        {
            shellRoot.SetActive(isVisible);
        }

        if (trailRoot != null)
        {
            if (isVisible)
            {
                StartAllEffects(trailRoot);
            }
            else
            {
                StopAllEffects(trailRoot);
            }
        }

        if (thrustSound && isVisible)
        {
            m_ThrustSoundHandle = Game.SoundSystem.Play(thrustSound, gameObject.transform);
        }
        else if (m_ThrustSoundHandle.IsValid() && !isVisible)
        {
            Game.SoundSystem.Stop(m_ThrustSoundHandle);
        }

        var lights = GetComponentsInChildren <Light>();

        foreach (var light in lights)
        {
            light.enabled = isVisible;
        }
    }
Example #5
0
 public bool IsValid(ref SoundSystem.SoundHandle handle)
 {
     return(false);
 }
Example #6
0
 public bool IsValid(ref SoundSystem.SoundHandle handle)
 {
     return(m_Emitters[handle.emitter_idx] != null && m_Emitters[handle.emitter_idx].seqId == handle.seq);
 }
Example #7
0
 public void UpdatePosition(ref SoundSystem.SoundHandle handle, Vector3 position)
 {
 }
Example #8
0
 public void Stop(SoundSystem.SoundHandle sh, float fadeOutTime = 0)
 {
 }