Exemplo n.º 1
0
 // Update is called once per frame
 void Update()
 {
     if ((TechAnimation.isDone == 5) && !startFade)
     {
         startFade = true;
         fadeIn.StartCoroutine("OpenWindow", 1f);
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Fade with complete control over all features. To instantly jump to the startAlpha value before any delay begins, set jumpToStartAlpha to true - this is useful for a delayed scene fade in from black.
    /// </summary>
    /// <param name='color'>
    /// Color.
    /// </param>
    /// <param name='startAlpha'>
    /// Start alpha.
    /// </param>
    /// <param name='endAlpha'>
    /// End alpha.
    /// </param>
    /// <param name='duration'>
    /// Duration.
    /// </param>
    /// <param name='delay'>
    /// Delay.
    /// </param>
    /// <param name='jumpToStartAlpha'>
    /// Jump to start alpha.
    /// </param>
    public static void Fade(Color color, float startAlpha, float endAlpha, float duration, float delay, bool jumpToStartAlpha, System.Action onComplete = null)
    {
        CheckInstance();
        ChangeColor(color, false);

        startColor   = baseColor;
        startColor.a = startAlpha;

        endColor   = baseColor;
        endColor.a = endAlpha;

        if (jumpToStartAlpha)
        {
            currentColor.a = startAlpha;
        }

        _instance.StopAllCoroutines();
        _instance.StartCoroutine(_instance.DoFade(duration, delay, onComplete));
    }
Exemplo n.º 3
0
 // Use this for initialization
 void Start()
 {
     fadeIn = GetComponent <ScreenFade>();
     fadeIn.StartCoroutine("CloseWindow");
 }