PWBItemsWindow.cs 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538
  1. /*
  2. Copyright (c) 2024 Omar Duarte
  3. Unauthorized copying of this file, via any medium is strictly prohibited.
  4. Writen by Omar Duarte, 2024.
  5. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  6. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  7. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  8. AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  9. LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  10. OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  11. THE SOFTWARE.
  12. */
  13. using UnityEngine;
  14. using System.Linq;
  15. namespace PluginMaster
  16. {
  17. public class PWBItemsWindow : UnityEditor.EditorWindow
  18. {
  19. private static PWBItemsWindow _instance = null;
  20. private GUIContent _showAllIcon = null;
  21. private GUIContent _showObjectsIcon = null;
  22. private GUIContent _hideAllIcon = null;
  23. private GUIContent _showAllIconLight = null;
  24. private GUIContent _showObjectsIconLight = null;
  25. private GUIContent _hideAllIconLight = null;
  26. private GUIContent _reloadIcon = null;
  27. private GUISkin _skin = null;
  28. private GUIStyle _itemBtnStyle = null;
  29. private GUIStyle _itemRowStyle = null;
  30. private GUIStyle _itemRowSelectedStyle = null;
  31. private Vector2 _scrollPosition = Vector2.zero;
  32. [UnityEditor.MenuItem("Tools/Plugin Master/Prefab World Builder/Items...", false, 1135)]
  33. public static void ShowWindow() => _instance = GetWindow<PWBItemsWindow>("PWB Items");
  34. public static void RepainWindow()
  35. {
  36. if (_instance != null) _instance.Repaint();
  37. }
  38. private void OnEnable()
  39. {
  40. UnityEditor.Undo.undoRedoPerformed += Repaint;
  41. _skin = Resources.Load<GUISkin>("PWBSkin");
  42. if (_skin == null) return;
  43. _showAllIcon = new GUIContent(Resources.Load<Texture2D>("Sprites/ShowAll"), "Show item and its children");
  44. _showAllIconLight = new GUIContent(Resources.Load<Texture2D>("Sprites/LightTheme/ShowAll"));
  45. _showAllIconLight.tooltip = _showAllIcon.tooltip;
  46. _showObjectsIcon = new GUIContent(Resources.Load<Texture2D>("Sprites/ShowObjects"), "Hide item but show children");
  47. _showObjectsIconLight = new GUIContent(Resources.Load<Texture2D>("Sprites/LightTheme/ShowObjects"));
  48. _showObjectsIconLight.tooltip = _showObjectsIcon.tooltip;
  49. _hideAllIcon = new GUIContent(Resources.Load<Texture2D>("Sprites/HideAll"), "Hide item and its children");
  50. _hideAllIconLight = new GUIContent(Resources.Load<Texture2D>("Sprites/LightTheme/HideAll"));
  51. _reloadIcon = new GUIContent(Resources.Load<Texture2D>("Sprites/Update"), "Reload items data");
  52. _hideAllIconLight.tooltip = _hideAllIcon.tooltip;
  53. _itemBtnStyle = _skin.GetStyle("EyeButton");
  54. _itemRowStyle = _skin.GetStyle("ItemRow");
  55. _itemRowSelectedStyle = _skin.GetStyle("ItemRowSelected");
  56. }
  57. private GUIContent showAllIcon => UnityEditor.EditorGUIUtility.isProSkin ? _showAllIcon : _showAllIconLight;
  58. private GUIContent showObjectsIcon
  59. => UnityEditor.EditorGUIUtility.isProSkin ? _showObjectsIcon : _showObjectsIconLight;
  60. private GUIContent hideAllIcon
  61. => UnityEditor.EditorGUIUtility.isProSkin ? _hideAllIcon : _hideAllIconLight;
  62. private void OnGUI()
  63. {
  64. if (_skin == null)
  65. {
  66. Close();
  67. return;
  68. }
  69. if (_instance == null) _instance = this;
  70. var manager = ToolManager.GetCurrentPersistentToolManager();
  71. if (manager == null) return;
  72. void HeaderRow(IPersistentToolManager toolMan, IPersistentData[] items)
  73. {
  74. var allItemsVisibility = IPersistentData.Visibility.SHOW_OBJECTS;
  75. int showAllCount = 0;
  76. int showObjectsCount = 0;
  77. int hideAllCount = 0;
  78. foreach (var item in items)
  79. {
  80. switch (item.visibility)
  81. {
  82. case IPersistentData.Visibility.SHOW_ALL: ++showAllCount; break;
  83. case IPersistentData.Visibility.SHOW_OBJECTS: ++showObjectsCount; break;
  84. case IPersistentData.Visibility.HIDE_ALL: ++hideAllCount; break;
  85. }
  86. }
  87. if (showAllCount > 0) allItemsVisibility = IPersistentData.Visibility.SHOW_ALL;
  88. else if (showObjectsCount > 0) allItemsVisibility = IPersistentData.Visibility.SHOW_OBJECTS;
  89. else allItemsVisibility = IPersistentData.Visibility.HIDE_ALL;
  90. using (new GUILayout.HorizontalScope(_itemRowStyle))
  91. {
  92. if (GUILayout.Button(_reloadIcon, _itemBtnStyle)) PWBCore.LoadFromFile();
  93. var visibilityIcon = allItemsVisibility == IPersistentData.Visibility.SHOW_ALL ? showAllIcon
  94. : allItemsVisibility == IPersistentData.Visibility.SHOW_OBJECTS ? showObjectsIcon : hideAllIcon;
  95. GUILayout.FlexibleSpace();
  96. UnityEditor.EditorGUIUtility.labelWidth = 1;
  97. UnityEditor.EditorGUIUtility.fieldWidth = 95;
  98. UnityEditor.EditorGUILayout.LabelField("All items visibility");
  99. if (GUILayout.Button(visibilityIcon, _itemBtnStyle))
  100. {
  101. switch (allItemsVisibility)
  102. {
  103. case IPersistentData.Visibility.SHOW_ALL:
  104. allItemsVisibility = IPersistentData.Visibility.SHOW_OBJECTS; break;
  105. case IPersistentData.Visibility.SHOW_OBJECTS:
  106. allItemsVisibility = IPersistentData.Visibility.HIDE_ALL; break;
  107. case IPersistentData.Visibility.HIDE_ALL:
  108. allItemsVisibility = IPersistentData.Visibility.SHOW_ALL; break;
  109. }
  110. foreach (var item in items) item.visibility = allItemsVisibility;
  111. UnityEditor.SceneView.RepaintAll();
  112. }
  113. GUILayout.Space(8);
  114. }
  115. }
  116. void Row(IPersistentData data, IPersistentData[] allItems, IPersistentToolManager toolMan)
  117. {
  118. using (new GUILayout.HorizontalScope(data.isSelected ? _itemRowSelectedStyle : _itemRowStyle))
  119. {
  120. var visibilityIcon = data.visibility == IPersistentData.Visibility.SHOW_ALL ? showAllIcon
  121. : data.visibility == IPersistentData.Visibility.SHOW_OBJECTS ? showObjectsIcon : hideAllIcon;
  122. if (GUILayout.Button(visibilityIcon, _itemBtnStyle))
  123. {
  124. data.ToggleVisibility();
  125. UnityEditor.SceneView.RepaintAll();
  126. }
  127. UnityEditor.EditorGUIUtility.labelWidth = 1;
  128. UnityEditor.EditorGUIUtility.fieldWidth = 155;
  129. UnityEditor.EditorGUILayout.LabelField(data.name);
  130. GUILayout.FlexibleSpace();
  131. }
  132. void DeselectOthers(IPersistentData selectedData)
  133. {
  134. foreach (var item in allItems)
  135. {
  136. if (item == selectedData) continue;
  137. item.isSelected = false;
  138. item.ClearSelection();
  139. }
  140. }
  141. void FocusSelection()
  142. {
  143. var max = BoundsUtils.MIN_VECTOR3;
  144. var min = BoundsUtils.MAX_VECTOR3;
  145. var focus = false;
  146. foreach (var item in allItems)
  147. {
  148. if (!item.isSelected) continue;
  149. var bounds = item.GetBounds(1.1f);
  150. max = Vector3.Max(max, bounds.max);
  151. min = Vector3.Min(min, bounds.min);
  152. focus = true;
  153. }
  154. if (!focus) return;
  155. var size = max - min;
  156. var center = size / 2 + min;
  157. var selectionBounds = new Bounds(center, size);
  158. UnityEditor.SceneView.lastActiveSceneView.Frame(selectionBounds, false);
  159. }
  160. void DeleteItems(bool deleteObjects)
  161. {
  162. toolMan.DeletePersistentItem(data.id, deleteObjects);
  163. foreach (var item in allItems)
  164. {
  165. if (!item.isSelected) continue;
  166. if (item == data) continue;
  167. toolMan.DeletePersistentItem(item.id, deleteObjects);
  168. }
  169. UnityEditor.SceneView.RepaintAll();
  170. }
  171. void SelectParents()
  172. {
  173. var selection = new System.Collections.Generic.HashSet<GameObject>();
  174. var parent = data.GetParent();
  175. if (parent != null)
  176. {
  177. UnityEditor.Selection.activeGameObject = parent;
  178. selection.Add(parent);
  179. }
  180. foreach (var item in allItems)
  181. {
  182. if (!item.isSelected) continue;
  183. if (item == data) continue;
  184. parent = item.GetParent();
  185. if (parent == null) continue;
  186. selection.Add(parent);
  187. }
  188. UnityEditor.Selection.objects = selection.ToArray();
  189. }
  190. void CloseLines()
  191. {
  192. var lineData = data as LineData;
  193. lineData.ToggleClosed();
  194. PWBIO.UpdateLinePathAndStroke(lineData);
  195. foreach (var item in allItems)
  196. {
  197. if (!item.isSelected) continue;
  198. if (item == data) continue;
  199. lineData = item as LineData;
  200. lineData.ToggleClosed();
  201. PWBIO.UpdateLinePathAndStroke(lineData);
  202. }
  203. PWBIO.updateStroke = true;
  204. }
  205. void Duplicate()
  206. {
  207. var clone = toolMan.Duplicate(data.id);
  208. ToolManager.editMode = true;
  209. clone.isSelected = true;
  210. DeselectOthers(clone);
  211. FocusSelection();
  212. if (ToolManager.tool == ToolManager.PaintTool.LINE)
  213. {
  214. LineManager.editModeType = LineManager.EditModeType.LINE_POSE;
  215. PWBIO.SelectLine(clone as LineData);
  216. }
  217. else if (ToolManager.tool == ToolManager.PaintTool.SHAPE) PWBIO.SelectShape(clone as ShapeData);
  218. else if (ToolManager.tool == ToolManager.PaintTool.TILING) PWBIO.SelectTiling(clone as TilingData);
  219. }
  220. if (Event.current.type == EventType.MouseUp
  221. && GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
  222. {
  223. if (!ToolManager.editMode)
  224. {
  225. ToolManager.editMode = true;
  226. ToolProperties.RepainWindow();
  227. }
  228. if (Event.current.button == 0)
  229. {
  230. if (!data.isSelected)
  231. {
  232. data.ToggleSelection();
  233. FocusSelection();
  234. if (Event.current.shift)
  235. {
  236. int prevIdx = -1;
  237. int dataIdx = 0;
  238. for (int i = 0; i < allItems.Length; ++i)
  239. {
  240. var item = allItems[i];
  241. if (item == data)
  242. {
  243. dataIdx = i;
  244. break;
  245. }
  246. if (item.isSelected) prevIdx = i;
  247. }
  248. if (prevIdx >= 0)
  249. {
  250. for (int i = prevIdx + 1; i < dataIdx; ++i)
  251. {
  252. allItems[i].isSelected = true;
  253. allItems[i].SelectAll();
  254. }
  255. }
  256. for (int i = dataIdx + 1; i < allItems.Length; ++i)
  257. {
  258. allItems[i].isSelected = false;
  259. allItems[i].ClearSelection();
  260. }
  261. }
  262. else if (!Event.current.control) DeselectOthers(data);
  263. }
  264. else
  265. {
  266. if (Event.current.control) data.ToggleSelection();
  267. else
  268. {
  269. var selectionCount = 0;
  270. var multipleSelection = false;
  271. foreach (var item in allItems)
  272. {
  273. if (item.isSelected) selectionCount++;
  274. if (selectionCount > 1)
  275. {
  276. multipleSelection = true;
  277. break;
  278. }
  279. }
  280. DeselectOthers(data);
  281. if (multipleSelection) FocusSelection();
  282. else data.ToggleSelection();
  283. }
  284. }
  285. Repaint();
  286. }
  287. else if (Event.current.button == 1)
  288. {
  289. var menu = new UnityEditor.GenericMenu();
  290. menu.AddItem(new GUIContent("Rename..."), on: false,
  291. () => ItemPropertiesWindow.ShowItemProperties(data, position.position));
  292. menu.AddItem(new GUIContent("Duplicate"), on: false, () => Duplicate());
  293. menu.AddItem(new GUIContent("Delete item and its children"), on: false,
  294. () => DeleteItems(deleteObjects: true));
  295. menu.AddItem(new GUIContent("Delete item but not its children"), on: false,
  296. () => DeleteItems(deleteObjects: false));
  297. menu.AddItem(new GUIContent("Select parent object"), on: false, () => SelectParents());
  298. if (ToolManager.tool == ToolManager.PaintTool.LINE)
  299. menu.AddItem(new GUIContent("Toggle Close | Open"), on: false, () => CloseLines());
  300. menu.AddItem(new GUIContent(toolMan.GetToolName() + " properties..."), on: false,
  301. () => ItemPropertiesWindow.ShowItemProperties(data, position.position));
  302. menu.ShowAsContext();
  303. }
  304. }
  305. }
  306. var items = manager.GetItems();
  307. using (new GUILayout.VerticalScope(UnityEditor.EditorStyles.helpBox))
  308. {
  309. using (var scrollView = new UnityEditor.EditorGUILayout.ScrollViewScope(_scrollPosition,
  310. alwaysShowHorizontal: false, alwaysShowVertical: false,
  311. GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, background: GUIStyle.none))
  312. {
  313. _scrollPosition = scrollView.scrollPosition;
  314. foreach (var item in items) Row(item, items, manager);
  315. }
  316. }
  317. HeaderRow(manager, items);
  318. }
  319. }
  320. #region ITEM PROPERTIES
  321. public class ItemPropertiesWindow : UnityEditor.EditorWindow
  322. {
  323. protected IPersistentData _data = null;
  324. private string _itemName = string.Empty;
  325. public static void ShowWindow(IPersistentData data, Vector2 mousePosition)
  326. {
  327. var window = GetWindow<ItemPropertiesWindow>(true, "Item properties");
  328. window.Initialize(data, mousePosition);
  329. }
  330. protected virtual void Initialize(IPersistentData data, Vector2 mousePosition)
  331. {
  332. _data = data;
  333. _itemName = data.name;
  334. position = new Rect(mousePosition.x + 50, mousePosition.y + 50, 250, 50);
  335. }
  336. private void OnGUI()
  337. {
  338. if (ToolManager.tool == ToolManager.PaintTool.NONE || _data == null) Close();
  339. UnityEditor.EditorGUIUtility.labelWidth = 50;
  340. UnityEditor.EditorGUIUtility.fieldWidth = 100;
  341. using (new GUILayout.VerticalScope(UnityEditor.EditorStyles.helpBox))
  342. {
  343. using (new GUILayout.HorizontalScope())
  344. {
  345. _itemName = UnityEditor.EditorGUILayout.TextField("Name:", _itemName);
  346. }
  347. using (var check = new UnityEditor.EditorGUI.ChangeCheckScope())
  348. {
  349. var renameParentObject = UnityEditor.EditorGUILayout.ToggleLeft("Rename parent object",
  350. PWBCore.staticData.ranameItemParent);
  351. if (check.changed) PWBCore.staticData.ranameItemParent = renameParentObject;
  352. }
  353. }
  354. GUILayout.Space(10);
  355. ToolPropertiesGUI();
  356. using (new GUILayout.HorizontalScope())
  357. {
  358. GUILayout.FlexibleSpace();
  359. if (GUILayout.Button("Apply", GUILayout.Width(50))) Apply();
  360. if (GUILayout.Button("Cancel", GUILayout.Width(50))) Close();
  361. }
  362. GUILayout.Space(10);
  363. }
  364. protected virtual void ToolPropertiesGUI() { }
  365. protected virtual void Apply()
  366. {
  367. _data.Rename(_itemName, PWBCore.staticData.ranameItemParent);
  368. PWBItemsWindow.RepainWindow();
  369. Close();
  370. UnityEditor.SceneView.RepaintAll();
  371. }
  372. public static void ShowItemProperties(IPersistentData data, Vector2 mousePosition)
  373. {
  374. if (ToolManager.tool == ToolManager.PaintTool.LINE)
  375. LinePropertiesWindow.ShowWindow(data, mousePosition);
  376. else ShowWindow(data, mousePosition);
  377. }
  378. }
  379. public class LinePropertiesWindow : ItemPropertiesWindow
  380. {
  381. private LineData _lineData = null;
  382. private Vector2 _pointsScrollPosition = Vector2.zero;
  383. private GUISkin _skin = null;
  384. private GUIStyle _itemRowStyle = null;
  385. private GUIContent _deleteIcon = null;
  386. private GUIContent _deleteIconLight = null;
  387. private GUIStyle _itemBtnStyle = null;
  388. private System.Collections.Generic.HashSet<int> _pointsToDelete = new System.Collections.Generic.HashSet<int>();
  389. private System.Collections.Generic.Dictionary<int, Vector3> _positions
  390. = new System.Collections.Generic.Dictionary<int, Vector3>();
  391. private System.Collections.Generic.Dictionary<LinePoint, bool> _curvedSegments
  392. = new System.Collections.Generic.Dictionary<LinePoint, bool>();
  393. public static new void ShowWindow(IPersistentData data, Vector2 mousePosition)
  394. {
  395. var window = GetWindow<LinePropertiesWindow>(true, "Item properties");
  396. window.Initialize(data, mousePosition);
  397. }
  398. protected override void Initialize(IPersistentData data, Vector2 mousePosition)
  399. {
  400. base.Initialize(data, mousePosition);
  401. _lineData = _data as LineData;
  402. }
  403. private void OnEnable()
  404. {
  405. UnityEditor.Undo.undoRedoPerformed += Repaint;
  406. _skin = Resources.Load<GUISkin>("PWBSkin");
  407. if (_skin == null) return;
  408. _itemRowStyle = _skin.GetStyle("ItemRow");
  409. _deleteIcon = new GUIContent(Resources.Load<Texture2D>("Sprites/Delete2"), "Delete point");
  410. _deleteIconLight = new GUIContent(Resources.Load<Texture2D>("Sprites/LightTheme/Delete2"));
  411. _deleteIconLight.tooltip = _deleteIcon.tooltip;
  412. _itemBtnStyle = _skin.GetStyle("EyeButton");
  413. }
  414. private GUIContent deleteIcon => UnityEditor.EditorGUIUtility.isProSkin ? _deleteIcon : _deleteIconLight;
  415. protected override void ToolPropertiesGUI()
  416. {
  417. if (_skin == null)
  418. {
  419. Close();
  420. return;
  421. }
  422. if (_data == null)
  423. {
  424. Close();
  425. return;
  426. }
  427. void Header()
  428. {
  429. using (new GUILayout.HorizontalScope(_itemRowStyle))
  430. {
  431. UnityEditor.EditorGUILayout.LabelField("Idx", GUILayout.Width(20));
  432. GUILayout.Space(80);
  433. UnityEditor.EditorGUILayout.LabelField("Position", GUILayout.Width(120));
  434. UnityEditor.EditorGUILayout.LabelField("Prev Seg Curved", GUILayout.Width(100));
  435. GUILayout.FlexibleSpace();
  436. }
  437. }
  438. void Row(int idx, LinePoint point)
  439. {
  440. if (_pointsToDelete.Contains(idx)) return;
  441. using (new GUILayout.HorizontalScope(_itemRowStyle))
  442. {
  443. UnityEditor.EditorGUILayout.LabelField(idx.ToString("D2"), GUILayout.Width(20));
  444. using (var check = new UnityEditor.EditorGUI.ChangeCheckScope())
  445. {
  446. var position = _positions.ContainsKey(idx) ? _positions[idx] : point.position;
  447. position = UnityEditor.EditorGUILayout.Vector3Field(string.Empty, position, GUILayout.Width(200));
  448. if (check.changed)
  449. {
  450. if (_positions.ContainsKey(idx)) _positions[idx] = position;
  451. else _positions.Add(idx, position);
  452. }
  453. }
  454. GUILayout.Space(45);
  455. using (var check = new UnityEditor.EditorGUI.ChangeCheckScope())
  456. {
  457. var isCurved = _curvedSegments.ContainsKey(point) ? _curvedSegments[point]
  458. : point.type == LineSegment.SegmentType.CURVE;
  459. isCurved = UnityEditor.EditorGUILayout.Toggle(isCurved, GUILayout.Width(55));
  460. if (check.changed)
  461. {
  462. if (_curvedSegments.ContainsKey(point)) _curvedSegments[point] = isCurved;
  463. else _curvedSegments.Add(point, isCurved);
  464. }
  465. }
  466. GUILayout.Space(10);
  467. if (GUILayout.Button(deleteIcon, _itemBtnStyle)) _pointsToDelete.Add(idx);
  468. GUILayout.FlexibleSpace();
  469. }
  470. }
  471. using (new GUILayout.VerticalScope(UnityEditor.EditorStyles.helpBox))
  472. {
  473. using (var scrollView = new UnityEditor.EditorGUILayout.ScrollViewScope(_pointsScrollPosition,
  474. alwaysShowHorizontal: false, alwaysShowVertical: false,
  475. GUI.skin.horizontalScrollbar, GUI.skin.verticalScrollbar, background: GUIStyle.none))
  476. {
  477. _pointsScrollPosition = scrollView.scrollPosition;
  478. var points = _lineData.controlPoints;
  479. Header();
  480. for (int i = 0; i < points.Length; i++) Row(i, points[i]);
  481. }
  482. }
  483. minSize = new Vector2(400, Mathf.Min(_lineData.pointsCount, 10) * 30 + 100);
  484. GUILayout.Space(10);
  485. }
  486. protected override void Apply()
  487. {
  488. base.Apply();
  489. if (_positions.Count > 0)
  490. {
  491. foreach (var p in _positions)
  492. _lineData.SetPoint(p.Key, p.Value, registerUndo: true, selectAll: false, moveSelection: false);
  493. PWBIO.ApplyPersistentLineAndReset(_lineData);
  494. }
  495. if (_curvedSegments.Count > 0)
  496. {
  497. foreach (var p in _curvedSegments)
  498. p.Key.type = (p.Value) ? LineSegment.SegmentType.CURVE : LineSegment.SegmentType.STRAIGHT;
  499. PWBIO.ApplyPersistentLineAndReset(_lineData);
  500. }
  501. if (_pointsToDelete.Count > 0) PWBIO.DeleteLinePoints(_lineData, _pointsToDelete.ToArray(), ToolManager.editMode);
  502. }
  503. }
  504. #endregion
  505. }