public override void OnPointerEnter(PointerEventData data) { // Debug.Log ("OnPointerEnter called"); //GameObject water = GameObject.FindGameObjectWithTag ("Water"); Raycast rock = GetComponent <Raycast> (); rock.GetComponent <Raycast> ().RayCastEnter(2); }
public override void Execute(Vector3 mousePos, SelectedUnits selectedUnits) { try { GameObject unitToSelect = new Raycast().Cast(mousePos, Vector2.zero); BasicSpider spider = (unitToSelect.GetComponent(typeof(BasicSpider)) as BasicSpider); if (selectedUnits.contains(spider)) { selectedUnits.remove(spider); spider.selected = false; } else { selectedUnits.add(spider); spider.selected = true; } } catch (NullReferenceException e) { selectedUnits.deselectAll(); return; } }
public override void OnPointerExit(PointerEventData data) { Raycast rock = GetComponent <Raycast> (); rock.GetComponent <Raycast> ().RayCastExit(); }