Beispiel #1
0
    void Update()
    {
        // Check if outside breaking distance (on the Y axis)
        if (!IsPointInRange(point))
        {
            point = null;
        }

        // Visualization
        var closest            = GetClosestPoint();
        PushingHighlight hover = IsPointInRange(closest) ? closest.highlight : null;

        if (hover != lastHover)
        {
            // Hover changed
            if (hover)
            {
                hover.SetHighlightActive(true);
            }
            if (lastHover)
            {
                lastHover.SetHighlightActive(false);
            }
        }
        lastHover = hover;
    }
    protected override void Awake()
    {
        // Searchable awake function
        base.Awake();

        // Get the parent pushing highlight, if any
        highlight = body.GetComponent<PushingHighlight>();
    }
Beispiel #3
0
    protected override void Awake()
    {
        // Searchable awake function
        base.Awake();

        // Get the parent pushing highlight, if any
        highlight = body.GetComponent <PushingHighlight>();
    }
    void Update()
    {
        // Check if outside breaking distance (on the Y axis)
        if (!IsPointInRange(point)) {
            point = null;
        }

        // Visualization
        var closest = GetClosestPoint();
        PushingHighlight hover = IsPointInRange(closest) ? closest.highlight : null;

        if (hover != lastHover) {
            // Hover changed
            if (hover) hover.SetHighlightActive(true);
            if (lastHover) lastHover.SetHighlightActive(false);
        }
        lastHover = hover;
    }