public static bool ActivateShapeUnderPoint <T>(PointF P) where T : iClickable { P = ShapeSystem.gridSystem.theorizePoint(P); double distanceToPoint = 999; Shape newActive = null; foreach (Shape S in GetShapes()) { if (!(S is T)) // if it's not clickable continue { continue; } iClickable C = (iClickable)S; if (C.IntersectsWithCircle(P, .1F)) { double D = C.GetDistanceFromPoint(P); //ITS LIKE A BAD ITCH EDDY, GET IT OFF if (D < distanceToPoint) { distanceToPoint = D; newActive = (Shape)C; } } } if (newActive != null) { MakeActiveShape(GetShapeById(newActive.IdShape)); return(true); } return(false); }
void Start() { clickTarget = GO_target.GetComponent <iClickable>(); hoverTarget = GO_target.GetComponent <iHoverable>(); if (clickTarget != null) { hasClick = true; } if (hoverTarget != null) { hasHover = true; } }
void Start() { clickTarget = GO_target.GetComponent<iClickable>(); hoverTarget = GO_target.GetComponent<iHoverable>(); if(clickTarget != null) { hasClick = true; } if(hoverTarget != null) { hasHover = true; } }