protected virtual void TaskGrid_CompleteSync()
        {
            gridEvent = GridEvent.Completed;
            SendToServer();

            TaskGrid.SetCompleted();
        }
        // 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);
                }
            }
        }
Exemplo n.º 3
0
        // TODO: remove, for debug testing only
        protected virtual void Update()
        {
            if (Input.GetKeyUp(KeyCode.B))
            {
                OnConfigureExperimentSync();
                StateController.BeginExperiment();
            }
            if (Input.GetKeyUp(KeyCode.N))
            {
                if (TaskGrid.IsConfigured)
                {
                    TaskGrid.SetCompleted();
                }
                StateController.NextState();
            }
            if (Input.GetKeyUp(KeyCode.A))
            {
                OnActivateTaskSync();
                TaskGrid.Configure();
            }
            if (Input.GetKeyUp(KeyCode.S))
            {
                if (TaskGrid.IsConfigured)
                {
                    TaskGrid.SetCompleted();
                }
            }
            if (Input.GetKeyUp(KeyCode.Space))
            {
                if (TaskGrid.IsConfigured)
                {
                    TaskGrid.SetCompleted();
                }
                StateController.NextState();
                OnActivateTaskSync();
                TaskGrid.Configure();
            }

            if (Input.GetKeyUp(KeyCode.Z))
            {
                SetTaskGridModeSync(TaskGrid.InteractionMode.Zoom);
            }
            if (Input.GetKeyUp(KeyCode.X))
            {
                SetTaskGridModeSync(TaskGrid.InteractionMode.Pan);
            }
            if (Input.GetKeyUp(KeyCode.C))
            {
                SetTaskGridModeSync(TaskGrid.InteractionMode.Select);
            }
            if (Input.GetKeyUp(KeyCode.V))
            {
                SetTaskGridModeSync(TaskGrid.InteractionMode.Zoom | TaskGrid.InteractionMode.Pan | TaskGrid.InteractionMode.Select);
            }
        }