Exemple #1
0
        /// <summary>
        ///     Create an assembly station
        /// </summary>
        private void CreateAssemblyStation()
        {
            var state = new ItemState(
                _projectManager.GetNextGroupID(),
                "Assembly Station",
                _projectManager.CurrentProject.ObjectModel.name,
                ItemState.Last
                );

            // Add the new action to the undo redo service
            var createCommand = new CreateCommand(true, state);
            var commandGroup  = new CommandGroup();

            _undoService.AddCommand(commandGroup);
            commandGroup.AddToGroup(createCommand);
            createCommand.Redo();

            // Scroll to the created station
            var stationItem = hierarchyView.transform.GetChild(hierarchyView.transform.childCount - 1);

            ScrollToItem(stationItem.GetComponent <RectTransform>());
            stationItem.GetComponent <HierarchyItemController>().RenameItem(true, commandGroup);
        }
 /// <summary>
 ///     Fuse a group
 /// </summary>
 private void FuseGroup()
 {
     _undoService.AddCommand(new FuseCommand(itemInfo.ItemInfo.isFused, item.name));
 }