using UnityEngine; public class OutlineSelection : MonoBehaviour { private Transform _hightlight; private Transform _selection; private RaycastHit _raycastHit; void Update() { //if (_hightlight != null) //{ // _hightlight.gameObject.GetComponent().enabled = false; // _hightlight = null; //} //var ray = Camera.main.ScreenPointToRay(Input.mousePosition); //if (!EventSystem.current.IsPointerOverGameObject() && Physics.Raycast(ray, out _raycastHit)) //{ // _hightlight = _raycastHit.transform; // if (_hightlight.CompareTag("Selectable") && _hightlight != _selection) // { // if (_hightlight.gameObject.GetComponent() != null) // { // _hightlight.gameObject.GetComponent().enabled = true; // } // else // { // var outline = _hightlight.gameObject.AddComponent(); // outline.enabled = true; // _hightlight.gameObject.GetComponent().OutlineColor = Color.yellow; // _hightlight.gameObject.GetComponent().OutlineWidth = 7f; // } // } // else // { // _hightlight = null; // } //} } }