private void OnEnable()
        {
            if (!editObject)
            {
                editObject = ((PrimitivesPro.MeshEditor.MeshEditorObject)target);
            }

            if (!editObject)
            {
                Instance = null;
                return;
            }

            editObject.Init();

            if (Toolbar.Instance)
            {
                selectionType = Toolbar.Instance.MeshSelection;
            }

            vertexSelection = new HashSet <int>();
            faceSelection   = new HashSet <PPMesh.Face>();
            edgeSelection   = new HashSet <PPMesh.HalfEdge>();

            settings = new MeshEditorSettings();
            settings.Deserialize();

            if (grid == null)
            {
                grid = new Grid(settings);
            }

            editCommand = new EditCommand
            {
                Command = EditCommand.CommandType.None,
                Face    = null
            };

            defaultTool = Tools.current;
            if (defaultTool == Tool.None)
            {
                defaultTool = Tool.Move;
            }

            handlesRotation = Quaternion.identity;

            Instance = this;
        }
Beispiel #2
0
        void OnEnable()
        {
            if (!editObject)
            {
                editObject = ((PrimitivesPro.MeshEditor.MeshEditorObject) target);
            }

            if (!editObject)
            {
                Instance = null;
                return;
            }

            editObject.Init();

            if (Toolbar.Instance)
            {
                selectionType = Toolbar.Instance.MeshSelection;
            }

            vertexSelection = new HashSet<int>();
            faceSelection = new HashSet<PPMesh.Face>();
            edgeSelection = new HashSet<PPMesh.HalfEdge>();

			settings = new MeshEditorSettings();
			settings.Deserialize();

            if (grid == null)
            {
                grid = new Grid(settings);
            }

            editCommand = new EditCommand
            {
                Command = EditCommand.CommandType.None,
                Face = null
            };

            defaultTool = Tools.current;
            if (defaultTool == Tool.None)
            {
                defaultTool = Tool.Move;
            }

            handlesRotation = Quaternion.identity;

            Instance = this;
        }
Beispiel #3
0
 public Grid(MeshEditorSettings settings)
 {
     this.settings = settings;
 }
Beispiel #4
0
		public Grid(MeshEditorSettings settings)
        {
			this.settings = settings;
        }