// Methods public void SyncGrid(TaskGrid taskGrid) { if (gridEvent == GridEvent.Completed) { taskGrid.SetCompleted(); } else if (gridEvent == GridEvent.SetDragging) { taskGrid.SetDragged(isDragging); } else if (gridEvent == GridEvent.SetZooming) { taskGrid.SetZoomed(isZooming); } else { var container = taskGrid.At(new Vector2Int((int)containerPosition.x, (int)containerPosition.y)); if (gridEvent == GridEvent.ItemSelected) { var item = container.Elements[itemIndex]; taskGrid.SetItemSelected(item, container); } else if (gridEvent == GridEvent.ItemMoved) { taskGrid.SetItemMoved(container); } } }
protected virtual void TaskGrid_ItemSelectSync(Item item) { var container = TaskGrid.GetContainer(item); containerPosition = TaskGrid.GetPosition(container); itemIndex = container.Elements.IndexOf(item); gridEvent = GridEvent.ItemSelected; SendToServer(); TaskGrid.SetItemSelected(item, container); }