| | 1 | | using System; |
| | 2 | |
|
| | 3 | | public interface IDragAndDropSceneObjectController |
| | 4 | | { |
| | 5 | | event Action OnDrop; |
| | 6 | |
|
| | 7 | | void Initialize(IDragAndDropSceneObjectView dragAndDropSceneObjectView); |
| | 8 | | void Dispose(); |
| | 9 | | void Drop(); |
| | 10 | | } |
| | 11 | |
|
| | 12 | | public class DragAndDropSceneObjectController : IDragAndDropSceneObjectController |
| | 13 | | { |
| | 14 | | public event Action OnDrop; |
| | 15 | |
|
| | 16 | | private IDragAndDropSceneObjectView dragAndDropSceneObjectView; |
| | 17 | |
|
| | 18 | | public void Initialize(IDragAndDropSceneObjectView dragAndDropSceneObjectView) |
| | 19 | | { |
| 2 | 20 | | this.dragAndDropSceneObjectView = dragAndDropSceneObjectView; |
| | 21 | |
|
| 2 | 22 | | dragAndDropSceneObjectView.OnDrop += Drop; |
| 2 | 23 | | } |
| | 24 | |
|
| 4 | 25 | | public void Dispose() { dragAndDropSceneObjectView.OnDrop -= Drop; } |
| | 26 | |
|
| 2 | 27 | | public void Drop() { OnDrop?.Invoke(); } |
| | 28 | | } |