FguiNested.cs 815 B

12345678910111213141516171819202122232425
  1. using FairyGUI;
  2. using UnityEngine;
  3. using XGame.Framework.UI;
  4. namespace XGame.Framework.FGUI
  5. {
  6. public class FguiNested : IUINested
  7. { // fgui的dispose会先销毁GO再回调
  8. private GComponent _component;
  9. public GComponent Component => _component;
  10. public Transform Tr => _component?.displayObject?.gameObject?.transform ?? null;
  11. bool IUINested.IsActiveSelf => _component?.displayObject?.gameObject?.activeSelf ?? false;
  12. bool IUINested.IsActiveInHierarchy => _component?.displayObject?.gameObject?.activeInHierarchy ?? false;
  13. void IUINested.SetActive(bool isActive)
  14. {
  15. _component.displayObject.visible = isActive;
  16. }
  17. public FguiNested(GComponent component)
  18. {
  19. _component = component;
  20. }
  21. }
  22. }