Пример #1
0
        private void renderPanel_MouseDown(object sender, MouseEventArgs e)
        {
            if (e.Button == MouseButtons.Middle)
            {
                isWheelDown = true;
                downPos.X   = e.Location.X;
                downPos.Y   = e.Location.Y;
            }
            else if (e.Button == MouseButtons.Left)
            {
                this.ActiveControl = renderPanel;

                switch (mode)
                {
                case Mode.Object:
                {
                    Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                    RaycastHit hit;
                    if (Physics.Raycast(ray, out hit))
                    {
                        foreach (TreeNode node in treeViewObject.Nodes[0].Nodes)
                        {
                            if (node.Text == hit.collider.gameObject.name)
                            {
                                treeViewObject.SelectedNode = node;
                                selectedObject = hit.collider.gameObject;
                                SetGameObjectInfo();
                            }
                        }
                    }
                }
                break;

                case Mode.NavMesh:
                {
                    Ray        ray = Camera.main.ScreenPointToRay(Input.mousePosition);
                    RaycastHit hit;
                    if (Physics.Raycast(ray, out hit))
                    {
                        NavManager.AddVertex(hit.point);
                    }
                }
                break;

                default:
                    break;
                }
                // TODO : 여기부터
            }
            else //Right
            {
            }
        }
Пример #2
0
 private void buttonLoadVertex_Click(object sender, EventArgs e)
 {
     NavManager.Load();
     MessageBox.Show("네비메쉬 불러오기");
 }
Пример #3
0
 private void buttonSaveVertex_Click(object sender, EventArgs e)
 {
     NavManager.Save();
     MessageBox.Show("네비메쉬 저장");
 }