From 446b37e9f5d0cbf0d0fab67913bd9f1a6af220c2 Mon Sep 17 00:00:00 2001 From: JoshuaReason Date: Wed, 7 Aug 2019 11:01:48 +1000 Subject: [PATCH] Update to mass replace to filter to selection --- Assets/Editor/MassReplacer.cs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Assets/Editor/MassReplacer.cs b/Assets/Editor/MassReplacer.cs index 156914b..d8a08e8 100644 --- a/Assets/Editor/MassReplacer.cs +++ b/Assets/Editor/MassReplacer.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using UnityEngine; using UnityEditor; using System; +using System.Linq; /// /// Editor Class used to search and replace objects with prefabs; @@ -49,6 +50,11 @@ public class MassReplacer : EditorWindow { //Advanced Settings GUIStyle BoldFold = new GUIStyle(EditorStyles.foldout); BoldFold.font = EditorStyles.boldFont; //create foldoutstyle with bold text + + + + + showAdvancedSettings = EditorGUILayout.Foldout(showAdvancedSettings, "Advanced Settings", BoldFold); if (showAdvancedSettings) { doCopyScale = EditorGUILayout.Toggle("Copy Scale", doCopyScale); @@ -86,8 +92,11 @@ public class MassReplacer : EditorWindow { replaceFiltedList(); } GUI.enabled = true; - if (GUILayout.Button("Cancel")) { - + if (GUILayout.Button("Filter To Selected")) { + foreach(ListItem item in FilteredList) + { + item.isRepplaceable = Selection.gameObjects.Contains(item.gameObject); + } } GUILayout.EndHorizontal(); // end buttons