From dad9ccfb13f9f0fc17c8da668bcf757ab926bc36 Mon Sep 17 00:00:00 2001 From: Playmaker1210 Date: Thu, 20 Apr 2023 16:14:47 +0200 Subject: [PATCH] update --- Assets/Scenes/Jatek.unity | 138 +------- Assets/Scripts/Dice.cs | 9 +- Assets/Scripts/Kezdohelyszin.cs | 24 +- Assets/Scripts/jatekmanager.cs | 13 +- Assets/Scripts/movement.cs | 579 +------------------------------- 5 files changed, 40 insertions(+), 723 deletions(-) diff --git a/Assets/Scenes/Jatek.unity b/Assets/Scenes/Jatek.unity index 36769df..9ee2ab7 100644 --- a/Assets/Scenes/Jatek.unity +++ b/Assets/Scenes/Jatek.unity @@ -5269,6 +5269,8 @@ MonoBehaviour: mainCanvas: {fileID: 891272362} helyszinCanvas: {fileID: 2123388911} helyszinSorsolasCanvas: {fileID: 1743770061} + helyszinEredmenyText: {fileID: 2053923817} + helyszinEredmenyBtn: {fileID: 1959510889} palyaSprite: {fileID: 1342387223} playerSprite: {fileID: 1559678231} eredmenyPanel: {fileID: 775352568} @@ -10244,7 +10246,6 @@ RectTransform: - {fileID: 1138794085} - {fileID: 1959510888} - {fileID: 2053923816} - - {fileID: 1667766885} m_Father: {fileID: 1743770065} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -43200,141 +43201,6 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1667130276} m_CullTransparentMesh: 1 ---- !u!1 &1667766884 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 1667766885} - - component: {fileID: 1667766887} - - component: {fileID: 1667766886} - m_Layer: 0 - m_Name: bug - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 2147483647 - m_IsActive: 1 ---- !u!224 &1667766885 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1667766884} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 441834646} - m_RootOrder: 4 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: 42.41, y: 91} - m_SizeDelta: {x: 810.33, y: 62.22} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!114 &1667766886 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1667766884} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 - m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} - m_Maskable: 1 - m_OnCullStateChanged: - m_PersistentCalls: - m_Calls: [] - m_text: 'Bug: Ha nem indul a porges nyomj ESC-et!!' - m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} - m_fontSharedMaterials: [] - m_fontMaterial: {fileID: 0} - m_fontMaterials: [] - m_fontColor32: - serializedVersion: 2 - rgba: 4278190335 - m_fontColor: {r: 1, g: 0, b: 0, a: 1} - m_enableVertexGradient: 0 - m_colorMode: 3 - m_fontColorGradient: - topLeft: {r: 1, g: 1, b: 1, a: 1} - topRight: {r: 1, g: 1, b: 1, a: 1} - bottomLeft: {r: 1, g: 1, b: 1, a: 1} - bottomRight: {r: 1, g: 1, b: 1, a: 1} - m_fontColorGradientPreset: {fileID: 0} - m_spriteAsset: {fileID: 0} - m_tintAllSprites: 0 - m_StyleSheet: {fileID: 0} - m_TextStyleHashCode: -1183493901 - m_overrideHtmlColors: 0 - m_faceColor: - serializedVersion: 2 - rgba: 4294967295 - m_fontSize: 36 - m_fontSizeBase: 36 - m_fontWeight: 400 - m_enableAutoSizing: 0 - m_fontSizeMin: 18 - m_fontSizeMax: 72 - m_fontStyle: 0 - m_HorizontalAlignment: 1 - m_VerticalAlignment: 256 - m_textAlignment: 65535 - m_characterSpacing: 0 - m_wordSpacing: 0 - m_lineSpacing: 0 - m_lineSpacingMax: 0 - m_paragraphSpacing: 0 - m_charWidthMaxAdj: 0 - m_enableWordWrapping: 1 - m_wordWrappingRatios: 0.4 - m_overflowMode: 0 - m_linkedTextComponent: {fileID: 0} - parentLinkedComponent: {fileID: 0} - m_enableKerning: 1 - m_enableExtraPadding: 0 - checkPaddingRequired: 0 - m_isRichText: 1 - m_parseCtrlCharacters: 1 - m_isOrthographic: 1 - m_isCullingEnabled: 0 - m_horizontalMapping: 0 - m_verticalMapping: 0 - m_uvLineOffset: 0 - m_geometrySortingOrder: 0 - m_IsTextObjectScaleStatic: 0 - m_VertexBufferAutoSizeReduction: 0 - m_useMaxVisibleDescender: 1 - m_pageToDisplay: 1 - m_margin: {x: 0, y: 0, z: 0, w: 0} - m_isUsingLegacyAnimationComponent: 0 - m_isVolumetricText: 0 - m_hasFontAssetChanged: 0 - m_baseMaterial: {fileID: 0} - m_maskOffset: {x: 0, y: 0, z: 0, w: 0} ---- !u!222 &1667766887 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1667766884} - m_CullTransparentMesh: 1 --- !u!1 &1668966828 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Scripts/Dice.cs b/Assets/Scripts/Dice.cs index 0a8f4ec..c735648 100644 --- a/Assets/Scripts/Dice.cs +++ b/Assets/Scripts/Dice.cs @@ -292,8 +292,8 @@ public class Dice : MonoBehaviour { this.adrenalinMegerosites = adrenalinMegerosites; } - public void callAnimateDice(SpriteRenderer rend, int diceErtek) => StartCoroutine(AnimateTheDice(rend, diceErtek)); - private IEnumerator AnimateTheDice(SpriteRenderer rend, int diceErtek) + public void callAnimateDice(SpriteRenderer rend, int diceErtek, float waitTime = 500f) => StartCoroutine(AnimateTheDice(rend, diceErtek, waitTime)); + private IEnumerator AnimateTheDice(SpriteRenderer rend, int diceErtek, float waitTime = 500f) { int randomDiceSide; float time = 0f; @@ -303,17 +303,18 @@ public class Dice : MonoBehaviour { time += Time.time; //Debug.Log("time: " + time); - if(time >= 200f) fusson = false; + if(time >= waitTime) fusson = false; randomDiceSide = Random.Range(0, 5); rend.sprite = diceSides[Random.Range(0, 5)]; rend.size = diceSpriteSize; - yield return new WaitForSeconds(0.05f); + yield return new WaitForSecondsRealtime(0.05f); } rend.sprite = diceSides[diceErtek - 1]; rend.size = diceSpriteSize; + Kezdohelyszin.kesz = true; } } diff --git a/Assets/Scripts/Kezdohelyszin.cs b/Assets/Scripts/Kezdohelyszin.cs index 3201ecd..3a334a2 100644 --- a/Assets/Scripts/Kezdohelyszin.cs +++ b/Assets/Scripts/Kezdohelyszin.cs @@ -1,5 +1,4 @@ using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using TMPro; @@ -11,23 +10,20 @@ public class Kezdohelyszin : MonoBehaviour public TMP_Text eredmenyText; public Button nextButton; - private float time; private int random; + public static bool kesz = false; private Dice dice; private void Awake() { dice = FindObjectOfType(); nextButton.interactable = false; - - #if !UNITY_EDITOR - time = 4f; - #else - time = 5f; - #endif } public void KezdoHelyszinSorsolas(int x, int y, string helynev){ + eredmenyText.text = ""; + nextButton.interactable = false; + StartCoroutine(waitForDiceAnimation(helynev)); dice.callAnimateDice(dice1, x); @@ -35,14 +31,10 @@ public class Kezdohelyszin : MonoBehaviour } private IEnumerator waitForDiceAnimation(string helynev){ - yield return new WaitForSeconds(time); - + yield return new WaitUntil(() => kesz); + eredmenyText.text = "A kezdőhelyszíned: " + helynev; - nextButton.interactable = true; + nextButton.interactable = true; + kesz = false; } - - public void Debugl(){ - Debug.Log("clicked"); - } - } diff --git a/Assets/Scripts/jatekmanager.cs b/Assets/Scripts/jatekmanager.cs index 44f3652..1358676 100644 --- a/Assets/Scripts/jatekmanager.cs +++ b/Assets/Scripts/jatekmanager.cs @@ -72,6 +72,8 @@ public class jatekmanager : MonoBehaviour public GameObject mainCanvas; public GameObject helyszinCanvas; public GameObject helyszinSorsolasCanvas; + public TMP_Text helyszinEredmenyText; + public Button helyszinEredmenyBtn; public GameObject palyaSprite; public GameObject playerSprite; @@ -167,7 +169,7 @@ public class jatekmanager : MonoBehaviour public void Resume() { pauseMenuUI.SetActive(false); - Time.timeScale = 1f; //normal ido visszainditasa + SetTimeScale(1f); //normal ido visszainditasa GameIsPlaying = true; audioManager.SetMainVolume(0f); Instance.UpdateGameState(previousGameState); //elozo statere menjen vissza @@ -177,7 +179,7 @@ public class jatekmanager : MonoBehaviour { pauseMenuUI.SetActive(true); //ido megallitasa hogy megalljon a jatek - Time.timeScale = 0f; + SetTimeScale(0f); GameIsPlaying = false; audioManager.SetMainVolume(-80f); //hangerot teljesen levenni a masteren previousGameState = State; @@ -186,9 +188,16 @@ public class jatekmanager : MonoBehaviour public void Quit() { + //helyszinEredmenyBtn.interactable = false; + //helyszinEredmenyText.gameObject.SetActive(false); + SetTimeScale(1f); SceneManager.LoadScene("MainMenu"); } + public void SetTimeScale(float time){ + Time.timeScale = time; + } + public IEnumerator atlatszo(Button gomb) { while (gomb.GetComponent().alpha > 0.25f) diff --git a/Assets/Scripts/movement.cs b/Assets/Scripts/movement.cs index df0e3f2..5f1fc29 100644 --- a/Assets/Scripts/movement.cs +++ b/Assets/Scripts/movement.cs @@ -163,6 +163,7 @@ public class movement : MonoBehaviour { int random = UnityEngine.Random.Range(1, 12); Debug.Log("Random a kezdohelyszinhez: " + random); + string helynev = ""; if (random == 1) { @@ -171,8 +172,7 @@ public class movement : MonoBehaviour eromulepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 1; jelenlegi_y = 1; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Erőmű"); - + helynev = "Erőmű"; } else if (random == 2) { @@ -181,7 +181,7 @@ public class movement : MonoBehaviour feketepiaclepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 2; jelenlegi_y = 1; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Fekete piac"); + helynev = "Fekete piac"; } else if (random == 3) { @@ -190,7 +190,7 @@ public class movement : MonoBehaviour metrolepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 3; jelenlegi_y = 1; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Metró"); + helynev = "Metró"; } else if (random == 4) { @@ -199,7 +199,7 @@ public class movement : MonoBehaviour szervereklepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 1; jelenlegi_y = 2; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Szerverek"); + helynev = "Szerverek"; } else if (random == 5) { @@ -208,7 +208,7 @@ public class movement : MonoBehaviour kingcasinolepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 2; jelenlegi_y = 2; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "King Kaszinó"); + helynev = "King Kaszinó"; } else if (random == 6) { @@ -217,7 +217,7 @@ public class movement : MonoBehaviour feltoltolepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 3; jelenlegi_y = 2; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Feltöltő"); + helynev = "Feltöltő"; } else if (random == 7) { @@ -226,7 +226,7 @@ public class movement : MonoBehaviour kutatolaborlepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 1; jelenlegi_y = 3; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Kutatólabor"); + helynev = "Kutatólabor"; } else if (random == 8) { @@ -235,7 +235,7 @@ public class movement : MonoBehaviour kriptoklublepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 2; jelenlegi_y = 3; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Kripto club"); + helynev = "Kripto club"; } else if (random == 9) { @@ -244,7 +244,7 @@ public class movement : MonoBehaviour cyberplazalepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 3; jelenlegi_y = 3; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Cyber pláza"); + helynev = "Cyber pláza"; } else if (random == 10) { @@ -253,7 +253,7 @@ public class movement : MonoBehaviour hadiuzemlepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 1; jelenlegi_y = 4; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Hadiüzem"); + helynev = "Hadiüzem"; } else if (random == 11) { @@ -262,7 +262,7 @@ public class movement : MonoBehaviour konyvtarlepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 2; jelenlegi_y = 4; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Könyvtár"); + helynev = "Könyvtár"; } else if (random == 12) { @@ -271,562 +271,14 @@ public class movement : MonoBehaviour korhazlepes1.GetComponent().text = moveCounter.ToString(); jelenlegi_x = 3; jelenlegi_y = 4; - kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, "Kórház"); + helynev = "Kórház"; } + kezdohelyszin.KezdoHelyszinSorsolas(jelenlegi_x, jelenlegi_y, helynev); //ugynok.UgynokSorsolas(jelenlegi_x, jelenlegi_y); ugynok.setElozoHelyszin(jelenlegi_x, jelenlegi_y); } - public void mozgasHelyre(int x, int y) - { - if (x == 1 && y == 1) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = oneone.transform.position; - } - else if (x == 1 && y == 2) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = onetwo.transform.position; - } - else if (x == 1 && y == 3) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = onethree.transform.position; - } - else if (x == 1 && y == 4) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = onefour.transform.position; - } - else if (x == 2 && y == 1) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = twoone.transform.position; - } - else if (x == 2 && y == 2) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = twotwo.transform.position; - } - else if (x == 2 && y == 3) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = twothree.transform.position; - } - else if (x == 2 && y == 4) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = twofour.transform.position; - } - else if (x == 3 && y == 1) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = threeone.transform.position; - } - else if (x == 3 && y == 2) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = threetwo.transform.position; - } - else if (x == 3 && y == 3) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = threethree.transform.position; - } - else if (x == 3 && y == 4) - { - jelenlegi_x = x; - jelenlegi_y = y; - player.transform.position = threefour.transform.position; - } - } - - public void helyreTeleport() - { - if (Input.GetKeyDown(KeyCode.Mouse0) && oneone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + oneone_Collider.gameObject.name); - if (eromulepes1.activeSelf == true & eromulepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - player.transform.position = oneone.transform.position; - jelenlegi_x = 1; - jelenlegi_y = 1; - oneonecount = oneonecount + 1; - if (eromulepes1.activeSelf == true) - { - eromulepes2.SetActive(true); - moveCounter++; - eromulepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - eromulepes1.SetActive(true); - moveCounter++; - eromulepes1.GetComponent().text = moveCounter.ToString(); - - } - } - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && twoone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + twoone_Collider.gameObject.name); - if (feketepiaclepes1.activeSelf == true & feketepiaclepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (twoonecount < 2) - { - player.transform.position = twoone.transform.position; - jelenlegi_x = 2; - jelenlegi_y = 1; - twoonecount = twoonecount + 1; - if (feketepiaclepes1.activeSelf == true) - { - feketepiaclepes2.SetActive(true); - moveCounter++; - feketepiaclepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - feketepiaclepes1.SetActive(true); - moveCounter++; - feketepiaclepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && threeone_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + threeone_Collider.gameObject.name); - if (metrolepes1.activeSelf == true & metrolepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - if (threeonecount < 2) - { - player.transform.position = threeone.transform.position; - jelenlegi_x = 3; - jelenlegi_y = 1; - threeonecount++; - if (metrolepes1.activeSelf == true) - { - metrolepes2.SetActive(true); - moveCounter++; - metrolepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - metrolepes1.SetActive(true); - moveCounter++; - metrolepes1.GetComponent().text = moveCounter.ToString(); - } - } - - - - - } - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && onetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + onetwo_Collider.gameObject.name); - if (szervereklepes1.activeSelf == true & szervereklepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (onetwocount < 2) - { - player.transform.position = onetwo.transform.position; - jelenlegi_x = 1; - jelenlegi_y = 2; - onetwocount++; - Debug.Log(ap.akciopont); - if (szervereklepes1.activeSelf == true) - { - szervereklepes2.SetActive(true); - moveCounter++; - szervereklepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - szervereklepes1.SetActive(true); - moveCounter++; - szervereklepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); - } - } - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && twotwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - Debug.Log("Player clicked on the collider: " + twotwo_Collider.gameObject.name); - if (kingcasinolepes1.activeSelf == true & kingcasinolepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (twotwocount < 2) - { - player.transform.position = twotwo.transform.position; - jelenlegi_x = 2; - jelenlegi_y = 2; - twotwocount++; - if (kingcasinolepes1.activeSelf == true) - { - kingcasinolepes2.SetActive(true); - moveCounter++; - kingcasinolepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - kingcasinolepes1.SetActive(true); - moveCounter++; - kingcasinolepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - } - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && threetwo_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + threetwo_Collider.gameObject.name); - if (feltoltolepes1.activeSelf == true & feltoltolepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (threetwocount < 2) - { - player.transform.position = threetwo.transform.position; - jelenlegi_x = 3; - jelenlegi_y = 2; - threetwocount++; - if (feltoltolepes1.activeSelf == true) - { - feltoltolepes2.SetActive(true); - moveCounter++; - feltoltolepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - feltoltolepes1.SetActive(true); - moveCounter++; - feltoltolepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && onethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + onethree_Collider.gameObject.name); - - if (kutatolaborlepes1.activeSelf == true & kutatolaborlepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (onethreecount < 2) - { - player.transform.position = onethree.transform.position; - jelenlegi_x = 1; - jelenlegi_y = 3; - onethreecount++; - if (kutatolaborlepes1.activeSelf == true) - { - kutatolaborlepes2.SetActive(true); - moveCounter++; - kutatolaborlepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - kutatolaborlepes1.SetActive(true); - moveCounter++; - kutatolaborlepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && twothree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + twothree_Collider.gameObject.name); - - if (kriptoklublepes1.activeSelf == true & kriptoklublepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (twothreecount < 2) - { - player.transform.position = twothree.transform.position; - jelenlegi_x = 2; - jelenlegi_y = 3; - twothreecount++; - if (kriptoklublepes1.activeSelf == true) - { - kriptoklublepes2.SetActive(true); - moveCounter++; - kriptoklublepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - kriptoklublepes1.SetActive(true); - moveCounter++; - kriptoklublepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - - - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && threethree_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + threethree_Collider.gameObject.name); - - if (cyberplazalepes1.activeSelf == true & cyberplazalepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (threethreecount < 2) - { - player.transform.position = threethree.transform.position; - jelenlegi_x = 3; - jelenlegi_y = 3; - threethreecount++; - if (cyberplazalepes1.activeSelf == true) - { - cyberplazalepes2.SetActive(true); - moveCounter++; - cyberplazalepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - cyberplazalepes1.SetActive(true); - moveCounter++; - cyberplazalepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - - } - - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && onefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + onefour_Collider.gameObject.name); - - if (hadiuzemlepes1.activeSelf == true & hadiuzemlepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (onefourcount < 2) - { - player.transform.position = onefour.transform.position; - jelenlegi_x = 1; - jelenlegi_y = 4; - onefourcount++; - if (hadiuzemlepes1.activeSelf == true) - { - hadiuzemlepes2.SetActive(true); - moveCounter++; - hadiuzemlepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - hadiuzemlepes1.SetActive(true); - moveCounter++; - hadiuzemlepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && twofour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + twofour_Collider.gameObject.name); - - if (konyvtarlepes1.activeSelf == true & konyvtarlepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (twofourcount < 2) - { - player.transform.position = twofour.transform.position; - jelenlegi_x = 2; - jelenlegi_y = 4; - twofourcount++; - if (konyvtarlepes1.activeSelf == true) - { - konyvtarlepes2.SetActive(true); - moveCounter++; - konyvtarlepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - konyvtarlepes1.SetActive(true); - moveCounter++; - konyvtarlepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - - - } - - if (Input.GetKeyDown(KeyCode.Mouse0) && threefour_Collider.OverlapPoint(THE_Camera.ScreenToWorldPoint(Input.mousePosition))) - { - - Debug.Log("Player clicked on the collider: " + threefour_Collider.gameObject.name); - - if (korhazlepes1.activeSelf == true & korhazlepes2.activeSelf == true) - { - Debug.Log("Maximum ketszer lephetsz egy mezore"); - } - else - { - - if (threefourcount < 2) - { - player.transform.position = threefour.transform.position; - jelenlegi_x = 3; - jelenlegi_y = 4; - threefourcount++; - if (korhazlepes1.activeSelf == true) - { - korhazlepes2.SetActive(true); - moveCounter++; - korhazlepes2.GetComponent().text = moveCounter.ToString(); - } - else - { - korhazlepes1.SetActive(true); - moveCounter++; - korhazlepes1.GetComponent().text = moveCounter.ToString(); - } - } - else - { - Debug.Log("Maximum ketszer lephetsz egy mez?re"); - } - - } - - } - - - } - - public void Update() { tavolsag = math.abs(tavolsag); @@ -1602,7 +1054,6 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } - } } } @@ -1672,11 +1123,9 @@ public class movement : MonoBehaviour Debug.Log("Nincs eleg akciopontod vagy nem 1 mezon belul akarsz lepni"); } } - } } } } - } } \ No newline at end of file