2022-11-02 07:41:58 +01:00
|
|
|
using System;
|
2022-11-01 18:07:06 +01:00
|
|
|
using System.Collections;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using UnityEngine;
|
2022-11-02 11:15:11 +01:00
|
|
|
using Unity.Mathematics;
|
2022-11-12 12:18:08 +01:00
|
|
|
using TMPro;
|
2023-07-03 17:48:33 +02:00
|
|
|
using UnityEngine.UI;
|
2022-11-01 18:07:06 +01:00
|
|
|
|
2022-11-02 17:24:55 +01:00
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
public class movement : MonoBehaviour
|
|
|
|
|
{
|
2022-11-01 18:07:06 +01:00
|
|
|
public Camera THE_Camera;
|
2022-11-12 12:18:08 +01:00
|
|
|
public GameObject player;
|
2022-11-01 18:07:06 +01:00
|
|
|
|
|
|
|
|
public GameObject oneone;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D oneone_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject eromulepes1;
|
|
|
|
|
public GameObject eromulepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject twoone;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D twoone_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject feketepiaclepes1;
|
|
|
|
|
public GameObject feketepiaclepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject threeone;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D threeone_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject metrolepes1;
|
|
|
|
|
public GameObject metrolepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject onetwo;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D onetwo_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject szervereklepes1;
|
|
|
|
|
public GameObject szervereklepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject twotwo;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D twotwo_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject kingcasinolepes1;
|
|
|
|
|
public GameObject kingcasinolepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject threetwo;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D threetwo_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject feltoltolepes1;
|
|
|
|
|
public GameObject feltoltolepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject onethree;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D onethree_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject kutatolaborlepes1;
|
|
|
|
|
public GameObject kutatolaborlepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject twothree;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D twothree_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject kriptoklublepes1;
|
|
|
|
|
public GameObject kriptoklublepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject threethree;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D threethree_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject cyberplazalepes1;
|
|
|
|
|
public GameObject cyberplazalepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject onefour;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D onefour_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject hadiuzemlepes1;
|
|
|
|
|
public GameObject hadiuzemlepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject twofour;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D twofour_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject konyvtarlepes1;
|
|
|
|
|
public GameObject konyvtarlepes2;
|
2022-11-02 07:41:58 +01:00
|
|
|
|
2022-11-01 18:07:06 +01:00
|
|
|
public GameObject threefour;
|
2022-11-02 07:41:58 +01:00
|
|
|
public Collider2D threefour_Collider;
|
2022-11-11 13:42:40 +01:00
|
|
|
public GameObject korhazlepes1;
|
2022-11-22 14:45:32 +01:00
|
|
|
public GameObject korhazlepes2;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
|
|
|
|
private Akciopont ap;
|
2023-01-20 11:58:31 +01:00
|
|
|
private Ugynok ugynok;
|
2023-01-23 13:03:35 +01:00
|
|
|
private Targyak targyak;
|
2023-03-29 15:49:35 +02:00
|
|
|
private jatekmanager jatekmanager;
|
2023-04-09 17:21:06 +02:00
|
|
|
private Dice dice;
|
2023-04-18 21:14:04 +02:00
|
|
|
private Kezdohelyszin kezdohelyszin;
|
2023-07-03 17:48:33 +02:00
|
|
|
private MessageBox messageBox;
|
2022-11-12 12:18:08 +01:00
|
|
|
|
|
|
|
|
private int oneonecount = 0;
|
|
|
|
|
private int twoonecount = 0;
|
|
|
|
|
private int threeonecount = 0;
|
|
|
|
|
private int onetwocount = 0;
|
|
|
|
|
private int twotwocount = 0;
|
|
|
|
|
private int threetwocount = 0;
|
|
|
|
|
private int onethreecount = 0;
|
|
|
|
|
private int twothreecount = 0;
|
|
|
|
|
private int threethreecount = 0;
|
|
|
|
|
private int onefourcount = 0;
|
|
|
|
|
private int twofourcount = 0;
|
|
|
|
|
private int threefourcount = 0;
|
2022-11-12 17:48:50 +01:00
|
|
|
|
2022-11-12 12:18:08 +01:00
|
|
|
private int w = 3; //ennyi oszlop van a mapon
|
|
|
|
|
private int h = 4; //ennyi sor van a mapon
|
2022-11-12 17:48:50 +01:00
|
|
|
|
2022-11-16 11:23:25 +01:00
|
|
|
public int jelenlegi_x = 1;
|
|
|
|
|
public int jelenlegi_y = 1;
|
2023-07-03 17:48:33 +02:00
|
|
|
//private int tavolsag = 0;
|
2022-11-12 12:18:08 +01:00
|
|
|
private int moveCounter = 1;
|
|
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
//move confirm
|
|
|
|
|
private bool biztosoda = true; //meg nem mukodik addig true
|
|
|
|
|
[SerializeField] private Button confirmMove;
|
|
|
|
|
[SerializeField] private Button cancelMove;
|
|
|
|
|
[SerializeField] private GameObject parentMoveConfirm;
|
|
|
|
|
|
|
|
|
|
public void EnableButtons(bool isEnabled)
|
|
|
|
|
{
|
|
|
|
|
parentMoveConfirm.SetActive(isEnabled);
|
|
|
|
|
}
|
|
|
|
|
|
2023-03-29 11:06:00 +02:00
|
|
|
private void Awake()
|
|
|
|
|
{
|
2022-11-22 14:45:32 +01:00
|
|
|
ap = FindObjectOfType<Akciopont>();
|
2023-01-20 11:58:31 +01:00
|
|
|
ugynok = FindObjectOfType<Ugynok>();
|
2023-03-29 15:49:35 +02:00
|
|
|
targyak = FindObjectOfType<Targyak>();
|
|
|
|
|
jatekmanager = FindObjectOfType<jatekmanager>();
|
2023-04-09 17:21:06 +02:00
|
|
|
dice = FindObjectOfType<Dice>();
|
2023-04-18 21:14:04 +02:00
|
|
|
kezdohelyszin = FindObjectOfType<Kezdohelyszin>();
|
2023-07-03 17:48:33 +02:00
|
|
|
messageBox = FindObjectOfType<MessageBox>();
|
2023-02-16 14:56:30 +01:00
|
|
|
}
|
2022-11-11 13:42:40 +01:00
|
|
|
|
2023-04-18 21:14:04 +02:00
|
|
|
private void Start()
|
2023-02-16 14:56:30 +01:00
|
|
|
{
|
2022-11-11 13:42:40 +01:00
|
|
|
eromulepes1.SetActive(false);
|
|
|
|
|
eromulepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
feketepiaclepes1.SetActive(false);
|
|
|
|
|
feketepiaclepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
metrolepes1.SetActive(false);
|
|
|
|
|
metrolepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
szervereklepes1.SetActive(false);
|
|
|
|
|
szervereklepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
kingcasinolepes1.SetActive(false);
|
|
|
|
|
kingcasinolepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
feltoltolepes1.SetActive(false);
|
|
|
|
|
feltoltolepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
kutatolaborlepes1.SetActive(false);
|
|
|
|
|
kutatolaborlepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
kriptoklublepes1.SetActive(false);
|
|
|
|
|
kriptoklublepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
cyberplazalepes1.SetActive(false);
|
|
|
|
|
cyberplazalepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
hadiuzemlepes1.SetActive(false);
|
|
|
|
|
hadiuzemlepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
konyvtarlepes1.SetActive(false);
|
|
|
|
|
konyvtarlepes2.SetActive(false);
|
|
|
|
|
|
|
|
|
|
korhazlepes1.SetActive(false);
|
|
|
|
|
korhazlepes2.SetActive(false);
|
2022-11-12 12:18:08 +01:00
|
|
|
|
|
|
|
|
kezdoHelyMeghatarzoas();
|
2022-11-01 18:07:06 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
private void kezdoHelyMeghatarzoas()
|
|
|
|
|
{
|
2022-11-22 14:45:32 +01:00
|
|
|
int random = UnityEngine.Random.Range(1, 12);
|
2022-11-12 12:18:08 +01:00
|
|
|
Debug.Log("Random a kezdohelyszinhez: " + random);
|
2023-04-20 16:14:47 +02:00
|
|
|
string helynev = "";
|
2022-11-12 12:18:08 +01:00
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (random == 1)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = oneone.transform.position;
|
|
|
|
|
eromulepes1.SetActive(true);
|
|
|
|
|
eromulepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 1;
|
2023-04-20 13:28:45 +02:00
|
|
|
jelenlegi_y = 1;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Erőmű";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 2)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = twoone.transform.position;
|
|
|
|
|
feketepiaclepes1.SetActive(true);
|
|
|
|
|
feketepiaclepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
jelenlegi_y = 1;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Fekete piac";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 3)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = threeone.transform.position;
|
|
|
|
|
metrolepes1.SetActive(true);
|
|
|
|
|
metrolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
jelenlegi_y = 1;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Metró";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 4)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = onetwo.transform.position;
|
|
|
|
|
szervereklepes1.SetActive(true);
|
|
|
|
|
szervereklepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
jelenlegi_y = 2;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Szerverek";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 5)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = twotwo.transform.position;
|
|
|
|
|
kingcasinolepes1.SetActive(true);
|
|
|
|
|
kingcasinolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
jelenlegi_y = 2;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "King Kaszinó";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 6)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = threetwo.transform.position;
|
|
|
|
|
feltoltolepes1.SetActive(true);
|
|
|
|
|
feltoltolepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
jelenlegi_y = 2;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Feltöltő";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 7)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = onethree.transform.position;
|
|
|
|
|
kutatolaborlepes1.SetActive(true);
|
|
|
|
|
kutatolaborlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
jelenlegi_y = 3;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Kutatólabor";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 8)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = twothree.transform.position;
|
|
|
|
|
kriptoklublepes1.SetActive(true);
|
|
|
|
|
kriptoklublepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
jelenlegi_y = 3;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Kripto club";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 9)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = threethree.transform.position;
|
|
|
|
|
cyberplazalepes1.SetActive(true);
|
|
|
|
|
cyberplazalepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
jelenlegi_y = 3;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Cyber pláza";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 10)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = onefour.transform.position;
|
|
|
|
|
hadiuzemlepes1.SetActive(true);
|
|
|
|
|
hadiuzemlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 1;
|
|
|
|
|
jelenlegi_y = 4;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Hadiüzem";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 11)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = twofour.transform.position;
|
|
|
|
|
konyvtarlepes1.SetActive(true);
|
|
|
|
|
konyvtarlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 2;
|
|
|
|
|
jelenlegi_y = 4;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Könyvtár";
|
2023-01-23 13:03:35 +01:00
|
|
|
}
|
|
|
|
|
else if (random == 12)
|
|
|
|
|
{
|
2022-11-12 12:18:08 +01:00
|
|
|
player.transform.position = threefour.transform.position;
|
|
|
|
|
korhazlepes1.SetActive(true);
|
|
|
|
|
korhazlepes1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-13 14:44:21 +01:00
|
|
|
jelenlegi_x = 3;
|
|
|
|
|
jelenlegi_y = 4;
|
2023-04-20 16:14:47 +02:00
|
|
|
helynev = "Kórház";
|
2022-11-12 12:18:08 +01:00
|
|
|
}
|
2023-03-29 11:06:00 +02:00
|
|
|
|
2023-04-20 16:14:47 +02:00
|
|
|
kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, helynev);
|
2023-04-09 17:21:06 +02:00
|
|
|
//ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y);
|
2023-03-29 11:06:00 +02:00
|
|
|
ugynok.setElozoHelyszin(jelenlegi_x, jelenlegi_y);
|
2022-11-04 13:05:20 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-01 17:51:10 +02:00
|
|
|
private int Distance(int x, int y)
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
//hozza adni az atlos checket
|
|
|
|
|
//TODO
|
|
|
|
|
|
|
|
|
|
return math.abs((x) - jelenlegi_x) + math.abs((y) - jelenlegi_y);
|
2023-07-01 17:51:10 +02:00
|
|
|
}
|
|
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
public void setConfirmValue(bool ertek)
|
2023-01-23 13:03:35 +01:00
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
biztosoda = ertek;
|
|
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
private IEnumerator Confirmation(Transform pos, string helynev, int future_x, int future_y, Collider2D collider)
|
|
|
|
|
{
|
|
|
|
|
//move parent confirm to collider
|
|
|
|
|
parentMoveConfirm.transform.position = pos.position;
|
|
|
|
|
EnableButtons(true);
|
|
|
|
|
int tavolsag = Distance(future_x, future_y);
|
|
|
|
|
messageBox.SendMessageToBox("Biztos ide akarsz mozgoni? (" + helynev + ") Ez " + tavolsag + " ap-ba fog kerülni");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var waitForButton = new WaitForUIButtons(confirmMove, cancelMove);
|
|
|
|
|
yield return waitForButton.Reset();
|
|
|
|
|
|
|
|
|
|
//if(biztosoda) yield break;
|
|
|
|
|
|
|
|
|
|
//yield return new WaitUntil(() => biztosoda == true);
|
|
|
|
|
|
|
|
|
|
collider.gameObject.SetActive(false);
|
|
|
|
|
|
|
|
|
|
if (waitForButton.PressedButton == confirmMove)
|
2023-01-23 13:03:35 +01:00
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
Move(future_x, future_y, collider);
|
|
|
|
|
}
|
|
|
|
|
}
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
public void Move(int future_x, int future_y, Collider2D collider)
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("Player clicked on the collider: " + collider.gameObject.name);
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
int tavolsag = Distance(future_x, future_y);
|
|
|
|
|
Debug.Log("<color=yellow> tavolsag: " + tavolsag + "</color>");
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
GameObject lepesjelzo1;
|
|
|
|
|
GameObject lepesjelzo2;
|
|
|
|
|
|
|
|
|
|
//lepesjelzo beallitasa
|
|
|
|
|
if (collider.gameObject.name.Equals("oneone"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = eromulepes1;
|
|
|
|
|
lepesjelzo2 = eromulepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("twoone"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = feketepiaclepes1;
|
|
|
|
|
lepesjelzo2 = feketepiaclepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("threeone"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = metrolepes1;
|
|
|
|
|
lepesjelzo2 = metrolepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("onetwo"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = szervereklepes1;
|
|
|
|
|
lepesjelzo2 = szervereklepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("twotwo"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = kingcasinolepes1;
|
|
|
|
|
lepesjelzo2 = kingcasinolepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("threetwo"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = feltoltolepes1;
|
|
|
|
|
lepesjelzo2 = feltoltolepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("onethree"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = kutatolaborlepes1;
|
|
|
|
|
lepesjelzo2 = kutatolaborlepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("twothree"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = kriptoklublepes1;
|
|
|
|
|
lepesjelzo2 = kriptoklublepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("threethree"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = cyberplazalepes1;
|
|
|
|
|
lepesjelzo2 = cyberplazalepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("onefour"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = hadiuzemlepes1;
|
|
|
|
|
lepesjelzo2 = hadiuzemlepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("twofour"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = konyvtarlepes1;
|
|
|
|
|
lepesjelzo2 = konyvtarlepes2;
|
|
|
|
|
}
|
|
|
|
|
else if (collider.gameObject.name.Equals("threefour"))
|
|
|
|
|
{
|
|
|
|
|
lepesjelzo1 = konyvtarlepes1;
|
|
|
|
|
lepesjelzo2 = konyvtarlepes2;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("<color=red> Hiba: collider nev: " + collider.gameObject.name + "</color>");
|
|
|
|
|
lepesjelzo1 = new GameObject();
|
|
|
|
|
lepesjelzo2 = new GameObject();
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
if (lepesjelzo1.activeSelf && lepesjelzo2.activeSelf)
|
2023-01-23 13:03:35 +01:00
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
Debug.Log("Maximum ketszer lephetsz egy mezore");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
if (tavolsag <= ap.getAkciopont() && tavolsag != 0 && biztosoda)
|
|
|
|
|
{
|
|
|
|
|
player.transform.position = collider.transform.position;
|
|
|
|
|
jelenlegi_x = future_x;
|
|
|
|
|
jelenlegi_y = future_y;
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
collider.gameObject.SetActive(true);
|
|
|
|
|
//setConfirmValue(false);
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
if (targyak.lathatatlanOltozetAktivalva)
|
|
|
|
|
targyak.lathatatlanOltozetAktivalva = false;
|
2023-06-12 12:35:47 +02:00
|
|
|
else
|
2023-07-03 17:48:33 +02:00
|
|
|
ap.UpdateAkciopont(-tavolsag);
|
2022-11-02 11:15:11 +01:00
|
|
|
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
Debug.Log(ap.getAkciopont());
|
|
|
|
|
Debug.Log("ugynok sorsolas");
|
|
|
|
|
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.UgynokValasztas); //ne lepjen addig tovabb amig nem valasztott
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
dice.CallRenderDice(true);
|
|
|
|
|
ugynok.ugynokMegolveElozoHelyen();
|
|
|
|
|
|
|
|
|
|
if (lepesjelzo1.activeSelf == true)
|
2023-01-23 13:03:35 +01:00
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
lepesjelzo2.SetActive(true);
|
|
|
|
|
moveCounter++;
|
|
|
|
|
lepesjelzo2.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
2023-06-12 12:35:47 +02:00
|
|
|
else
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
lepesjelzo1.SetActive(true);
|
|
|
|
|
moveCounter++;
|
|
|
|
|
lepesjelzo1.GetComponent<TMP_Text>().text = moveCounter.ToString();
|
2023-06-12 12:35:47 +02:00
|
|
|
}
|
2023-07-03 17:48:33 +02:00
|
|
|
jatekmanager.JatekosVesztett();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni");
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
}
|
2023-07-03 17:48:33 +02:00
|
|
|
}
|
2022-11-02 11:15:11 +01:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
public void Update()
|
|
|
|
|
{
|
|
|
|
|
//tavolsag = math.abs(tavolsag); //mindig abszolut
|
|
|
|
|
|
|
|
|
|
ugynok.ugynokMegolveElozoHelyen();
|
|
|
|
|
|
|
|
|
|
// player mozgatasa es konzolra iratas
|
|
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && oneone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
2023-01-23 13:03:35 +01:00
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(oneone.transform, "Erőmű", 1, 1, oneone_Collider));
|
|
|
|
|
}
|
2023-06-12 12:35:47 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twoone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
|
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(twoone.transform, "Feketepiac", 2, 1, twoone_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threeone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
2023-01-23 13:03:35 +01:00
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(threeone.transform, "Metró", 3, 1, threeone_Collider));
|
|
|
|
|
}
|
2023-07-01 17:51:10 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
|
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(onetwo.transform, "Szerverek", 1, 2, onetwo_Collider));
|
|
|
|
|
}
|
2023-06-12 12:35:47 +02:00
|
|
|
|
2023-07-03 17:48:33 +02:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twotwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
|
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(twotwo.transform, "King Kaszinó", 2, 2, twotwo_Collider));
|
2022-11-02 07:41:58 +01:00
|
|
|
}
|
2022-11-01 18:07:06 +01:00
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(threetwo.transform, "Feltöltő", 3, 2, threetwo_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(onethree.transform, "Kutatólabor", 1, 3, onethree_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twothree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(twothree.transform, "Kripto Club", 2, 3, twothree_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(threethree.transform, "Cyber Pláza", 3, 3, threethree_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && onefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(onefour.transform, "Hadiüzem", 1, 4, onefour_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && twofour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(twofour.transform, "Könyvtár", 2, 4, twofour_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
|
2023-01-23 13:03:35 +01:00
|
|
|
if (Input.GetKeyDown(KeyCode.Mouse0) && threefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition)))
|
|
|
|
|
{
|
2023-07-03 17:48:33 +02:00
|
|
|
if (ap.getAkciopont() == 0) return;
|
|
|
|
|
// Call Confrimation() if confirm is pressed call Move which has the code down below
|
|
|
|
|
StartCoroutine(Confirmation(threefour.transform, "Kórház", 3, 4, threefour_Collider));
|
2022-11-02 11:15:11 +01:00
|
|
|
}
|
|
|
|
|
}
|
2022-11-02 17:24:55 +01:00
|
|
|
}
|