public bool Swap(Transform model) { ModelReference reference = _modelReference.FirstOrDefault(m => m.Model == model); if (reference == null) { return(false); } ModelSwapper swapper = new ModelSwapper(reference); swapper.Match(transform); currentModel = model; return(true); }
private void LogGUI(Transform model) { if (!_modelFoldout.ContainsKey(model)) { _modelFoldout[model] = false; } _modelFoldout[model] = EditorGUILayout.Foldout(_modelFoldout[model], model.name); if (_modelFoldout[model]) { var tgts = targets.Cast <MultiModel>().ToArray(); foreach (var tgt in tgts) { using (new Vertical("Box")) { ModelSwapper swapper = new ModelSwapper(tgt[model]); swapper.dryRun = true; _indent = 0; swapper.Match(tgt.transform).ForEach(LogEntryGUI); } } } }