movement fully working
This commit is contained in:
@@ -71,7 +71,6 @@ public class movement : MonoBehaviour {
|
||||
public GameObject korhazlepes2;
|
||||
|
||||
private Akciopont ap;
|
||||
private Ugynok ugynok;
|
||||
|
||||
private int oneonecount = 0;
|
||||
private int twoonecount = 0;
|
||||
@@ -105,7 +104,6 @@ public class movement : MonoBehaviour {
|
||||
|
||||
void Start() {
|
||||
ap = FindObjectOfType<Akciopont>();
|
||||
ugynok = FindObjectOfType<Ugynok>();
|
||||
|
||||
eromulepes1.SetActive(false);
|
||||
eromulepes2.SetActive(false);
|
||||
@@ -156,96 +154,72 @@ public class movement : MonoBehaviour {
|
||||
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
||||
jelenlegi_x = 1;
|
||||
jelenlegi_y = 1;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
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;
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -671,15 +645,13 @@ public class movement : MonoBehaviour {
|
||||
if (eromulepes1.activeSelf == true & eromulepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0) {
|
||||
player.transform.position = oneone.transform.position;
|
||||
jelenlegi_x = 1;
|
||||
jelenlegi_y = 1;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
oneonecount = oneonecount + 1;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
if (eromulepes1.activeSelf == true) {
|
||||
eromulepes2.SetActive(true);
|
||||
moveCounter++;
|
||||
@@ -707,7 +679,8 @@ public class movement : MonoBehaviour {
|
||||
if (feketepiaclepes1.activeSelf == true & feketepiaclepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (jelenlegi_x == 1 && jelenlegi_y == 2)
|
||||
{
|
||||
tavolsag = 2;
|
||||
@@ -719,8 +692,6 @@ public class movement : MonoBehaviour {
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
twoonecount = twoonecount + 1;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
if (feketepiaclepes1.activeSelf == true) {
|
||||
feketepiaclepes2.SetActive(true);
|
||||
moveCounter++;
|
||||
@@ -752,7 +723,8 @@ public class movement : MonoBehaviour {
|
||||
if (metrolepes1.activeSelf == true & metrolepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (threeonecount < 2) {
|
||||
player.transform.position = threeone.transform.position;
|
||||
jelenlegi_x = 3;
|
||||
@@ -760,8 +732,6 @@ public class movement : MonoBehaviour {
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
threeonecount++;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
if (metrolepes1.activeSelf == true) {
|
||||
metrolepes2.SetActive(true);
|
||||
moveCounter++;
|
||||
@@ -793,7 +763,8 @@ public class movement : MonoBehaviour {
|
||||
if (szervereklepes1.activeSelf == true & szervereklepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (jelenlegi_x == 2 && jelenlegi_y == 1)
|
||||
{
|
||||
tavolsag = 2;
|
||||
@@ -805,8 +776,6 @@ public class movement : MonoBehaviour {
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
onetwocount++;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
if (szervereklepes1.activeSelf == true) {
|
||||
szervereklepes2.SetActive(true);
|
||||
moveCounter++;
|
||||
@@ -838,15 +807,14 @@ public class movement : MonoBehaviour {
|
||||
if (kingcasinolepes1.activeSelf == true & kingcasinolepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (twotwocount < 2) {
|
||||
player.transform.position = twotwo.transform.position;
|
||||
jelenlegi_x = 2;
|
||||
jelenlegi_y = 2;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
twotwocount++;
|
||||
if (kingcasinolepes1.activeSelf == true) {
|
||||
kingcasinolepes2.SetActive(true);
|
||||
@@ -880,7 +848,8 @@ public class movement : MonoBehaviour {
|
||||
if (feltoltolepes1.activeSelf == true & feltoltolepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (jelenlegi_x == 2 && jelenlegi_y == 3)
|
||||
{
|
||||
tavolsag = 2;
|
||||
@@ -891,8 +860,6 @@ public class movement : MonoBehaviour {
|
||||
jelenlegi_y = 2;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
threetwocount++;
|
||||
if (feltoltolepes1.activeSelf == true) {
|
||||
feltoltolepes2.SetActive(true);
|
||||
@@ -926,15 +893,14 @@ public class movement : MonoBehaviour {
|
||||
if (kutatolaborlepes1.activeSelf == true & kutatolaborlepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (onethreecount < 2) {
|
||||
player.transform.position = onethree.transform.position;
|
||||
jelenlegi_x = 1;
|
||||
jelenlegi_y = 3;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
onethreecount++;
|
||||
if (kutatolaborlepes1.activeSelf == true) {
|
||||
kutatolaborlepes2.SetActive(true);
|
||||
@@ -968,7 +934,8 @@ public class movement : MonoBehaviour {
|
||||
if (kriptoklublepes1.activeSelf == true & kriptoklublepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (jelenlegi_x == 3 && jelenlegi_y == 2)
|
||||
{
|
||||
tavolsag = 2;
|
||||
@@ -979,8 +946,6 @@ public class movement : MonoBehaviour {
|
||||
jelenlegi_y = 3;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
twothreecount++;
|
||||
if (kriptoklublepes1.activeSelf == true) {
|
||||
kriptoklublepes2.SetActive(true);
|
||||
@@ -1015,15 +980,14 @@ public class movement : MonoBehaviour {
|
||||
if (cyberplazalepes1.activeSelf == true & cyberplazalepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (threethreecount < 2) {
|
||||
player.transform.position = threethree.transform.position;
|
||||
jelenlegi_x = 3;
|
||||
jelenlegi_y = 3;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
threethreecount++;
|
||||
if (cyberplazalepes1.activeSelf == true) {
|
||||
cyberplazalepes2.SetActive(true);
|
||||
@@ -1057,15 +1021,14 @@ public class movement : MonoBehaviour {
|
||||
if (hadiuzemlepes1.activeSelf == true & hadiuzemlepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (onefourcount < 2) {
|
||||
player.transform.position = onefour.transform.position;
|
||||
jelenlegi_x = 1;
|
||||
jelenlegi_y = 4;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
onefourcount++;
|
||||
if (hadiuzemlepes1.activeSelf == true) {
|
||||
hadiuzemlepes2.SetActive(true);
|
||||
@@ -1099,15 +1062,14 @@ public class movement : MonoBehaviour {
|
||||
if (konyvtarlepes1.activeSelf == true & konyvtarlepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (twofourcount < 2) {
|
||||
player.transform.position = twofour.transform.position;
|
||||
jelenlegi_x = 2;
|
||||
jelenlegi_y = 4;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
twofourcount++;
|
||||
if (konyvtarlepes1.activeSelf == true) {
|
||||
konyvtarlepes2.SetActive(true);
|
||||
@@ -1141,15 +1103,14 @@ public class movement : MonoBehaviour {
|
||||
if (korhazlepes1.activeSelf == true & korhazlepes2.activeSelf == true) {
|
||||
Debug.Log("Maximum k<>tszer l<>phetsz egy mez<65>re");
|
||||
} else {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0) {
|
||||
if (tavolsag <= ap.akciopont && ap.akciopont > 0 && tavolsag != 0)
|
||||
{
|
||||
if (threefourcount < 2) {
|
||||
player.transform.position = threefour.transform.position;
|
||||
jelenlegi_x = 3;
|
||||
jelenlegi_y = 4;
|
||||
ap.akciopont = ap.akciopont - tavolsag;
|
||||
Debug.Log(ap.akciopont);
|
||||
//Ugynokok sorsorlasa a helyre
|
||||
ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
||||
threefourcount++;
|
||||
if (korhazlepes1.activeSelf == true) {
|
||||
korhazlepes2.SetActive(true);
|
||||
|
||||
Reference in New Issue
Block a user