Ejemplo n.º 1
0
 public void Play()
 {
     if (!FmodEvent.IsPlaying(musicInstance))
     {
         musicInstance = FmodEvent.Play(music, gameObject.transform, null);
     }
 }
Ejemplo n.º 2
0
    private void OnEnable()
    {
        listenerGameObject = FindObjectOfType <StudioListener>();


        if (listenerGameObject != null)
        {
            m_targetTransform = listenerGameObject.transform;
        }
        else
        {
            Debug.LogError(this + ": No GameObject with 'Studio Listener' Component found! Aborting.");
            enabled = false;
        }

        _instance = FmodEvent.Play(eventToPlay, m_eventEmitter.transform, null);

        positionClamperRoutine = ClampEmitterPosition();
        StartCoroutine(positionClamperRoutine);
    }