Beispiel #1
0
    public override void Play()
    {
        segmentTimer = 0f;

        introAudioSource        = Camera.main.gameObject.AddComponent <AudioSource> ();
        introAudioSource.volume = 1f;
        introAudioSource.clip   = audioSegment.masterSoundClip;
        introAudioSource.time   = startDelay;
        introAudioSource.Play();
        introAudioSource.loop = false;

        audioSegment.segmentLength = audioSegment.masterSoundClip.length;

        SoundFadeMaster.FadeSound(introAudioSource, 3f, false);

        graphicsObject = Instantiate(audioSegment.UIGraphics, GameObject.FindGameObjectWithTag("GameController").transform);
        graphicsObject.GetComponent <RectTransform>().offsetMax = Toolbox.Instance.rt.offsetMax;
        graphicsObject.GetComponent <RectTransform>().offsetMin = Toolbox.Instance.rt.offsetMin;
        graphicsObject.transform.localScale = Vector3.one;

        GameObject audioObject = new GameObject("Interaction Sound", typeof(AudioSource));

        Destroy(audioObject, 5f + promptDelay);

        if (interactionSound != null)
        {
            AudioSource audioSource = audioObject.GetComponent <AudioSource> ();
            audioSource.volume = 1f;
            audioSource.clip   = interactionSound;
            audioSource.time   = startDelay;
            audioSource.PlayDelayed(promptDelay);
            audioSource.loop = false;
        }
    }
 public void End()
 {
     //Handheld.Vibrate ();
     SoundFadeMaster.FadeSound(interactionLoopAudioSource, 3, true);
     SoundFadeMaster.FadeSound(idleSpeakAudioSource, 3, true);
     Toolbox.FindRequiredComponent <GameMaster> ().StartCoroutine(WaitForGraphicsFade());
 }
    public void BeginStory()
    {
        story.Initiate();
        background.SetActive(true);
        isPlaying = true;

        SoundFadeMaster.FadeSound(myAudioSource, 3f, true);
    }
    public override void Update()
    {
        segmentTimer += Time.deltaTime;

        if (segmentTimer >= (shouldPlayWin? winTimeOut:loseTimeOut) - 3)
        {
            SoundFadeMaster.FadeSound(introAudioSource, 3, true);
            OnSegmentCompleted();
            Clear();
        }
    }
Beispiel #5
0
    public override void Update()
    {
        segmentTimer += Time.deltaTime;

        graphicsObject.transform.localScale = Vector3.one * (1 + ((segmentTimer / audioSegment.segmentLength) * scaleModifier));

        if (segmentTimer >= audioSegment.segmentLength - 3)
        {
            SoundFadeMaster.FadeSound(introAudioSource, 3, true);
            Toolbox.FindRequiredComponent <GameMaster> ().StartCoroutine(WaitForGraphicsFade());
            OnSegmentCompleted();
        }
    }
    public void Initialize()
    {
        idleSpeakTimer      = 0f;
        hasPlayedIdleSpeak  = false;
        hasMoreSoundsToPlay = true;

        interactionLoopAudioSource        = Camera.main.gameObject.AddComponent <AudioSource> ();
        interactionLoopAudioSource.volume = 1f;
        interactionLoopAudioSource.clip   = interactionLoopSound;
        interactionLoopAudioSource.Play();
        interactionLoopAudioSource.loop = true;
        SoundFadeMaster.FadeSound(interactionLoopAudioSource, 0.5f, false);

        idleSpeakAudioSource = Camera.main.gameObject.AddComponent <AudioSource> ();
        interactionLoopAudioSource.volume = 1f;
        idleSpeakAudioSource.clip         = idleSpeak1;
        idleSpeakAudioSource.Stop();
        idleSpeakAudioSource.loop = false;
        SoundFadeMaster.FadeSound(idleSpeakAudioSource, 0.5f, false);
    }
 public override void Skip()
 {
     SoundFadeMaster.FadeSound(introAudioSource, 3, true);
     OnSegmentCompleted();
     Clear();
 }
Beispiel #8
0
 public override void Skip()
 {
     SoundFadeMaster.FadeSound(introAudioSource, 3, true);
     Toolbox.FindRequiredComponent <GameMaster> ().StartCoroutine(WaitForGraphicsFade());
     OnSegmentCompleted();
 }