From 086df8a4c7bacb641eafe78c9b951f3c20a8c535 Mon Sep 17 00:00:00 2001 From: Faruk Kayaduman Date: Fri, 10 Jun 2022 13:11:47 +0300 Subject: [PATCH] Correction Direction variable name --- Assets/Scripts/BlockManager.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Assets/Scripts/BlockManager.cs b/Assets/Scripts/BlockManager.cs index 04ab9e0..0880884 100644 --- a/Assets/Scripts/BlockManager.cs +++ b/Assets/Scripts/BlockManager.cs @@ -5,14 +5,14 @@ public class BlockManager : MonoBehaviour { - enum Dircetion { x, z } + enum Direction { x, z } enum BlockState { perfect, good, fail} GameSettingData gameData; public BackgroundColorManager background; GameObject currentBlock, preBlock; - Dircetion currentDirection = Dircetion.x; + Direction currentDirection = Direction.x; Vector3 currentBlockScale; @@ -83,7 +83,7 @@ IEnumerator OnUpdate() var spawnPos = new Vector3(); var movePos = new Vector3(); - if (currentDirection == Dircetion.x) + if (currentDirection == Direction.x) { spawnPos.x = -gameData.blockSpawnDistance + preBlock.transform.position.x; spawnPos.y = currentBlockCount; @@ -132,7 +132,7 @@ IEnumerator OnUpdate() } MoveCam(); - currentDirection = (currentDirection == Dircetion.x)? Dircetion.z : Dircetion.x; + currentDirection = (currentDirection == Direction.x)? Direction.z : Direction.x; yield return null; } @@ -158,7 +158,7 @@ void OnBlockPerfect() Vector3 targetBlockScale = currentBlock.transform.localScale; bool blockScaleDirection; - if (currentDirection == Dircetion.x) + if (currentDirection == Direction.x) { if (currentBlock.transform.localScale.x + gameData.perfectScale > gameData.initialBlockScale.x) { @@ -265,7 +265,7 @@ GameObject CutBlock(GameObject block, Vector3 targetPos) float distance = Vector2.Distance(new Vector2(blockPos.x, blockPos.z), new Vector2(targetPos.x, targetPos.z)); - if(currentDirection == Dircetion.x) + if(currentDirection == Direction.x) { block.transform.position = new Vector3( (targetPos.x + blockPos.x) / 2f, blockPos.y, blockPos.z); @@ -296,14 +296,14 @@ BlockState CheckState(GameObject block, GameObject target) { - float dis = currentDirection == Dircetion.x ? + float dis = currentDirection == Direction.x ? Mathf.Abs(block.transform.position.x - target.transform.position.x) : Mathf.Abs(block.transform.position.z - target.transform.position.z); if (dis < gameData.minDistance) return BlockState.perfect; else { - float scale = currentDirection == Dircetion.x ? block.transform.localScale.x : block.transform.localScale.z; + float scale = currentDirection == Direction.x ? block.transform.localScale.x : block.transform.localScale.z; if (scale > dis) {