public void CalculateCameraSize() { float ratio = (float)Screen.height / Screen.width; float myHight = PlayerPrefController.GetSizeValue() * 3 * (ratio >= 1?ratio:1); float ortSize = myHight / 2f; Camera.main.orthographicSize = Mathf.RoundToInt(ortSize + 0.5f); }
private void Awake() { sizeCellMass = PlayerPrefController.GetSizeValue(); countCrossCells = PlayerPrefController.GetCrossedValue(); if (sizeCellMass < 3) { sizeCellMass = 3; } if (countCrossCells < 3) { countCrossCells = 3; } logic = MainLogic.instance; cellMass = new Cell[sizeCellMass, sizeCellMass]; isRoundStarted = true; EmptyCells = sizeCellMass * sizeCellMass; }
private void LoadSavedData() { optionCrossed.value = PlayerPrefController.GetCrossedValue() - 3; optionSize.value = PlayerPrefController.GetSizeValue() - 3; }
private void Start() { logic = MainLogic.instance; fieldSize = PlayerPrefController.GetSizeValue() != 0 ? PlayerPrefController.GetSizeValue() : 3; crossedCellsCount = PlayerPrefController.GetCrossedValue() != 0 ? PlayerPrefController.GetCrossedValue() : 3; }