File tree Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Expand file tree Collapse file tree 1 file changed +6
-18
lines changed Original file line number Diff line number Diff line change @@ -31,7 +31,6 @@ protected static MaterialPropertyBlock _MaterialPropertyBlock
3131 public bool IsSelected { get => _selected ; }
3232 private int _selectIndex = - 1 ;
3333 public int SelectIndex { get => _selectIndex ; }
34- private bool _hovered = false ;
3534
3635 public GameObject healthbar ;
3736 protected Renderer _healthbarRenderer ;
@@ -53,24 +52,13 @@ private void Awake()
5352 }
5453 }
5554
56- private void OnMouseEnter ( )
55+ private void OnMouseDown ( )
5756 {
58- _hovered = true ;
59- }
60-
61- private void OnMouseExit ( )
62- {
63- _hovered = false ;
64- }
65-
66- private void Update ( )
67- {
68- if ( _hovered && Input . GetMouseButtonDown ( 0 ) )
69- Select (
70- true ,
71- Input . GetKey ( KeyCode . LeftShift ) ||
72- Input . GetKey ( KeyCode . RightShift )
73- ) ;
57+ Select (
58+ true ,
59+ Input . GetKey ( KeyCode . LeftShift ) ||
60+ Input . GetKey ( KeyCode . RightShift )
61+ ) ;
7462 }
7563
7664 public void Initialize ( Unit unit )
You can’t perform that action at this time.
0 commit comments