Skip to content

Commit

Permalink
인게임 탱크 방향 랜덤화
Browse files Browse the repository at this point in the history
  • Loading branch information
zabd0ng authored May 29, 2024
1 parent 03ac344 commit dfc8697
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Assets/2Scripts/Tank/TankHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ private void Awake()
tankUIHandler = GetComponent<TankUIHandler>(); // 탱크 UI 핸들러 컴포넌트 할당
rayOffset = new Vector3(0.15f,0,0);
powerCoefficient = InGameManager.IT.powerCoefficient;
direction = Random.Range(0f, 1f) >= 0.5f ?
1 : -1;
}

public virtual void Start()
Expand Down Expand Up @@ -107,13 +109,13 @@ private void Update()
}

if (Input.GetKey(KeyCode.LeftArrow)) // 카메라 왼쪽으로 이동
InGameManager.IT.CamMove(-0.15f, 0);
InGameManager.IT.CamMove(-0.2f, 0);
else if (Input.GetKey(KeyCode.RightArrow)) // Right
InGameManager.IT.CamMove(0.15f, 0);
InGameManager.IT.CamMove(0.2f, 0);
else if (Input.GetKey(KeyCode.UpArrow)) // Up
InGameManager.IT.CamMove(0, 0.15f);
InGameManager.IT.CamMove(0, 0.2f);
else if (Input.GetKey(KeyCode.DownArrow)) // Up
InGameManager.IT.CamMove(0, -0.15f);
InGameManager.IT.CamMove(0, -0.2f);

return; // 줌인 중에는 탱크 못움직이게
} else if (Input.GetKeyUp(KeyCode.Z)) {
Expand Down

0 comments on commit dfc8697

Please sign in to comment.