Esempio n. 1
0
    public void setColors(Color a, Color t)
    {
        // Initialize colors from the GUI

        accentColor = a;

        textColor = t;

        Color contentColor = this.currentSelectionState == Selectable.SelectionState.Highlighted || this.currentSelectionState == Selectable.SelectionState.Pressed ? accentColor : textColor;

        if (icon == null)
        {
            icon = transform.Find("Icon").GetComponent <RawImage> ();
        }

        if (text == null)
        {
            text = GetComponentInChildren <Text> ();
        }

        icon.CrossFadeColor(contentColor, 0f, true, true);

        if (text)
        {
            text.CrossFadeColor(contentColor, 0f, true, true);
        }
    }
Esempio n. 2
0
    public void ToggleColor()
    {
        if (!toggled)
        {
            if (rawImage != null)
            {
                rawImage.CrossFadeColor(activeColor, fadeTime * 1.2f, false, true);
            }
            else if (image != null)
            {
                image.CrossFadeColor(activeColor, fadeTime * 1.2f, false, true);
            }

            toggled = true;
        }
        else if (toggled)
        {
            if (colorOnce)
            {
                return;
            }

            if (rawImage != null)
            {
                rawImage.CrossFadeColor(Color.white, fadeTime * 1.2f, false, true);
            }
            else if (image != null)
            {
                image.CrossFadeColor(Color.white, fadeTime * 1.2f, false, true);
            }

            toggled = false;
        }
    }
Esempio n. 3
0
    public IEnumerator IE_Flash()
    {
        image.color = new Color(image.color.r, image.color.g, image.color.b, 1);
        image.canvasRenderer.SetColor(redWash);
        image.CrossFadeAlpha(1, 0, true);
        whitewash.color = Color.white;
        whitewash.canvasRenderer.SetColor(Color.white);
        yield return(new WaitForSecondsRealtime(0.5f));

        whitewash.CrossFadeAlpha(0, 2f, true);
        image.CrossFadeAlpha(0.3f, 5f, true);
        yield return(new WaitForSecondsRealtime(2f));

        image.CrossFadeColor(Color.black, 2f, true, true);
        yield return(new WaitForSecondsRealtime(3f));

        DestroyProjectiles();
        Time.timeScale = 1;
        yield return(new WaitForSecondsRealtime(0.1f));

        image.CrossFadeColor(Color.clear, 0.15f, true, true);
        whitewash.CrossFadeColor(Color.clear, 0.15f, true, true);
        Reset();
        yield return(new WaitForSecondsRealtime(0.15f));

        image.canvasRenderer.SetColor(redWash);
        image.color = new Color(redWash.r, redWash.g, redWash.b, 0);
        whitewash.canvasRenderer.SetColor(Color.white);
        whitewash.color = new Color(1, 1, 1, 0);
    }
Esempio n. 4
0
 public void CrossFadeColor(Color targetColor, float duration, bool ignoreTimeScale, bool useAlpha)
 {
     if (null != _imgVideo)
     {
         _imgVideo.CrossFadeColor(targetColor, duration, ignoreTimeScale, useAlpha);
     }
 }
Esempio n. 5
0
 public void ShowGameOverPanel()
 {
     gameOverPanel.SetActive(true);
     if (IANTGame.GameType == "harvest")
     {
         harvestCakeCountText.text = IANTGame.Game.FoodFactory.TakenFoodCount.ToString();
     }
     isGameOver = true;
     backgroundImage.CrossFadeColor(new Color(0, 0, 0, 1), 3f, true, true);
 }
Esempio n. 6
0
        } //END CrossFade

        //-------------------------------------//
        private IEnumerator _CrossFade( RawImage image, float duration, float delay, Color changeToColor, Action onComplete )
        //-------------------------------------//
        {
            yield return new WaitForSeconds( delay );

            image.CrossFadeColor( changeToColor, duration, true, true );

            if( onComplete != null )
            {
                yield return new WaitForSeconds( duration );

                onComplete.Invoke();
            }

        } //END _CrossFade
Esempio n. 7
0
 void OnStart()
 {
     FadeInOut.CrossFadeColor(new Color(0f, 0f, 0f, 0f), 1f, true, true);
 }
Esempio n. 8
0
    public void fadeimage(int image)

    {
        background.CrossFadeColor(new Color(1, 1, 1, 0), time, false, true);
        LeanTween.delayedCall(gameObject, 1.0f, updateimage).setOnCompleteParam(image);
    }