Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
    void Start()
    {
        clickTarget = GO_target.GetComponent <iClickable>();
        hoverTarget = GO_target.GetComponent <iHoverable>();

        if (clickTarget != null)
        {
            hasClick = true;
        }

        if (hoverTarget != null)
        {
            hasHover = true;
        }
    }
Ejemplo n.º 3
0
    void Start()
    {
        clickTarget = GO_target.GetComponent<iClickable>();
        hoverTarget = GO_target.GetComponent<iHoverable>();

        if(clickTarget != null)
        {
            hasClick = true;
        }

        if(hoverTarget != null)
        {
            hasHover = true;
        }
    }