Page 1 of 1

Both panel name at start

Posted: Tue Nov 28, 2023 5:09 pm
by Wiik
Hi,
i have 2 Subtitles panels with Visibility= always from start
And their name should be disabled at start with > On Open() GameObject.SetActive = false

my issue is at the start of the conversation, both of their name are showing.

Any idea why ?

Re: Both panel name at start

Posted: Thu Nov 30, 2023 6:57 am
by Wiik
up

Re: Both panel name at start

Posted: Thu Nov 30, 2023 9:15 am
by Tony Li
Hi,

Thanks for the "up." I'm sorry; I don't know how your message slipped by. Add this script to your subtitle panel(s):

HideNameOnOpen.cs

Code: Select all

using System.Collections;
using PixelCrushers.DialogueSystem;
using UnityEngine;

public class HideNameOnOpen : MonoBehaviour
{
    private void OnEnable()
    {
        StartCoroutine(HideNameAtEndOfFrame());
    }

    IEnumerator HideNameAtEndOfFrame()
    {
        yield return new WaitForEndOfFrame();
        var panel = GetComponent<StandardUISubtitlePanel>();
        panel.portraitName.gameObject.SetActive(false);
    }
}

Re: Both panel name at start

Posted: Fri Dec 01, 2023 8:07 am
by Wiik
Thank Tony, that worked.

Re: Both panel name at start

Posted: Fri Dec 01, 2023 8:35 am
by Tony Li
Glad to help!