using System.Collections; using HotUpdate.Gameplay; using TMPro; using UnityEngine; using UnityEngine.UI; namespace HotUpdate.UI { /// Walks a placeholder explorer over the camp painting and speaks only after a tap. public sealed class HomeExplorerPresenter : MonoBehaviour { const int Layer = 31; static readonly Color Key = new Color(0.07f, 0.02f, 0.09f, 1f); static readonly string[] Lines = { "喷泉今天的水声很好听。", "芽芽他们在营地里等你。", "想再去弹珠台转转吗?", "这条石路是我每天散步的地方。", "花开得正好,要不要一起看看?", "下一关的路上好像有新朋友。", "训练之后,大家都会更有精神。", "我在这儿看着营地,你去冒险吧。" }; UiPrefabLoader _loader; GameObject _stage; Camera _camera; Transform _actor; RectTransform _button; RectTransform _bubble; TextMeshProUGUI _line; float _hideAt; int _last = -1; bool _hooked; Vector3 _wander; public bool Ready => _actor != null; public bool Talking => _bubble != null && _bubble.gameObject.activeSelf; public string Line => _line != null ? _line.text : ""; void OnEnable() { if (_camera != null) _camera.enabled = true; else StartCoroutine(Boot()); } void OnDisable() { if (_camera != null) _camera.enabled = false; if (_bubble != null) _bubble.gameObject.SetActive(false); } void OnDestroy() { if (_button != null) _button.GetComponent