Beispiel #1
0
 internal void AddNode(UITowerNode inc_node, int inc_x, int inc_y)
 {
     //Debug.Log("Adding: [" + inc_x + "][" + inc_y + "]");
     node_grid[inc_x][inc_y].node = inc_node;
     if (inc_node.UINodeType == R11.NodeType.NGoal)
     {
         goal_nodes.Add(inc_node);
     }
 }
Beispiel #2
0
    internal void PowerGrid()
    {
        List <UITowerNode> connected_nodes = new List <UITowerNode>();
        UITowerNode        checked_node    = null;

        switch (UINodeType)
        {
        case R11.NodeType.NStart:
            checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
            if (checked_node.RotationState != 3)
            {
                connected_nodes.Add(checked_node);
            }
            break;

        case R11.NodeType.Corner:
            switch (RotationState)
            {
            case 0:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation + 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 2 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 1:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation + 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 2 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation - 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 2:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation - 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation - 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 3:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation - 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;
            }
            break;

        case R11.NodeType.Straight:
            switch (RotationState)
            {
            case 0:
            case 2:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation - 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 1:
            case 3:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation + 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 2 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation - 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;
            }
            break;

        case R11.NodeType.T:
            switch (RotationState)
            {
            case 0:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation + 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 2 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation - 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 1:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation + 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 2 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation - 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation - 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 2:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation - 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation - 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;

            case 3:
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation - 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 1)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation, YLocation + 1);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 0 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 2)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                checked_node = transform.parent.GetComponent <TowerGrid>().GetNode(XLocation + 1, YLocation);
                if (!checked_node.PowerCheck)
                {
                    if (checked_node.UINodeType == R11.NodeType.Straight)
                    {
                        if (checked_node.RotationState == 1 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.T)
                    {
                        if (checked_node.RotationState != 0)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.Corner)
                    {
                        if (checked_node.RotationState == 2 || checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                    if (checked_node.UINodeType == R11.NodeType.NGoal)
                    {
                        if (checked_node.RotationState == 3)
                        {
                            connected_nodes.Add(checked_node);
                        }
                    }
                }
                break;
            }
            //checked_node = transform.parent.GetComponent<TowerGrid>().GetNode(XLocation, YLocation + 1);
            //if (checked_node.RotationState != 3)
            //    connected_nodes.Add(checked_node);
            break;
        }
        foreach (var temp_node in connected_nodes)
        {
            temp_node.Powered    = true;
            temp_node.PowerCheck = true;

            temp_node.PowerGrid();
        }
    }