MainMapUIVM.cs 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839
  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. protected override void OnInit(IObjectCollector collector)
  23. {
  24. Canvas = collector.GetComponent<Canvas>("Canvas");
  25. MonsterRoot = collector.GetGameObject("MonsterRoot").transform;
  26. PlayerRoot = collector.GetGameObject("PlayerRoot").transform;
  27. CombatValRoot = collector.GetGameObject("CombatValRoot").transform;
  28. MapProgressImg = collector.GetComponent<UnityEngine.UI.Image>("MapProgressImg");
  29. CurProgressImg = collector.GetGameObject("CurProgressImg");
  30. MapNameTxt = collector.GetComponent<TMPro.TextMeshProUGUI>("MapNameTxt");
  31. ChallengeBtn = collector.GetComponent<UnityEngine.UI.Button>("ChallengeBtn");
  32. MapInfoRoot = collector.GetGameObject("MapInfoRoot");
  33. MapProgress = collector.GetGameObject("MapProgress");
  34. BossRoot = collector.GetGameObject("BossRoot").transform;
  35. }
  36. }
  37. }