private void OnLeftDown()
    {
        if (!modifiable)
        {
            return;
        }
        if (orbitCamera != null && !orbitCamera.IsReset())
        {
            return;
        }
        if (boardObject == null)
        {
            boardObject = GetComponent <BoardObject>();
        }
        if (argumentLoader != null)
        {
            argumentLoader.SetBoardObject(boardObject);
        }
        if (cameraInput != null)
        {
            cameraInput.SetDragging(true);
        }

        zCoord      = Camera.main.WorldToScreenPoint(transform.position).z;
        mouseOffset = transform.position - GetMouseWorldPos();
        dragging    = true;

        string name = boardObject.GetName();

        TrackerAsset.Instance.setVar("element_type", name.ToLower());
        TrackerAsset.Instance.setVar("element_name", boardObject.GetNameWithIndex().ToLower());
        TrackerAsset.Instance.setVar("position", lastPos.ToString());
        TrackerAsset.Instance.setVar("rotation", boardObject.GetDirection().ToString().ToLower());
        TrackerAsset.Instance.setVar("action", "pick");
        TrackerAsset.Instance.GameObject.Interacted(boardObject.GetID());
    }
 public void OnMouseButtonDown(int index)
 {
     //Change the type of the cell
     if (index == 0 && modifiable && cell.GetPlacedObject() == null && orbitCamera.IsReset())
     {
         Vector2Int pos = cell.GetPosition();
         boardManager.ReplaceCell(cell.GetNextID(), pos.x, pos.y);
         if (cameraInput != null)
         {
             cameraInput.SetDragging(true);
         }
         TrackerAsset.Instance.setVar("cell_pos", pos.ToString());
         TrackerAsset.Instance.setVar("new_cell_type", cell.GetNextID());
         TrackerAsset.Instance.GameObject.Used("board_cell_change");
     }
 }
    private void Update()
    {
        resetViewButton.interactable = !cameraOrbit.IsReset();

        if (inCreator)
        {
            bool enabled = board.GetNEmitters() == board.GetNReceivers() && board.GetNEmitters() > 0 && !board.AllReceiving();
            changeModeButton.GetComponent <Button>().enabled = enabled;
            changeModeButton.GetComponent <Image>().color    = enabled ? Color.white : Color.red;
        }
        else if (board.BoardCompleted() && !completed)
        {
            completed = true;
            endPanel.SetActive(true);
            blackRect.SetActive(true);
            streamRoom.FinishLevel();
            ProgressManager.Instance.UserCreatedLevel(initialState.ToJson());

            string levelName = GameManager.Instance.GetCurrentLevelName();
            TrackerAsset.Instance.setVar("steps", board.GetCurrentSteps());
            TrackerAsset.Instance.Completable.Completed(levelName, CompletableTracker.Completable.Level, true, -1f);
        }
    }