jatekmanager mukodik

This commit is contained in:
2023-03-01 10:43:27 +01:00
parent 830022e1e6
commit fd63ae99e6
8 changed files with 123 additions and 92 deletions

View File

@@ -4636,9 +4636,7 @@ MonoBehaviour:
jatekosnyert: 0
jatekosvesztett: 0
vanertelme: 1
helyszinaktivalasBtn: {fileID: 824033280}
State: 0
RollDice: {fileID: 1393612613}
--- !u!1 &229807670
GameObject:
m_ObjectHideFlags: 0
@@ -11086,7 +11084,7 @@ Transform:
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -3.19, y: 0, z: -10}
m_LocalPosition: {x: -4.36, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []

View File

@@ -60,7 +60,7 @@ public class Akciok : MonoBehaviour
}
}
public void Betarazas(int betarazas, bool vonjonleapt = true)
public void Betarazas(int betarazas)
{
if (tolteny_index < 24 && ap.akciopont != 0)
{
@@ -81,8 +81,8 @@ public class Akciok : MonoBehaviour
betarazott_tolteny += betarazas;
//tolteny_index++;
if(vonjonleapt)
ap.UpdateAkciopont(-1);
ap.UpdateAkciopont(-1);
Debug.Log("Tolteny betarazva");
Debug.Log("Betarazott toltenyek szama: " + betarazott_tolteny);

View File

@@ -46,8 +46,10 @@ public class Dice : MonoBehaviour {
valasztottErtek = diceResult[0];
if (diceResult[0] < diceResult[1]) {
upgrade.canUpgrade = true; //kisebb szam valasztasa eseten fejlesztes egyszer
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Fejlesztes);
} else {
energiasav.csokkenEnergia(1); //nagyobb szam valasztasa eseten -1 energia
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio);
}
locked = true;
@@ -55,8 +57,10 @@ public class Dice : MonoBehaviour {
valasztottErtek = diceResult[1];
if (diceResult[1] < diceResult[0]) {
upgrade.canUpgrade = true;
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Fejlesztes);
} else {
energiasav.csokkenEnergia(1);
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio);
}
locked = true;

View File

@@ -176,7 +176,8 @@ public class Targyak : MonoBehaviour
public void HackerCsatlakozo() { //kesz
//+2 tolteny
akciok.Betarazas(2, false);
akciok.Betarazas(2);
akciopont.akciopont++; //betarazas miatt egy pont visszaadasa
//+1 elet
elet.Eletplusz();
//+1 akcio

View File

@@ -35,4 +35,12 @@ public class TurnManager : MonoBehaviour
Debug.Log("kovetkezo kor " + turnCounter);
}
/*
if (energiavesztese > 29)
{
jatekmanager.Instance.UpdateGameState(GameState.Vesztett); //a jatekmanager atvalt a vesztett eventre
}
*/
}

View File

@@ -31,6 +31,7 @@ public class Upgrade : MonoBehaviour
if (energia_index < 4) {
energiatext[energia_index].text = "X";
energia_index++;
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio); //a jatekmanager atvalt a korkezdet eventre
}
Debug.Log("energia_i: " + energia_index);
canUpgrade = false;
@@ -43,6 +44,7 @@ public class Upgrade : MonoBehaviour
if (akcio_index < 4) {
akciotext[akcio_index].text = "X";
akcio_index++;
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio); //a jatekmanager atvalt a korkezdet eventre
}
Debug.Log("akcio_i: " + akcio_index);
canUpgrade = false;
@@ -55,6 +57,7 @@ public class Upgrade : MonoBehaviour
if (harc_index < 4) {
harctext[harc_index].text = "X";
harc_index++;
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio); //a jatekmanager atvalt a korkezdet eventre
}
Debug.Log("harc_i: " + harc_index);
canUpgrade = false;
@@ -67,6 +70,7 @@ public class Upgrade : MonoBehaviour
if (ujradobas_index < 4) {
ujradobastext[ujradobas_index].text = "X";
ujradobas_index++;
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio); //a jatekmanager atvalt a korkezdet eventre
}
Debug.Log("ujradobas_i: " + ujradobas_index);
canUpgrade = false;
@@ -79,6 +83,7 @@ public class Upgrade : MonoBehaviour
if (hack_index < 3) {
hacktext[hack_index].text = "X";
hack_index++;
jatekmanager.Instance.UpdateGameState(jatekmanager.GameState.Akcio); //a jatekmanager atvalt a korkezdet eventre
}
Debug.Log("hack_i: " + hack_index);
canUpgrade = false;

