FguiViewModel.cs 767 B

1234567891011121314151617181920212223242526272829
  1. using FairyGUI;
  2. using XGame.Framework.UI.View;
  3. namespace XGame.Framework.FGUI
  4. {
  5. /// <summary>
  6. /// FGUI相关的操作都在IUIViewModel的实现类里
  7. /// </summary>
  8. public abstract class FguiViewModel : IUIViewModel
  9. {
  10. protected GComponent Panel { get; private set; }
  11. public FguiViewModel(GComponent panel)
  12. {
  13. Panel = panel;
  14. BindComponents(panel);
  15. OnInited();
  16. }
  17. /// <summary>
  18. /// 结束ui的所有tween
  19. /// </summary>
  20. public void KillTweens(bool complete = false)
  21. {
  22. GTween.Kill(Panel, complete);
  23. }
  24. protected abstract void BindComponents(GComponent panel);
  25. protected abstract void OnInited();
  26. }
  27. }