Skip to content
Snippets Groups Projects
Commit 47662271 authored by Meike Wienholt's avatar Meike Wienholt
Browse files

miigame

parent e8b2ed97
No related branches found
No related tags found
1 merge request!16Meike develope
...@@ -41,6 +41,8 @@ public class BackToGame : MonoBehaviour ...@@ -41,6 +41,8 @@ public class BackToGame : MonoBehaviour
follower1.GetComponent<MeshRenderer>().enabled = false; follower1.GetComponent<MeshRenderer>().enabled = false;
cursor.GetComponent<CursorChanger>().normalCursorId = 0; cursor.GetComponent<CursorChanger>().normalCursorId = 0;
cursor.GetComponent<CursorChanger>().searchCursorId = 3; cursor.GetComponent<CursorChanger>().searchCursorId = 3;
cursor.GetComponent<TestCamera>().maxX = 10.24f;
cursor.GetComponent<TestCamera>().minX = -10.24f;
OnMouseDown(); OnMouseDown();
} }
} }
...@@ -53,6 +55,7 @@ public class BackToGame : MonoBehaviour ...@@ -53,6 +55,7 @@ public class BackToGame : MonoBehaviour
if (GoBack) if (GoBack)
{ {
SceneManager.LoadScene(sceneName); SceneManager.LoadScene(sceneName);
} }
} }
} }
......
This diff is collapsed.
...@@ -85,7 +85,7 @@ public class CursorChanger : MonoBehaviour { ...@@ -85,7 +85,7 @@ public class CursorChanger : MonoBehaviour {
Cursor.SetCursor(null, Vector2.zero, cursorMode); Cursor.SetCursor(null, Vector2.zero, cursorMode);
} }
Debug.Log(cursors.ToString());
} }
......
...@@ -15,7 +15,7 @@ public class MainMenu : MonoBehaviour ...@@ -15,7 +15,7 @@ public class MainMenu : MonoBehaviour
public void PlayGame() public void PlayGame()
{ {
//starts the game in this scene. For testing you can change it to whatever scene you are working on. //starts the game in this scene. For testing you can change it to whatever scene you are working on.
SceneManager.LoadScene("Maschinenraum"); SceneManager.LoadScene("EisWagon");
// waits for 1. The f is for float // waits for 1. The f is for float
Time.timeScale = 1f; Time.timeScale = 1f;
//activates the inventory button //activates the inventory button
......
...@@ -35,10 +35,7 @@ public class TestCamera : MonoBehaviour ...@@ -35,10 +35,7 @@ public class TestCamera : MonoBehaviour
var entity = Database.core.entities[SupportFunctions.core.findEntityIndexById(115)]; var entity = Database.core.entities[SupportFunctions.core.findEntityIndexById(115)];
//Scene scene = S //Scene scene = S
for(int i = 0; i < 12; i++)
{
Debug.Log(SupportFunctions.core.findLocationNameById(i) + i );
}
if (LevelLoader.core.loaded_Scenes.Contains(6)) if (LevelLoader.core.loaded_Scenes.Contains(6))
{ {
minX = SchaffnerMinX; minX = SchaffnerMinX;
...@@ -54,14 +51,18 @@ public class TestCamera : MonoBehaviour ...@@ -54,14 +51,18 @@ public class TestCamera : MonoBehaviour
minX = -0.4f; minX = -0.4f;
maxX = -0.4f; maxX = -0.4f;
z = -5; z = -5;
Debug.Log("FUCK ME IN MA LONG DONG"); //Debug.Log("FUCK ME IN MA LONG DONG");
} else
{
minX = -10.24f;
maxX = 10.24f;
} }
if (player.transform.position.x < maxX && player.transform.position.x > minX) if (player.transform.position.x < maxX && player.transform.position.x > minX)
{ {
cam.transform.position = new Vector3(player.transform.position.x, 0, z); cam.transform.position = new Vector3(player.transform.position.x, 0, z);
//cam.transform.position.Set( player.transform.position.x, 0, -10); //cam.transform.position.Set( player.transform.position.x, 0, -10);
//print(player.transform.position.x); //print(player.transform.position.x);
print("2 : " + cam.transform.position); //print("2 : " + cam.transform.position);
} }
......
...@@ -5,8 +5,9 @@ using UnityEngine; ...@@ -5,8 +5,9 @@ using UnityEngine;
public class wimmelbild : MonoBehaviour public class wimmelbild : MonoBehaviour
{ {
// public GameObject text; // public GameObject text;
// Start is called before the first frame update // Start is called before the first frame update
List<int> destroyed = new List<int>();
void Start() void Start()
{ {
...@@ -15,24 +16,109 @@ public class wimmelbild : MonoBehaviour ...@@ -15,24 +16,109 @@ public class wimmelbild : MonoBehaviour
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
searchBild();
} }
void searchBild() void searchBild()
{ {
if (Input.GetMouseButtonDown(0)) if (Input.GetMouseButtonDown(0))
{ {
Vector2 point = Camera.main.ScreenToWorldPoint(Input.mousePosition); OnMouseDown();
//Creating the raycast. Note that a mask is being applied with "~" being used to exclude a specific layer. The latter layer is only used for movement direction detection.
RaycastHit2D h = Physics2D.Raycast(point, Vector2.zero, Mathf.Infinity, ~(1 << LayerMask.NameToLayer("MovementCatcher")));
if (h.collider.tag.Equals("rad"))
{
OnMouseDown();
}
} }
} }
void OnMouseDown() void OnMouseDown()
{ {
Debug.Log("I HAVE FOUND THE WAY"); var text = GameObject.Find("TextMesh");
Vector2 point = Camera.main.ScreenToWorldPoint(Input.mousePosition);
//Creating the raycast. Note that a mask is being applied with "~" being used to exclude a specific layer. The latter layer is only used for movement direction detection.
RaycastHit2D h = Physics2D.Raycast(point, Vector2.zero, Mathf.Infinity, ~(1 << LayerMask.NameToLayer("MovementCatcher")));
//print(h.collider.tag);
if (h.collider.name.Equals("1")){
var one = GameObject.Find("1");
Destroy(one);
destroyed.Add(1);
}
if (h.collider.name.Equals("2"))
{
var one = GameObject.Find("2");
Destroy(one);
destroyed.Add(1);
} else if (h.collider.name.Equals("3"))
{
var one = GameObject.Find("3");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("4"))
{
var one = GameObject.Find("4");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("5"))
{
var one = GameObject.Find("5");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("6"))
{
var one = GameObject.Find("6");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("7"))
{
var one = GameObject.Find("7");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("8"))
{
var one = GameObject.Find("8");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("9"))
{
var one = GameObject.Find("9");
Destroy(one);
destroyed.Add(1);
}
else if (h.collider.name.Equals("10"))
{
var one = GameObject.Find("10");
Destroy(one);
destroyed.Add(1);
}
text.GetComponent<TextMesh>().text = destroyed.Count + "/10";
if(destroyed.Count == 10)
{
Debug.Log("I HAVE WON THE GAME");
//Spiel nicht mehr betretbar
// Kohleschauflerin weiter dialog
}
} }
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment