Page 2 of 2
Re: PC Portrait blinking
Posted: Wed Dec 09, 2020 2:22 pm
by Tony Li
Glad to help! Some games use a typewriter effect, which gives time for each portrait to display. Others only show the NPC's portrait. To only show NPC portraits with the WRPG template, tick the subtitle panel's Only Show NPC Portraits checkbox.
Re: PC Portrait blinking
Posted: Wed Dec 09, 2020 5:05 pm
by Maltakreuz
Just in case somebody will find this post by searching and is interested with what i ended up, here it is (just delayed setter of portrait, but works fine for me).
Code: Select all
using Text = TMPro.TextMeshProUGUI;
public class DelayedPortraitSetter : MonoBehaviour {
[Tooltip("Original Dialogue System image, that blinks for PC too quick. Must be disabled or invisible")]
public Image srcImg;
[Tooltip("Queued img, that will be shown as current speaker portrait")]
public Image dstImg;
public Text srcTxt;
public Text dstTxt;
public float showPortraitDuration = 1f;
[Tooltip("How long current portrait is already shown. Ticks from 0 upwards.")]
public float time = 0;
void Update() {
time += Time.deltaTime;
if (srcImg.sprite != dstImg.sprite && time >= showPortraitDuration) {
dstImg.sprite = srcImg.sprite;
dstTxt.text = srcTxt.text;
time = 0;
}
}
void OnEnable() {
// to avoid delay on dialogue start
time = showPortraitDuration;
}
}
Re: PC Portrait blinking
Posted: Wed Dec 09, 2020 7:03 pm
by Tony Li
Thanks for sharing!