示例#1
0
    public void TempZone(Vector3 start, int width, int lenght)
    {
        ClearTemp();

        currentTempIsEmpty = true;


        for (int i = 0; i < lenght; i++)
        {
            for (int j = 0; j < width; j++)
            {
                BuildSection tmp = GetSectionByCoordinate(start + new Vector3(i, 0, j));

                if (tmp != null && tmp.isEmpty)
                {
                    currentTemp.Add(tmp);
                    tmp.TempActivate();
                }
                else
                {
                    currentTempIsEmpty = false;
                }
            }
        }

        if (currentTempIsEmpty)
        {
            Vector3 vec = currentTemp[0].obj.transform.position - new Vector3(0.5f, 0, 0.5f);

            vec += new Vector3((float)lenght * 0.5f, 0, (float)width * 0.5f);

            tempCenter = vec;
        }
    }
        private void toolStripButton5_Click_1(object sender, EventArgs e)
        {
            foreach (TreeNode treeNode in treeView1.Nodes)
            {
                if (!_panels.ContainsKey(treeNode.Name))
                {
                    continue;
                }
                BuildSection buildSection = _panels[treeNode.Name] as BuildSection;
                if (buildSection == null)
                {
                    continue;
                }

                treeView1.SelectedNode = treeNode;
                buildSection.btn_generate_Click(null, null);

                break;
            }
        }