View File

@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Net.Sockets;
using TMPro;
using UnityEngine;
using UnityEngine.SceneManagement;
@@ -54,7 +55,13 @@ public class jatekmanager : MonoBehaviour
public bool jatekosvesztett = false;
public bool vanertelme = true;
public GameState State;
public static event Action<GameState> OnGameStateChanged;
public Button helyszinaktivalasBtn;
public void ugynokDeaktivalas(bool bekapcsolas){
energiafejlesztés.SetActive(bekapcsolas);
akciofejlesztés.SetActive(bekapcsolas);
@@ -97,12 +104,6 @@ public class jatekmanager : MonoBehaviour
dice.dice2btnBtn.gameObject.SetActive(bekapcsolas);
}
public GameState State;
public static event Action<GameState> OnGameStateChanged;
[SerializeField] private Button RollDice;
void Awake()
{
@@ -170,7 +171,8 @@ public class jatekmanager : MonoBehaviour
betarazas.SetActive(false);
nyomozas.SetActive(false);
hackeles.SetActive(false);
//test.SetActive(false);
helyszinaktivalasBtn.gameObject.SetActive(false);
test.SetActive(false);
Debug.Log(dice.dobott + " ; ennyiszer dobtál már a körben");
Debug.Log((upgrade.getUjradobasIndex() + 1) + " ; ennyi dobásod van összesen");
@@ -185,6 +187,8 @@ public class jatekmanager : MonoBehaviour
ujradobasfejlesztés.SetActive(true);
hackfejlesztés.SetActive(true);
kovetkezokor.SetActive(true);
rolldice.SetActive(false);
helyszinaktivalasBtn.gameObject.SetActive(false);
}
private async void HandleAkcio()
@@ -194,6 +198,17 @@ public class jatekmanager : MonoBehaviour
betarazas.SetActive(true);
nyomozas.SetActive(true);
hackeles.SetActive(true);
helyszinaktivalasBtn.gameObject.SetActive(true);
energiafejlesztés.SetActive(false);
akciofejlesztés.SetActive(false);
harcfejlesztés.SetActive(false);
ujradobasfejlesztés.SetActive(false);
hackfejlesztés.SetActive(false);
kovetkezokor.SetActive(true);
rolldice.SetActive(false);
}

View File

