Exemplo n.º 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;
        }
    }
Exemplo n.º 2
0
 public void End()
 {
     //Handheld.Vibrate ();
     SoundFadeMaster.FadeSound(interactionLoopAudioSource, 3, true);
     SoundFadeMaster.FadeSound(idleSpeakAudioSource, 3, true);
     Toolbox.FindRequiredComponent <GameMaster> ().StartCoroutine(WaitForGraphicsFade());
 }
Exemplo n.º 3
0
    public void BeginStory()
    {
        story.Initiate();
        background.SetActive(true);
        isPlaying = true;

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

        if (segmentTimer >= (shouldPlayWin? winTimeOut:loseTimeOut) - 3)
        {
            SoundFadeMaster.FadeSound(introAudioSource, 3, true);
            OnSegmentCompleted();
            Clear();
        }
    }
Exemplo n.º 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();
        }
    }
Exemplo n.º 6
0
    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);
    }
Exemplo n.º 7
0
 public override void Skip()
 {
     SoundFadeMaster.FadeSound(introAudioSource, 3, true);
     OnSegmentCompleted();
     Clear();
 }
Exemplo n.º 8
0
 public override void Skip()
 {
     SoundFadeMaster.FadeSound(introAudioSource, 3, true);
     Toolbox.FindRequiredComponent <GameMaster> ().StartCoroutine(WaitForGraphicsFade());
     OnSegmentCompleted();
 }