Пример #1
0
    void SelectUnderCursor()
    {
        NodeMapper node = FindNodeMapperUnderCursor();

        if (node != null)
        {
            if (selectedNode != null)
            {
                if (selectedNode.IsAdjacent(node))
                {
                    selectedNode.ConnectTo(node);
                    DeSelectNode();
                    if (_constellation != null && _constellation.CheckForSuccess())
                    {
                        Debug.Log("Win?");
                        Win();
                    }
                }
                else
                {
                    DeSelectNode();
                }
            }
            else if (selectedNode == null)
            {
                SelectNode(node);
            }
        }
        else
        {
            DeSelectNode();
        }
    }