Skip to content
Snippets Groups Projects
Commit 3748ccb4 authored by Lama Amro's avatar Lama Amro :face_palm_tone3:
Browse files

Update markMineEasy.cs

parent 8e64fcd3
No related branches found
No related tags found
No related merge requests found
...@@ -27,7 +27,9 @@ public class markMineEasy : MonoBehaviour ...@@ -27,7 +27,9 @@ public class markMineEasy : MonoBehaviour
{ {
charPos = GameObject.FindGameObjectWithTag("Player").transform.position; charPos = GameObject.FindGameObjectWithTag("Player").transform.position; // detects the character's position.
// for each number pressed, a new position will be specified by changing the values of the character's (x,z) position to add the marking object
if (Input.GetKeyDown("[1]")) if (Input.GetKeyDown("[1]"))
{ {
...@@ -121,7 +123,7 @@ public class markMineEasy : MonoBehaviour ...@@ -121,7 +123,7 @@ public class markMineEasy : MonoBehaviour
} }
if( Input.GetMouseButtonDown(0) ) if( Input.GetMouseButtonDown(0) ) // the code for unmarking. it detects the position of the mouse and delete the object there only if it was a marking object
{ {
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
...@@ -135,7 +137,7 @@ public class markMineEasy : MonoBehaviour ...@@ -135,7 +137,7 @@ public class markMineEasy : MonoBehaviour
Debug.Log( "minecount " + num); Debug.Log( "minecount " + num);
Debug.Log( "capcount " + counter); Debug.Log( "capcount " + counter);
if(num==10) if(num==10) // To check if all mines were marked
{ {
SceneManager.LoadScene(4); SceneManager.LoadScene(4);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment