TitleMouseOver.cs 555 B

12345678910111213141516171819202122
  1. using System;
  2. using UnityEngine;
  3. public class TitleMouseOver : MonoBehaviour
  4. {
  5. public void OnHover(bool isOver)
  6. {
  7. if (isOver)
  8. {
  9. string name = UICamera.lastHit.collider.name;
  10. if (!BaseMgr<TitleMgr>.Instance.IsValidateButton<TitleMgr.ButtonType>(name))
  11. {
  12. return;
  13. }
  14. TitleMgr.ButtonType buttonType = (TitleMgr.ButtonType)Enum.Parse(typeof(TitleMgr.ButtonType), name);
  15. if (buttonType != BaseMgr<TitleMgr>.Instance.m_currentActiveButton)
  16. {
  17. BaseMgr<TitleMgr>.Instance.m_titleCtrl.SetActiveButton(buttonType);
  18. }
  19. }
  20. }
  21. }