Example #1
0
 public IEnumerator FadeIn(float fadeTime)
 {
     pulser.enabled      = false;
     button.interactable = true;
     alphaTween.Tween(0, 1, fadeTime);
     positionTween.Tween(rectTransform.anchoredPosition + new Vector2(0, -20), rectTransform.anchoredPosition, fadeTime, new AnimationCurve(new Keyframe[] { new Keyframe(0, 0, 3.14f, 3.14f), new Keyframe(1, 1, 0, 0) }));
     while (alphaTween.tweening || positionTween.tweening)
     {
         if (alphaTween.tweening)
         {
             alphaTween.Loop();
         }
         if (positionTween.tweening)
         {
             positionTween.Loop();
         }
         yield return(null);
     }
     pulser.enabled = true;
 }
 IEnumerator BloomOut(float fadeTime)
 {
     bloomTween.Tween(0f, 1f, fadeTime);
     while (bloomTween.tweening)
     {
         if (bloomTween.tweening)
         {
             bloomTween.Loop();
         }
         yield return(null);
     }
 }
    public IEnumerator FadeButton(Text fadeText, float fadeTime, bool fadeIn)
    {
        FloatTween alphaTween = new FloatTween();
        Button     button     = fadeText.GetComponent <Button>();

        if (fadeIn)
        {
            alphaTween.Tween(0, 1, fadeTime);
            fadeText.gameObject.SetActive(true);
        }
        else
        {
            button.interactable = false;
            alphaTween.Tween(1, 0, fadeTime);
        }
        while (alphaTween.tweening)
        {
            fadeText.color = new Color(fadeText.color.r, fadeText.color.g, fadeText.color.b, alphaTween.currentValue);
            alphaTween.Loop();
            yield return(null);
        }
    }
Example #4
0
 IEnumerator FadeIn(float fadeTime)
 {
     alphaTween.Tween(0, 1, fadeTime);
     while (alphaTween.tweening)
     {
         Debug.Log("fading");
         if (alphaTween.tweening)
         {
             alphaTween.Loop();
         }
         yield return(null);
     }
     Debug.Log("fade done");
 }
 IEnumerator GlowIn(float fadeTime)
 {
     Main.Instance.gameState.contentManager.shadowImage.gameObject.SetActive(false);
     Main.Instance.gameState.contentManager.paperImage.material = new Material(glowMaterial);
     glowTween.Tween(2.2f, 1.2f, fadeTime);
     while (glowTween.tweening)
     {
         if (glowTween.tweening)
         {
             glowTween.Loop();
         }
         yield return(null);
     }
 }
 IEnumerator BloomDown(float fadeTime)
 {
     bloomTween.Tween(0f, 1.0f, fadeTime);
     while (bloomTween.tweening)
     {
         if (bloomTween.tweening)
         {
             bloomTween.Loop();
         }
         yield return(null);
     }
     Main.Instance.gameState.contentManager.paperImage.material = null;
     Main.Instance.gameState.contentManager.shadowImage.gameObject.SetActive(true);
     bloom.intensity.value = startIntensity;
 }
    // Just fade in from black
    private IEnumerator DoShortIntro()
    {
        yield return(new WaitForSeconds(0.5f));

        AudioClipDatabase.Instance.PlayAttachingPaperSound();
        yield return(new WaitForSeconds(1));

        FloatTween opacityTween = new FloatTween();

        opacityTween.Tween(1, 0, 5);
        while (opacityTween.tweening)
        {
            opacityTween.Loop();
            group.alpha = opacityTween.currentValue;
            if (Main.Instance.currentState == this && opacityTween.tweenTimer.GetNormalizedTime() > 0.45f)
            {
                Complete();
            }
            yield return(null);
        }
    }
 public void FadeIn()
 {
     alphaTween.Tween(canvasGroup.alpha, 1, 0.4f, AnimationCurve.EaseInOut(0, 0, 1, 1));
 }
    private IEnumerator FadeBetweenMeetings(string meetingName, Boolean ending = false)
    {
        CanvasGroup fadeCanvasGroup = Main.Instance.introState.group;

        fadeCanvasGroup.gameObject.SetActive(true);
        fadeCanvasGroup.alpha          = 0;
        fadeCanvasGroup.interactable   = true;
        fadeCanvasGroup.blocksRaycasts = true;

        Main.Instance.introState.inklePresentsText.gameObject.SetActive(false);
        Main.Instance.introState.theInterceptText.gameObject.SetActive(false);

        FloatTween fadeOutTween = new FloatTween();

        fadeOutTween.Tween(0, 1, 2);
        while (fadeOutTween.tweening)
        {
            fadeOutTween.Loop();
            if (fadeOutTween.currentValue > fadeCanvasGroup.alpha)
            {
                fadeCanvasGroup.alpha = fadeOutTween.currentValue;
            }
            yield return(null);
        }
        fadeCanvasGroup.alpha = 1;
        yield return(new WaitForSeconds(1.0f));

        currentPage.gameObject.SetActive(false);
        story.ChoosePathString(meetingName);

        Material oldPageMaterial = contentManager.paperImage.material;

        if (!ending)
        {
            currentPage = GameObject.Instantiate <Transform>(pagePrefab, GameObject.Find("Game Canvas").transform, false);
        }
        else
        {
            currentPage = GameObject.Instantiate <Transform>(policePagePrefab, GameObject.Find("Game Canvas").transform, false);
            GameObject.Find("Background").SetActive(false);
            GameObject.Find("DateTime").SetActive(false);
            GameObject.Find("TopBar").SetActive(false);
        }
        currentPage.transform.SetSiblingIndex(2);
        contentManager = currentPage.GetComponentInChildren <ContentManager>();
        contentParent  = contentManager.layoutGroup.transform;
        StartCoroutine(OnAdvanceStory());

        if (oldPageMaterial && !ending)
        {                                                           // If the page is glowing
            contentManager.paperImage.material = oldPageMaterial;
            contentManager.shadowImage.gameObject.SetActive(false); // hide page shadow if the page is glowing
        }

        if (meetingName.Equals("meetingthree"))
        {
            Debug.Log("Meeting Three");
            AudioClipDatabase.Instance.spooky = true;
            FindObjectOfType <BackgroundAmbienceController>().QuietMode();
            GameObject.Find("PactAudio").GetComponent <AudioSource>().Play();
        }

        FloatTween fadeInTween = new FloatTween();

        fadeInTween.Tween(1, 0, 2);
        while (fadeInTween.tweening)
        {
            fadeInTween.Loop();
            fadeCanvasGroup.alpha = fadeInTween.currentValue;
            yield return(null);
        }
        fadeCanvasGroup.interactable   = false;
        fadeCanvasGroup.blocksRaycasts = false;
    }
Example #10
0
 public void FadeIn()
 {
     alphaTween.Tween(0, 1, 5, AnimationCurve.EaseInOut(0, 0, 1, 1));
 }
Example #11
0
 public void Show()
 {
     canvasGroup.alpha = 0;
     alphaTween.Tween(canvasGroup.alpha, 1, 2, AnimationCurve.EaseInOut(0, 0, 1, 1));
     gameObject.SetActive(true);
 }
 public void QuietMode()
 {
     StopAllCoroutines();
     volumeTween.Tween(audioSource.volume, quietVolume, 1, AnimationCurve.EaseInOut(0, 0, 1, 1));
 }