ugynok sorsolas mukodik

This commit is contained in:
2023-01-20 11:58:31 +01:00
parent 3da9374986
commit 4ef2965968
4 changed files with 649 additions and 1228 deletions

View File

@@ -18,6 +18,60 @@ public class Ugynok : MonoBehaviour
public TMP_Text[] twofour;
public TMP_Text[] threefour;
private void Start() {
for (int i = 0; i < oneone.Length; i++)
{
oneone[i].text = "";
}
for (int i = 0; i < onetwo.Length; i++)
{
onetwo[i].text = "";
}
for (int i = 0; i < onethree.Length; i++)
{
onethree[i].text = "";
}
for (int i = 0; i < onefour.Length; i++)
{
onefour[i].text = "";
}
for (int i = 0; i < twoone.Length; i++)
{
twoone[i].text = "";
}
for (int i = 0; i < twotwo.Length; i++)
{
twotwo[i].text = "";
}
for (int i = 0; i < twothree.Length; i++)
{
twothree[i].text = "";
}
for (int i = 0; i < twofour.Length; i++)
{
twofour[i].text = "";
}
for (int i = 0; i < threeone.Length; i++)
{
threeone[i].text = "";
}
for (int i = 0; i < threetwo.Length; i++)
{
threetwo[i].text = "";
}
for (int i = 0; i < threethree.Length; i++)
{
threethree[i].text = "";
}
for (int i = 0; i < threefour.Length; i++)
{
threefour[i].text = "";
}
}
public void UgynokSorsolas(int x, int y) {
if (x == 1 && y == 1) {
if (oneone[0].text.Equals("")) {

View File

@@ -71,6 +71,7 @@ public class movement : MonoBehaviour {
public GameObject korhazlepes2;
private Akciopont ap;
private Ugynok ugynok;
private int oneonecount = 0;
private int twoonecount = 0;
@@ -104,6 +105,7 @@ public class movement : MonoBehaviour {
void Start() {
ap = FindObjectOfType<Akciopont>();
ugynok = FindObjectOfType<Ugynok>();
eromulepes1.SetActive(false);
eromulepes2.SetActive(false);
@@ -154,72 +156,84 @@ public class movement : MonoBehaviour {
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 1;
jelenlegi_y = 1;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 2) {
player.transform.position = twoone.transform.position;
feketepiaclepes1.SetActive(true);
feketepiaclepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 2;
jelenlegi_y = 1;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 3) {
player.transform.position = threeone.transform.position;
metrolepes1.SetActive(true);
metrolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 3;
jelenlegi_y = 1;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 4) {
player.transform.position = onetwo.transform.position;
szervereklepes1.SetActive(true);
szervereklepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 1;
jelenlegi_y = 2;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 5) {
player.transform.position = twotwo.transform.position;
kingcasinolepes1.SetActive(true);
kingcasinolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 2;
jelenlegi_y = 2;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 6) {
player.transform.position = threetwo.transform.position;
feltoltolepes1.SetActive(true);
feltoltolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 3;
jelenlegi_y = 2;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 7) {
player.transform.position = onethree.transform.position;
kutatolaborlepes1.SetActive(true);
kutatolaborlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 1;
jelenlegi_y = 3;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 8) {
player.transform.position = twothree.transform.position;
kriptoklublepes1.SetActive(true);
kriptoklublepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 2;
jelenlegi_y = 3;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 9) {
player.transform.position = threethree.transform.position;
cyberplazalepes1.SetActive(true);
cyberplazalepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 3;
jelenlegi_y = 3;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 10) {
player.transform.position = onefour.transform.position;
hadiuzemlepes1.SetActive(true);
hadiuzemlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 1;
jelenlegi_y = 4;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 11) {
player.transform.position = twofour.transform.position;
konyvtarlepes1.SetActive(true);
konyvtarlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 2;
jelenlegi_y = 4;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
} else if (random == 12) {
player.transform.position = threefour.transform.position;
korhazlepes1.SetActive(true);
korhazlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
jelenlegi_x = 3;
jelenlegi_y = 4;
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
}
}
@@ -652,6 +666,8 @@ public class movement : MonoBehaviour {
ap.akciopont = ap.akciopont - tavolsag;
oneonecount = oneonecount + 1;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
if (eromulepes1.activeSelf == true) {
eromulepes2.SetActive(true);
moveCounter++;
@@ -691,7 +707,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 1;
ap.akciopont = ap.akciopont - tavolsag;
twoonecount = twoonecount + 1;
Debug.Log(ap.akciopont);
Debug.Log(ap.akciopont);Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
if (feketepiaclepes1.activeSelf == true) {
feketepiaclepes2.SetActive(true);
moveCounter++;
@@ -731,7 +748,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 1;
ap.akciopont = ap.akciopont - tavolsag;
threeonecount++;
Debug.Log(ap.akciopont);
Debug.Log(ap.akciopont);Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
if (metrolepes1.activeSelf == true) {
metrolepes2.SetActive(true);
moveCounter++;
@@ -776,6 +794,8 @@ public class movement : MonoBehaviour {
ap.akciopont = ap.akciopont - tavolsag;
onetwocount++;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
if (szervereklepes1.activeSelf == true) {
szervereklepes2.SetActive(true);
moveCounter++;
@@ -815,6 +835,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 2;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
twotwocount++;
if (kingcasinolepes1.activeSelf == true) {
kingcasinolepes2.SetActive(true);
@@ -860,6 +882,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 2;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
threetwocount++;
if (feltoltolepes1.activeSelf == true) {
feltoltolepes2.SetActive(true);
@@ -901,6 +925,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 3;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
onethreecount++;
if (kutatolaborlepes1.activeSelf == true) {
kutatolaborlepes2.SetActive(true);
@@ -946,6 +972,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 3;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
twothreecount++;
if (kriptoklublepes1.activeSelf == true) {
kriptoklublepes2.SetActive(true);
@@ -988,6 +1016,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 3;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
threethreecount++;
if (cyberplazalepes1.activeSelf == true) {
cyberplazalepes2.SetActive(true);
@@ -1029,6 +1059,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 4;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
onefourcount++;
if (hadiuzemlepes1.activeSelf == true) {
hadiuzemlepes2.SetActive(true);
@@ -1070,6 +1102,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 4;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
twofourcount++;
if (konyvtarlepes1.activeSelf == true) {
konyvtarlepes2.SetActive(true);
@@ -1111,6 +1145,8 @@ public class movement : MonoBehaviour {
jelenlegi_y = 4;
ap.akciopont = ap.akciopont - tavolsag;
Debug.Log(ap.akciopont);
Debug.Log("ugynok sorsolas");
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
threefourcount++;
if (korhazlepes1.activeSelf == true) {
korhazlepes2.SetActive(true);