public void SelectEntry(int id) { IRenderer NewObject = GetAsset(id); IRenderer OldObject = GetAsset(selectedID); if (selectedID == id) { return; } if (NewObject != null) { if (OldObject != null) { OldObject.Unselect(); } TranslationGizmo.OnSelectEntry(NewObject.Transform, true); NewObject.Select(); selectionBox.DoRender = true; selectionBox.SetTransform(NewObject.Transform); selectionBox.Update(NewObject.BoundingBox); selectedID = id; } }
public void SelectEntry(int id) { IRenderer newObj, oldObj; bool foundNew = Assets.TryGetValue(id, out newObj); bool foundOld = Assets.TryGetValue(selectedID, out oldObj); if (selectedID == id) { return; } if (foundNew) { if (foundOld) { oldObj.Unselect(); } TranslationGizmo.OnSelectEntry(newObj.Transform, true); newObj.Select(); selectionBox.DoRender = true; selectionBox.SetTransform(newObj.Transform); selectionBox.Update(newObj.BoundingBox); selectedID = id; } }