public void ChangeMode(bool fromButton) { inCreator = !inCreator; levelObjects.SetActive(!inCreator); levelCanvas.SetActive(!inCreator); levelButtons.SetActive(!inCreator); creatorObjects.SetActive(inCreator); creatorCanvas.SetActive(inCreator); board.SetModifiable(inCreator); if (!inCreator) { completed = false; initialState = board.GetBoardState(); cameraFit.SetViewPort(levelViewport); changeModeButton.GetComponent <Image>().sprite = changeToEditModeSprite; board.SetFocusPointOffset(new Vector3((board.GetColumns() - 2) / 2.0f + 0.5f, 0.0f, (board.GetRows() - 2) / 2.0f + 0.5f)); cameraFit.FitBoard(board.GetRows(), board.GetColumns()); string boardState = board.GetBoardStateAsFormatedString(); if (fromButton) { TrackerAsset.Instance.setVar("mode", "test"); TrackerAsset.Instance.setVar("board", boardState != boardString ? boardState : "unchanged"); } boardString = boardState; } else { cameraOrbit.ResetInmediate(); cameraZoom.ResetInmediate(); cameraFit.SetViewPort(creatorViewPort); changeModeButton.GetComponent <Image>().sprite = changeToPlayModeSprite; boardCreator.FitBoard(); if (fromButton) { TrackerAsset.Instance.setVar("mode", "edition"); } } if (fromButton) { TrackerAsset.Instance.GameObject.Interacted("editor_mode_change_button"); } if (inCreator) { TrackerAsset.Instance.Accessible.Accessed("editor"); } else { TrackerAsset.Instance.Accessible.Accessed("tester"); } }