void RemoveFromSelected(MovableInfo info) { selected.Remove(info); var position = info.Transform.position; position.z = 0; info.Transform.position = position; }
void AddToSelected(MovableInfo info) { selected.Add(info); var position = info.Transform.position; position.z = OutlineWidth; info.Transform.position = position; }
void SelectCollider(Collider2D collider, List <MovableInfo> add, List <MovableInfo> remove) { var existing = selected.FirstOrDefault(s => s.Transform == collider.transform); if (alt) { if (existing != null) { remove.Add(existing); } } else if (existing == null) { var info = new MovableInfo { Transform = collider.transform, Offset = (Vector2)collider.transform.position - mousePosWorld }; add.Add(info); } }
void UpdateOffset(MovableInfo info) { info.Offset = (Vector2)info.Transform.position - mousePosWorld; }