fix(tutorial): preserve click targets across UI transitions
Publish UPM package / publish (push) Successful in 2s
Publish UPM package / publish (push) Successful in 2s
This commit is contained in:
@@ -7,12 +7,30 @@ namespace ShrinkTutorial
|
||||
{
|
||||
public class ShrinkTutorialDialog : MonoBehaviour
|
||||
{
|
||||
private RectTransform _rectTransform;
|
||||
private RectTransform _arrowRectTransform;
|
||||
private TextMeshProUGUI _contentText;
|
||||
private GameObject _skipButtonObject;
|
||||
[Header("Explicit scene bindings")]
|
||||
[SerializeField] private RectTransform _rectTransform;
|
||||
[SerializeField] private RectTransform _arrowRectTransform;
|
||||
[SerializeField] private TextMeshProUGUI _contentText;
|
||||
[SerializeField] private GameObject _skipButtonObject;
|
||||
private Action _skipAction;
|
||||
|
||||
/// <summary>
|
||||
/// Uses UI objects that already exist in the scene. This path intentionally does not
|
||||
/// create children or add listeners at runtime; scene-authored persistent callbacks
|
||||
/// remain the source of truth.
|
||||
/// </summary>
|
||||
public bool BindExisting()
|
||||
{
|
||||
if (!_rectTransform)
|
||||
_rectTransform = GetComponent<RectTransform>();
|
||||
|
||||
if (_rectTransform && _arrowRectTransform && _contentText)
|
||||
return true;
|
||||
|
||||
Debug.LogError("[ShrinkTutorial] Explicit dialog bindings are incomplete.", this);
|
||||
return false;
|
||||
}
|
||||
|
||||
public void Initialize(Transform parent, Action skipAction)
|
||||
{
|
||||
_skipAction = skipAction;
|
||||
|
||||
Reference in New Issue
Block a user