From 8b217496af5bf1da4758336296eb86d24d13a952 Mon Sep 17 00:00:00 2001 From: Steve Halliwell Date: Sun, 20 Jun 2021 17:27:21 +1000 Subject: [PATCH] Force new portrait in Show to undimmed Close #922 --- Assets/Fungus/Docs/CHANGELOG.txt | 1 + .../Fungus/Scripts/Components/PortraitController.cs | 12 +++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/Assets/Fungus/Docs/CHANGELOG.txt b/Assets/Fungus/Docs/CHANGELOG.txt index cbd3438f..31a08499 100644 --- a/Assets/Fungus/Docs/CHANGELOG.txt +++ b/Assets/Fungus/Docs/CHANGELOG.txt @@ -10,6 +10,7 @@ Unreleased - SetNextLineFlag only flags if Dialog is actually active/writing. Thanks to breadnone. - TextAdapter with TMPro, now forces mesh update on text change. Fixes cases where a Say/Writer would expect RevealedCharacters to be current but would be previous frame stale value. - Camera Fade clears local callback before execution, fixes #973. + - Force portraits undimmed on change sprite. ## Changed - Block will LogError when an exception is caught from a Command being Executed. diff --git a/Assets/Fungus/Scripts/Components/PortraitController.cs b/Assets/Fungus/Scripts/Components/PortraitController.cs index df1d9f9b..af70f066 100644 --- a/Assets/Fungus/Scripts/Components/PortraitController.cs +++ b/Assets/Fungus/Scripts/Components/PortraitController.cs @@ -438,7 +438,17 @@ namespace Fungus options.character.State.SetPortraitImageBySprite(options.portrait); options.character.State.portraitImage.rectTransform.gameObject.SetActive(true); - LeanTween.alpha(options.character.State.portraitImage.rectTransform, 1f, duration).setEase(stage.FadeEaseType).setRecursive(false); + + if(options.character.State.portraitImage.color != Color.white) + { + LeanTween.color(options.character.State.portraitImage.rectTransform, Color.white, duration) + .setEase(stage.FadeEaseType) + .setRecursive(false); + } + + LeanTween.alpha(options.character.State.portraitImage.rectTransform, 1f, duration) + .setEase(stage.FadeEaseType) + .setRecursive(false); DoMoveTween(options);