MainMapUIVM.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. using UnityEngine;
  2. using XGame.Framework.Map;
  3. using XGame.Framework.ObjectCollection;
  4. namespace FL.Map.UI
  5. {
  6. public class MainMapUIVM : EntityViewModel
  7. {
  8. public Canvas Canvas { get; private set; }
  9. public Transform MonsterRoot { get; private set; }
  10. public Transform PlayerRoot { get; private set; }
  11. public Transform CombatValRoot { get; private set; }
  12. public GameObject BossTimeRoot { get; private set; }
  13. public UnityEngine.UI.Image BossTimeImg { get; private set; }
  14. public TMPro.TextMeshProUGUI BossTimeTxt { get; private set; }
  15. public UnityEngine.UI.Image MapProgressImg { get; private set; }
  16. public GameObject CurProgressImg { get; private set; }
  17. public TMPro.TextMeshProUGUI MapNameTxt { get; private set; }
  18. public UnityEngine.UI.Button ChallengeBtn { get; private set; }
  19. public Transform BossRoot { get; private set; }
  20. public GameObject MapInfoRoot { get; private set; }
  21. public GameObject MapProgress { get; private set; }
  22. public UnityEngine.UI.Button MapTaskBtn { get; private set; }
  23. protected override void OnInit(IObjectCollector collector)
  24. {
  25. Canvas = collector.GetComponent<Canvas>("Canvas");
  26. MonsterRoot = collector.GetGameObject("MonsterRoot").transform;
  27. PlayerRoot = collector.GetGameObject("PlayerRoot").transform;
  28. CombatValRoot = collector.GetGameObject("CombatValRoot").transform;
  29. MapProgressImg = collector.GetComponent<UnityEngine.UI.Image>("MapProgressImg");
  30. CurProgressImg = collector.GetGameObject("CurProgressImg");
  31. MapNameTxt = collector.GetComponent<TMPro.TextMeshProUGUI>("MapNameTxt");
  32. ChallengeBtn = collector.GetComponent<UnityEngine.UI.Button>("ChallengeBtn");
  33. MapInfoRoot = collector.GetGameObject("MapInfoRoot");
  34. MapProgress = collector.GetGameObject("MapProgress");
  35. BossRoot = collector.GetGameObject("BossRoot").transform;
  36. MapTaskBtn = collector.GetComponent<UnityEngine.UI.Button>("MapTaskBtn");
  37. }
  38. }
  39. }