Skip to content

Commit

Permalink
LockCursorMiniGame
Browse files Browse the repository at this point in the history
  • Loading branch information
Giraud-Pierre committed Nov 14, 2022
1 parent 9641a93 commit 08dd76b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions Assets/Scripts/MiniGame/EnnemyController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ private void OnCollisionEnter(Collision collision) //gère la collision des enne
{
dataForMiniGame.isWin = true;
Destroy(gameObject);
Cursor.lockState = CursorLockMode.Confined;
dataForMiniGame.hexmap.EndMinigame();
SceneManager.LoadScene(1);
}
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/MiniGame/PlayerController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public class PlayerController : MonoBehaviour

void Start()
{
Cursor.lockState = CursorLockMode.Locked;
prefabTarget = dataForMiniGame.ennemyPrefab;
GameObject enemy = Instantiate(prefabTarget, new Vector3(-34f, 3.6f, 55.02f), Quaternion.identity);
enemy.layer = 7;
Expand Down Expand Up @@ -52,6 +53,7 @@ private void OnCollisionEnter(Collision collision)
//End the game and unit lose PV
Destroy(collision.gameObject);
dataForMiniGame.isWin = false;
Cursor.lockState = CursorLockMode.Confined;
dataForMiniGame.hexmap.EndMinigame();
SceneManager.LoadScene(1);
}
Expand Down

0 comments on commit 08dd76b

Please sign in to comment.