| | |
| | | #region 私有字段 |
| | | |
| | | // 移除 [SerializeField],controller 不应该被序列化 |
| | | private BattleFloatingUIController controller; |
| | | public BattleFloatingUIController controller; |
| | | |
| | | #endregion |
| | | |
| | |
| | | /// </summary> |
| | | private void InitController() |
| | | { |
| | | if (controller != null) return; |
| | | |
| | | if (floatingConfig == null) |
| | | { |
| | | Debug.LogError($"[BattleTips] FloatingConfig 未配置! GameObject: {gameObject.name}"); |
| | |
| | | /// </summary> |
| | | private void EnsureControllerInitialized() |
| | | { |
| | | if (controller == null) |
| | | if (controller == null || !controller.IsValid()) |
| | | InitController(); |
| | | } |
| | | |