valasztott szam az akciok mezobe megjelenik

This commit is contained in:
2022-11-02 13:15:47 +01:00
parent 73ee069e8b
commit 39b73cf5a8
3 changed files with 111 additions and 100 deletions

View File

@@ -18302,7 +18302,7 @@ SpriteRenderer:
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_SortingOrder: 2
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
m_Color: {r: 1, g: 0, b: 0, a: 1}
m_FlipX: 0

View File

@@ -2,24 +2,38 @@
using UnityEngine;
public class Dice : MonoBehaviour {
public Sprite[] diceSides = new Sprite[6];
public SpriteRenderer hely1;
public SpriteRenderer hely2;
public SpriteRenderer hely3;
private int[] diceResult = { 0, 0 };
public int valasztottErtek; //a jatekos altal valasztott dobott ertek helye
private bool locked = false; //ne lehessen ujra kivalasztani a masikat ha mar tortent egy valasztas
public void ertekValasztas(GameObject gomb) {
//getters setters
public int[] getDices() { return diceResult; }
public int getValasztottErtek() { return valasztottErtek; }
public void setValasztottErtek(int ujErtek) { valasztottErtek = ujErtek; }
public void ertekValasztas(GameObject gomb) {
if (diceResult[0] != 0 && diceResult[1] != 0 && !locked) { //megnezzuk hogy lett e mar dobva es nem valasztott meg a jatekos
if (gomb.name == "dice1btn") {
if (gomb.name == "dice1btn") {
valasztottErtek = diceResult[0];
//a valasztott szam atirasa az akcio mezobe
hely3.sprite = diceSides[valasztottErtek-1];
hely3.size = new Vector2(38, 38);
locked = true;
}else if (gomb.name == "dice2btn") {
} else if (gomb.name == "dice2btn") {
valasztottErtek = diceResult[1];
//a valasztott szam atirasa az akcio mezobe
hely3.sprite = diceSides[valasztottErtek-1];
hely3.size = new Vector2(38, 38);
locked = true;
}
}
@@ -27,9 +41,6 @@ public class Dice : MonoBehaviour {
Debug.Log("valasztott ertek: " + valasztottErtek + "locked status: " + locked);
}
public int[] getDices() { return diceResult; }
private int RollDice(SpriteRenderer renderer) {
int randomDiceSide = Random.Range(0, 5);
int finalSide = randomDiceSide + 1;

View File

@@ -16,12 +16,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 43
width: 1366
height: 685
width: 1920
height: 997
m_ShowMode: 4
m_Title: Hierarchy
m_RootView: {fileID: 2}
m_MinSize: {x: 875, y: 300}
m_MinSize: {x: 875, y: 421}
m_MaxSize: {x: 10000, y: 10000}
m_Maximized: 1
--- !u!114 &2
@@ -44,8 +44,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1366
height: 685
width: 1920
height: 997
m_MinSize: {x: 875, y: 300}
m_MaxSize: {x: 10000, y: 10000}
m_UseTopView: 1
@@ -69,11 +69,11 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1366
width: 1920
height: 30
m_MinSize: {x: 0, y: 0}
m_MaxSize: {x: 0, y: 0}
m_LastLoadedLayoutName:
m_LastLoadedLayoutName: MyLayout
--- !u!114 &4
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -90,8 +90,8 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 665
width: 1366
y: 977
width: 1920
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: 1366
height: 635
width: 1920
height: 947
m_MinSize: {x: 300, y: 200}
m_MaxSize: {x: 24288, y: 16192}
vertical: 0
controlID: 5119
controlID: 299
--- !u!114 &6
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -139,12 +139,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1057
height: 635
width: 1486
height: 947
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 16192, y: 16192}
vertical: 1
controlID: 5196
controlID: 285
--- !u!114 &7
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -164,12 +164,12 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 1057
height: 396
width: 1486
height: 592
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 5197
controlID: 286
--- !u!114 &8
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -187,10 +187,10 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 261
height: 396
m_MinSize: {x: 201, y: 221}
m_MaxSize: {x: 4001, y: 4021}
width: 278
height: 592
m_MinSize: {x: 200, y: 200}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 15}
m_Panes:
- {fileID: 15}
@@ -211,10 +211,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 261
x: 278
y: 0
width: 796
height: 396
width: 1208
height: 592
m_MinSize: {x: 202, y: 221}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 16}
@@ -241,13 +241,13 @@ MonoBehaviour:
m_Position:
serializedVersion: 2
x: 0
y: 396
width: 1057
height: 239
y: 592
width: 1486
height: 355
m_MinSize: {x: 200, y: 100}
m_MaxSize: {x: 16192, y: 8096}
vertical: 0
controlID: 5083
controlID: 202
--- !u!114 &11
MonoBehaviour:
m_ObjectHideFlags: 52
@@ -265,8 +265,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 0
width: 533
height: 239
width: 759
height: 355
m_MinSize: {x: 231, y: 271}
m_MaxSize: {x: 10001, y: 10021}
m_ActualView: {fileID: 17}
@@ -289,10 +289,10 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 533
x: 759
y: 0
width: 524
height: 239
width: 727
height: 355
m_MinSize: {x: 102, y: 121}
m_MaxSize: {x: 4002, y: 4021}
m_ActualView: {fileID: 18}
@@ -315,12 +315,12 @@ MonoBehaviour:
m_Children: []
m_Position:
serializedVersion: 2
x: 1057
x: 1486
y: 0
width: 309
height: 635
m_MinSize: {x: 276, y: 71}
m_MaxSize: {x: 4001, y: 4021}
width: 434
height: 947
m_MinSize: {x: 275, y: 50}
m_MaxSize: {x: 4000, y: 4000}
m_ActualView: {fileID: 19}
m_Panes:
- {fileID: 19}
@@ -346,10 +346,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 262
y: 19
width: 794
height: 375
x: 278
y: 73
width: 1206
height: 571
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -360,11 +360,11 @@ MonoBehaviour:
m_ShowGizmos: 0
m_TargetDisplay: 0
m_ClearColor: {r: 0, g: 0, b: 0, a: 0}
m_TargetSize: {x: 794, y: 354}
m_TargetSize: {x: 1206, y: 550}
m_TextureFilterMode: 0
m_TextureHideFlags: 61
m_RenderIMGUI: 1
m_EnterPlayModeBehavior: 1
m_EnterPlayModeBehavior: 0
m_UseMipMap: 0
m_VSyncEnabled: 0
m_Gizmos: 0
@@ -375,10 +375,10 @@ MonoBehaviour:
m_VRangeLocked: 0
hZoomLockedByDefault: 0
vZoomLockedByDefault: 0
m_HBaseRangeMin: -397
m_HBaseRangeMax: 397
m_VBaseRangeMin: -177
m_VBaseRangeMax: 177
m_HBaseRangeMin: -603
m_HBaseRangeMax: 603
m_VBaseRangeMin: -275
m_VBaseRangeMax: 275
m_HAllowExceedBaseRangeMin: 1
m_HAllowExceedBaseRangeMax: 1
m_VAllowExceedBaseRangeMin: 1
@@ -396,23 +396,23 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 21
width: 794
height: 354
width: 1206
height: 550
m_Scale: {x: 1, y: 1}
m_Translation: {x: 397, y: 177}
m_Translation: {x: 603, y: 275}
m_MarginLeft: 0
m_MarginRight: 0
m_MarginTop: 0
m_MarginBottom: 0
m_LastShownAreaInsideMargins:
serializedVersion: 2
x: -397
y: -177
width: 794
height: 354
x: -603
y: -275
width: 1206
height: 550
m_MinimalGUI: 1
m_defaultScale: 1
m_LastWindowPixelSize: {x: 794, y: 375}
m_LastWindowPixelSize: {x: 1206, y: 571}
m_ClearInEditMode: 1
m_NoCameraWarning: 1
m_LowResolutionForAspectRatios: 01000000000000000000
@@ -440,8 +440,8 @@ MonoBehaviour:
serializedVersion: 2
x: 0
y: 73
width: 260
height: 375
width: 277
height: 571
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -449,9 +449,9 @@ MonoBehaviour:
m_SceneHierarchy:
m_TreeViewState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: d4920000
m_LastClickedID: 37588
m_ExpandedIDs: 7890ffff98c4ffffb2c5fffff09100000c920000b6920000269400000a9500006a950000a0950000e895000070960000a6960000ee960000029700002497000028970000e4970000e8970000
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: e8f1ffff22fbffff906100007e650000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -495,10 +495,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 261
x: 278
y: 73
width: 794
height: 375
width: 1206
height: 571
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -509,8 +509,8 @@ MonoBehaviour:
collapsed: 0
displayed: 1
snapOffset: {x: 0, y: 0}
snapOffsetDelta: {x: 0, y: 0}
snapCorner: 0
snapOffsetDelta: {x: -101, y: -26}
snapCorner: 3
id: Tool Settings
index: 0
layout: 1
@@ -519,9 +519,9 @@ MonoBehaviour:
floating: 0
collapsed: 0
displayed: 1
snapOffset: {x: 101, y: 0}
snapOffset: {x: -141, y: 149}
snapOffsetDelta: {x: 0, y: 0}
snapCorner: 0
snapCorner: 1
id: unity-grid-and-snap-toolbar
index: 1
layout: 1
@@ -755,9 +755,9 @@ MonoBehaviour:
m_PlayAudio: 0
m_AudioPlay: 0
m_Position:
m_Target: {x: -1.2387518, y: -3.281419, z: -0.033249952}
m_Target: {x: -0.4677269, y: 1.711771, z: -0.5999964}
speed: 2
m_Value: {x: -1.2387518, y: -3.281419, z: -0.033249952}
m_Value: {x: -1.0160408, y: 1.6239002, z: -0.59616524}
m_RenderMode: 0
m_CameraMode:
drawMode: 0
@@ -808,15 +808,15 @@ MonoBehaviour:
speed: 2
m_Value: {x: 0, y: 0, z: 0, w: 1}
m_Size:
m_Target: 8.810466
m_Target: 8.896829
speed: 2
m_Value: 8.810466
m_Value: 8.513712
m_Ortho:
m_Target: 1
speed: 2
m_Value: 1
m_CameraSettings:
m_Speed: 1.0005
m_Speed: 1
m_SpeedNormalized: 0.5
m_SpeedMin: 0.001
m_SpeedMax: 2
@@ -856,9 +856,9 @@ MonoBehaviour:
m_Pos:
serializedVersion: 2
x: 0
y: 469
width: 532
height: 218
y: 665
width: 758
height: 334
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -884,14 +884,14 @@ MonoBehaviour:
m_LastFolders:
- Assets/Scripts
m_LastFoldersGridSize: 55
m_LastProjectPath: C:\dev\find the source
m_LastProjectPath: C:\dev\find the source\projekt\FindTheSource
m_LockTracker:
m_IsLocked: 0
m_FolderTreeState:
scrollPos: {x: 0, y: 0}
m_SelectedIDs: a4910000
m_LastClickedID: 37284
m_ExpandedIDs: 000000009e91000000ca9a3bffffff7f
m_SelectedIDs: 0e660000
m_LastClickedID: 26126
m_ExpandedIDs: 0000000002660000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -919,7 +919,7 @@ MonoBehaviour:
scrollPos: {x: 0, y: 0}
m_SelectedIDs:
m_LastClickedID: 0
m_ExpandedIDs: 000000009e91000000ca9a3bffffff7f
m_ExpandedIDs: 0000000002660000
m_RenameOverlay:
m_UserAcceptedRename: 0
m_Name:
@@ -995,10 +995,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 533
y: 469
width: 522
height: 218
x: 759
y: 665
width: 725
height: 334
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -1023,10 +1023,10 @@ MonoBehaviour:
m_Tooltip:
m_Pos:
serializedVersion: 2
x: 1057
x: 1486
y: 73
width: 308
height: 614
width: 433
height: 926
m_ViewDataDictionary: {fileID: 0}
m_OverlayCanvas:
m_LastAppliedPresetName: Default
@@ -1038,7 +1038,7 @@ MonoBehaviour:
m_ControlHash: -371814159
m_PrefName: Preview_InspectorPreview
m_LastInspectedObjectInstanceID: -1
m_LastVerticalScrollValue: 897
m_LastVerticalScrollValue: 0
m_GlobalObjectId:
m_InspectorMode: 0
m_LockTracker: