For AI agents: the complete documentation index is available at /AchEngine/zh/llms.txt, the full documentation bundle is available at /AchEngine/zh/llms-full.txt, and this page is available as Markdown at /AchEngine/zh/usage/ui/binding.md.
  • 简体中文
  • UIBindingManager (ACHENGINE_R3)

    基于 R3 Subject<T> 的类型安全 pub/sub 总线,只有安装 com.cysharp.r3 时启用。

    public struct GoldChangedMessage { public int Amount; }
    UIBindingManager.Publish(new GoldChangedMessage { Amount = 500 });
    
    private IDisposable _subscription;
    private void OnEnable()
        => _subscription = UIBindingManager.Subscribe<GoldChangedMessage>(m => goldLabel.text = m.Amount.ToString());
    private void OnDisable() => _subscription?.Dispose();

    使用 Contains<T>() 检查 Subject,使用 ClearAll() 清除所有 Subject。