betarazas akcio + text kesz

This commit is contained in:
2022-11-14 14:51:43 +01:00
parent 179fde0ba0
commit 983420e0c9
3 changed files with 3691 additions and 170 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -1,8 +1,52 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;
public class Akciok : MonoBehaviour
{
//Betarazashoz
public TMP_Text[] toltenyek;
private int tolteny_index = 3;
private int felhasznalt_tolteny = 0;
public int betarazott_tolteny = 3;
//
private void Start() {
//kezdesnel karikazza be az elso harom adott toltenyt
for (int i = 0; i < tolteny_index; i++) {
toltenyek[i].text = "O";
}
}
public void Betarazas() {
if (tolteny_index < 24) {
//felhasznalt toltenytol megy hogy az ott levo x-et ne irja felul
for (int i = felhasznalt_tolteny; i <= tolteny_index; i++) {
toltenyek[i].text = "O";
}
betarazott_tolteny++;
tolteny_index++;
Debug.Log("Tolteny betarazva");
Debug.Log("Betarazott toltenyek szama: " + betarazott_tolteny);
}
}
public void Loves(int elhasznalt_toltenyek) {
if (felhasznalt_tolteny < betarazott_tolteny) {
if (felhasznalt_tolteny + elhasznalt_toltenyek > betarazott_tolteny) {
Debug.Log("Nincs eleg tolteny betarazva, tul sok lenne egyszerre felhasznalva!");
return;
} else {
felhasznalt_tolteny += elhasznalt_toltenyek;
for (int i = 0; i < felhasznalt_tolteny; i++) {
toltenyek[i].text = "X";
}
}
} else {
Debug.Log("Nincs eleg tolteny");
}
}
}

View File

@@ -24,7 +24,7 @@ MonoBehaviour:
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 99
controlID: 18086
--- !u!114 &2
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -141,7 +141,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 100
controlID: 18087
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -166,7 +166,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 73
controlID: 17923
--- !u!114 &5
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -223,10 +223,10 @@ MonoBehaviour:
m_SaveData: []
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
scrollPos: {x: 0, y: 10}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 28fbffff
m_ExpandedIDs: a0c2ffff28fbffff5e6c0000926c00007a6e0000fa730000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -557,9 +557,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -3.012132, y: -0.46495146, z: -0.21801838}
m_Target: {x: 5.460174, y: 1.2110815, z: -0.5397526}
speed: 2
m_Value: {x: -3.012132, y: -0.46495146, z: -0.21801838}
m_Value: {x: 5.460174, y: 1.2110815, z: -0.5397526}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@@ -610,9 +610,9 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 13.419653
m_Target: 10.343856
speed: 2
m_Value: 13.419653
m_Value: 10.343856
m_Ortho:
m_Target: 1
speed: 2
@@ -661,7 +661,7 @@ MonoBehaviour:
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 101
controlID: 18088
--- !u!114 &10
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -681,8 +681,8 @@ MonoBehaviour:
y: 0
width: 803
height: 355
m_MinSize: {x: 230, y: 250}
m_MaxSize: {x: 10000, y: 10000}
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 11}
m_Panes:
- {fileID: 11}
@@ -742,9 +742,9 @@ MonoBehaviour:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: 14760000
m_LastClickedID: 30228
m_ExpandedIDs: 00000000f4750000
m_SelectedIDs: 16760000
m_LastClickedID: 30230
m_ExpandedIDs: 00000000f4750000f6750000f8750000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -772,7 +772,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 00000000f4750000
m_ExpandedIDs: 00000000f4750000f6750000f8750000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -797,9 +797,9 @@ MonoBehaviour:
m_Icon: {fileID: 0}
m_ResourceFile:
m_ListAreaState:
m_SelectedInstanceIDs:
m_LastClickedInstanceID: 0
m_HadKeyboardFocusLastEvent: 1
m_SelectedInstanceIDs: 6e6c0000
m_LastClickedInstanceID: 27758
m_HadKeyboardFocusLastEvent: 0
m_ExpandedInstanceIDs: c623000000000000
m_RenameOverlay:
m_UserAcceptedRename: 0
@@ -901,8 +901,8 @@ MonoBehaviour:
y: 0
width: 459
height: 947
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
@@ -942,7 +942,7 @@ MonoBehaviour:
m_CachedPref: 160
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1
m_LastInspectedObjectInstanceID: 27758
m_LastVerticalScrollValue: 0
m_GlobalObjectId:
m_InspectorMode: 0