@@ -15,11 +15,11 @@ MonoBehaviour:
m_PixelRect:
serializedVersion: 2
x: 0
y: 43
width: 1920
height: 997
y: 28
width: 1366
height: 673
m_ShowMode: 4
m_Title: Project
m_Title: Hierarchy
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
@@ -44,8 +44,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1920
height: 997
width: 1366
height: 673
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_UseTopView: 1
@@ -69,7 +69,7 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1920
width: 1366
height: 30
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@@ -90,8 +90,8 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 977
width: 1920
y: 653
width: 1366
height: 20
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
@@ -114,12 +114,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 30
width: 1920
height: 947
width: 1366
height: 623
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 49
controlID: 79
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -139,12 +139,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1482
height: 947
width: 1001
height: 623
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 50
controlID: 80
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -164,12 +164,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1482
height: 690
width: 1001
height: 393
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 51
controlID: 81
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -187,8 +187,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 210
height: 690
width: 191
height: 393
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 13}
@@ -211,10 +211,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 210
x: 191
y: 0
width: 1272
height: 690
width: 810
height: 393
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 14}
@@ -239,9 +239,9 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 690
width: 1482
height: 257
y: 393
width: 1001
height: 230
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 15}
@@ -264,10 +264,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1482
x: 1001
y: 0
width: 438
height: 947
width: 365
height: 623
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_ActualView: {fileID: 17}
@@ -296,10 +296,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 210
y: 73
width: 1270
height: 669
x: 191
y: 86
width: 808
height: 372
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -310,7 +310,7 @@ MonoBehaviour:
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
m_TargetSize: {x: 1270, y: 648}
m_TargetSize: {x: 624, y: 351}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
@@ -319,16 +319,16 @@ MonoBehaviour:
m_VSyncEnabled: 0
m_Gizmos: 0
m_Stats: 0
m_SelectedSizes: 00000000000000000000000000000000000000000000000000000000000000000000000000000000
m_SelectedSizes: 01000000000000000000000000000000000000000000000000000000000000000000000000000000
m_ZoomArea:
m_HRangeLocked: 0
m_VRangeLocked: 0
hZoomLockedByDefault: 0
vZoomLockedByDefault: 0
m_HBaseRangeMin: -635
m_HBaseRangeMax: 635
m_VBaseRangeMin: -324
m_VBaseRangeMax: 324
m_HBaseRangeMin: -312
m_HBaseRangeMax: 312
m_VBaseRangeMin: -175.5
m_VBaseRangeMax: 175.5
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
@@ -337,7 +337,7 @@ MonoBehaviour:
m_HSlider: 0
m_VSlider: 0
m_IgnoreScrollWheelUntilClicked: 0
m_EnableMouseInput: 0
m_EnableMouseInput: 1
m_EnableSliderZoomHorizontal: 0
m_EnableSliderZoomVertical: 0
m_UniformScale: 1
@@ -346,23 +346,23 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 1270
height: 648
width: 808
height: 351
m_Scale: {x: 1, y: 1}
m_Translation: {x: 635, y: 324}
m_Translation: {x: 404, y: 175.5}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -635
y: -324
width: 1270
height: 648
x: -404
y: -175.5
width: 808
height: 351
m_MinimalGUI: 1
m_defaultScale: 1
m_LastWindowPixelSize: {x: 1270, y: 669}
m_LastWindowPixelSize: {x: 808, y: 372}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
@@ -389,9 +389,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 73
width: 209
height: 669
y: 86
width: 190
height: 372
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -401,7 +401,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 28fbffff80700000
m_ExpandedIDs: 5a98ffff0099ffffde9affffea9affffb69cffffd69cffffd2a2ffff50a3ffff5ea3ffff66a3ffff2ea5ffff38a5ffffccaaffff6eabffff48adffff50adffff18afffff34afffff28fbffff78700000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -445,10 +445,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 210
y: 73
width: 1270
height: 669
x: 191
y: 86
width: 808
height: 372
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -698,16 +698,16 @@ MonoBehaviour:
m_WindowGUID: cc27987af1a868c49b0894db9c0f5429
m_Gizmos: 1
m_OverrideSceneCullingMask: 6917529027641081856
m_SceneIsLit: 1
m_SceneIsLit: 0
m_SceneLighting: 1
m_2DMode: 1
m_isRotationLocked: 0
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -4.9125323, y: -0.30520058, z: 0.077698514}
m_Target: {x: -0.39001906, y: 0.54019904, z: -2.1025283}
speed: 2
m_Value: {x: -4.9125323, y: -0.30520058, z: 0.077698514}
m_Value: {x: -0.39001906, y: 0.54019904, z: -2.1025283}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@@ -758,9 +758,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 11.858034
m_Target: 12.160805
speed: 2
m_Value: 11.858034
m_Value: 12.160805
m_Ortho:
m_Target: 1
speed: 2
@@ -806,9 +806,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 763
width: 1481
height: 236
y: 479
width: 1000
height: 209
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -834,14 +834,14 @@ MonoBehaviour:
m_LastFolders:
- Assets/Scripts
m_LastFoldersGridSize: 66
m_LastProjectPath: C:\dev\find the source\projekt\FindTheSource
m_LastProjectPath: /home/tom/Documents/dev/find the source
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 127a0000
m_LastClickedID: 31250
m_ExpandedIDs: 00000000f2790000
m_SelectedIDs: 027a0000
m_LastClickedID: 31234
m_ExpandedIDs: 00000000ea79000000ca9a3b
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -869,7 +869,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000f2790000
m_ExpandedIDs: 00000000ea790000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -921,7 +921,7 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_NewAssetIndexInList: -1
m_ScrollPosition: {x: 0, y: 0}
m_ScrollPosition: {x: 0, y: 84}
m_GridSize: 66
m_SkipHiddenPackages: 0
m_DirectoriesAreaWidth: 193
@@ -945,10 +945,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1482
y: 73
x: 928
y: 86
width: 437
height: 926
height: 602
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -973,10 +973,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1482
y: 73
width: 437
height: 926
x: 1001
y: 86
width: 364
height: 602
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -988,7 +988,7 @@ MonoBehaviour:
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1
m_LastVerticalScrollValue: 1243
m_LastVerticalScrollValue: 0
m_GlobalObjectId:
m_InspectorMode: 0
m_LockTracker: