Esempio n. 1
0
    private bool HandleMouseDown(Event evt)
    {
        // Handle this event if we clicked on this object
        RaycastHit info;

        if (Physics.Raycast(HandleUtility.GUIPointToWorldRay(evt.mousePosition), out info, float.MaxValue, 1 << LayerMask.NameToLayer("EditorWaypoint")))
        {
            Waypoint selectedWaypoint = info.transform.parent.GetComponent <Waypoint>();
            if (selectedWaypoint == null)
            {
                selectedWaypoint = info.transform.GetComponent <Waypoint>();
            }

            if (selectedWaypoint == this.target as Waypoint)
            {
                // Nothing
            }
            else
            {
                Selection.activeObject = selectedWaypoint.gameObject;
            }
            WalkableFloorEditor.StoreTool();
            GUIUtility.hotControl = GUIUtility.GetControlID(FocusType.Passive);
            return(true);
        }
        return(false);
    }