Ejemplo n.º 1
0
 private void SetLogicSceneEditorBrushState(_AtlObjInfo atlobj)
 {
     SceneSceneEditor.SetEditState(SCENESTATE_CELLLOGICAL);
     SceneSceneEditor.ClearLogicModifyState();
     SceneSceneEditor.SetLogicModifyState(Convert.ToInt32(atlobj.strValues[4]), atlobj.strValues[3]);
     SceneSceneEditor.SetLogicCurrentColor(stringToColor(atlobj.strValues[1]));
     SceneSceneEditor.SetCurrentEditBrushIndex(Convert.ToInt32(atlobj.strValues[0]));
 }
Ejemplo n.º 2
0
        private void advTreePoly_AfterNodeSelect(object sender, AdvTreeNodeEventArgs e)
        {
            Node selectedNode = this.advTreePoly.SelectedNode;

            if (selectedNode == null)
            {
                return;
            }

            if (selectedNode.Level == 0)
            {
                if (selectedNode.Text == "笔刷")
                {
                    SceneSceneEditor.SetEditState(SCENESTATE_CELLLOGICAL);
                }
                else if (selectedNode.Text == "多边形")
                {
                    SceneSceneEditor.SetEditState(SCENESTATE_SELECT);
                }
            }
            else if (selectedNode.Level == 1)
            {
                if (selectedNode.Parent.Text == "多边形")
                {
                    //SceneSceneEditor.SetEditState(SCENESTATE_SELECT);

                    _AtlObjInfo atlobj = (_AtlObjInfo)selectedNode.Tag;
                    ShowPolyInfoUI(atlobj);
                    this.buttonOK.Enabled = false;

                    if (atlobj.iRepresentObjPtr != 0)
                    {
                        if (SceneSceneEditor.GetEditState() != SCENESTATE_PLACEOBJ)
                        {
                            MoveCameraToRepresentObj(atlobj.iRepresentObjPtr);
                        }
                        SelectOnlyRepresentObj(atlobj.iRepresentObjPtr);
                    }
                }
                else if (selectedNode.Parent.Text == "笔刷")
                {
                    _AtlObjInfo atlobj = (_AtlObjInfo)selectedNode.Tag;
                    ShowBrushInfoUI(atlobj);
                    this.buttonOK.Enabled = false;
                    //set camera
                    string strPos = atlobj.strValues[5];
                    if (strPos != "0.000000,0.000000,0.000000")
                    {
                        string[] strPoses = strPos.Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries);
                        float    x = 0.0f, y = 0.0f, z = 0.0f;
                        if (Single.TryParse(strPoses[0], out x) && Single.TryParse(strPoses[1], out y) && Single.TryParse(strPoses[2], out z))
                        {
                            _AtlVector3 brushPos = new _AtlVector3();
                            brushPos.x = x; brushPos.y = y; brushPos.z = z;
                            MoveCameraToPosition(brushPos);
                        }
                    }

                    SetLogicSceneEditorBrushState(atlobj);
                }
            }
        }