public ModelReference GetReferenceOrNew(Transform model) { ModelReference reference = _modelReference.FirstOrDefault(m => m.Model == model); if (reference != null) { reference.Update(transform, model, _bakeBones); return(reference); } return(new ModelReference(transform, model, _bakeBones)); }
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); }
public ModelSwapper(ModelReference reference) { _reference = reference; }