dice selection working
This commit is contained in:
@@ -2230,6 +2230,7 @@ GameObject:
|
||||
- component: {fileID: 197904218}
|
||||
- component: {fileID: 197904219}
|
||||
- component: {fileID: 197904220}
|
||||
- component: {fileID: 197904221}
|
||||
m_Layer: 0
|
||||
m_Name: Mangager
|
||||
m_TagString: Untagged
|
||||
@@ -2317,15 +2318,27 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
diceSides:
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
- {fileID: 0}
|
||||
hely1: {fileID: 0}
|
||||
hely2: {fileID: 0}
|
||||
diceResult: 0000000000000000
|
||||
- {fileID: 21300000, guid: 8221f9fb8d5a05c4a808bf5562a0261d, type: 3}
|
||||
- {fileID: 21300000, guid: 03a930ad3e9b27d47a72ccbf3b61a4e8, type: 3}
|
||||
- {fileID: 21300000, guid: cebdbbf97a0395c40850121cdfa5eb9c, type: 3}
|
||||
- {fileID: 21300000, guid: 30468b905dedac144b0a8640608dca0c, type: 3}
|
||||
- {fileID: 21300000, guid: 1b26588c2a8b17f4a9fcfc8377102e1d, type: 3}
|
||||
- {fileID: 21300000, guid: 8d8a82287846c3d4892b15d8ab640d68, type: 3}
|
||||
hely1: {fileID: 1620774317}
|
||||
hely2: {fileID: 921900544}
|
||||
valasztottErtek: 0
|
||||
--- !u!114 &197904221
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 197904216}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7187ff75d86420a4981438f408c7dfd6, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
--- !u!1 &253835022
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -2582,6 +2595,141 @@ CanvasRenderer:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 272530646}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &273518332
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 273518333}
|
||||
- component: {fileID: 273518335}
|
||||
- component: {fileID: 273518334}
|
||||
m_Layer: 5
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &273518333
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 273518332}
|
||||
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: 401176106}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &273518334
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 273518332}
|
||||
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: Pass test
|
||||
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: 4281479730
|
||||
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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: 24
|
||||
m_fontSizeBase: 24
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
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 &273518335
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 273518332}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &280090607
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -3868,6 +4016,140 @@ BoxCollider2D:
|
||||
serializedVersion: 2
|
||||
m_Size: {x: 2.3911839, y: 2.7324104}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!1 &401176105
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 401176106}
|
||||
- component: {fileID: 401176109}
|
||||
- component: {fileID: 401176108}
|
||||
- component: {fileID: 401176107}
|
||||
m_Layer: 5
|
||||
m_Name: Passthrough test
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &401176106
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 401176105}
|
||||
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:
|
||||
- {fileID: 273518333}
|
||||
m_Father: {fileID: 891272366}
|
||||
m_RootOrder: 10
|
||||
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: -511, y: -10}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &401176107
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 401176105}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Navigation:
|
||||
m_Mode: 3
|
||||
m_WrapAround: 0
|
||||
m_SelectOnUp: {fileID: 0}
|
||||
m_SelectOnDown: {fileID: 0}
|
||||
m_SelectOnLeft: {fileID: 0}
|
||||
m_SelectOnRight: {fileID: 0}
|
||||
m_Transition: 1
|
||||
m_Colors:
|
||||
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||
m_ColorMultiplier: 1
|
||||
m_FadeDuration: 0.1
|
||||
m_SpriteState:
|
||||
m_HighlightedSprite: {fileID: 0}
|
||||
m_PressedSprite: {fileID: 0}
|
||||
m_SelectedSprite: {fileID: 0}
|
||||
m_DisabledSprite: {fileID: 0}
|
||||
m_AnimationTriggers:
|
||||
m_NormalTrigger: Normal
|
||||
m_HighlightedTrigger: Highlighted
|
||||
m_PressedTrigger: Pressed
|
||||
m_SelectedTrigger: Selected
|
||||
m_DisabledTrigger: Disabled
|
||||
m_Interactable: 1
|
||||
m_TargetGraphic: {fileID: 401176108}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 197904221}
|
||||
m_TargetAssemblyTypeName: Test, Assembly-CSharp
|
||||
m_MethodName: testPass
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &401176108
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 401176105}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, 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_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!222 &401176109
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 401176105}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &410263759
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -9506,6 +9788,7 @@ RectTransform:
|
||||
- {fileID: 1202715285}
|
||||
- {fileID: 731636858}
|
||||
- {fileID: 1393612612}
|
||||
- {fileID: 401176106}
|
||||
m_Father: {fileID: 0}
|
||||
m_RootOrder: 4
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
@@ -9977,7 +10260,19 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 921900542}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 197904220}
|
||||
m_TargetAssemblyTypeName: Dice, Assembly-CSharp
|
||||
m_MethodName: ertekValasztas
|
||||
m_Mode: 2
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 921900538}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &921900542
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -16244,7 +16539,7 @@ RectTransform:
|
||||
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: -505, y: 49}
|
||||
m_AnchoredPosition: {x: -505, y: 67}
|
||||
m_SizeDelta: {x: 160, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1393612613
|
||||
@@ -16294,22 +16589,10 @@ MonoBehaviour:
|
||||
- m_Target: {fileID: 197904220}
|
||||
m_TargetAssemblyTypeName: Dice, Assembly-CSharp
|
||||
m_MethodName: renderDice
|
||||
m_Mode: 2
|
||||
m_Mode: 1
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 1620774311}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
- m_Target: {fileID: 197904220}
|
||||
m_TargetAssemblyTypeName: Dice, Assembly-CSharp
|
||||
m_MethodName: renderDice
|
||||
m_Mode: 2
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 921900538}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_ObjectArgument: {fileID: 0}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
@@ -18763,7 +19046,19 @@ MonoBehaviour:
|
||||
m_TargetGraphic: {fileID: 1620774315}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_Calls:
|
||||
- m_Target: {fileID: 197904220}
|
||||
m_TargetAssemblyTypeName: Dice, Assembly-CSharp
|
||||
m_MethodName: ertekValasztas
|
||||
m_Mode: 2
|
||||
m_Arguments:
|
||||
m_ObjectArgument: {fileID: 1620774311}
|
||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.GameObject, UnityEngine
|
||||
m_IntArgument: 0
|
||||
m_FloatArgument: 0
|
||||
m_StringArgument:
|
||||
m_BoolArgument: 0
|
||||
m_CallState: 2
|
||||
--- !u!114 &1620774315
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -23820,7 +24115,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: Button
|
||||
m_text: Roll Dice
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
using System.Collections;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using System.Threading.Tasks;
|
||||
using System.Threading;
|
||||
|
||||
public class Dice : MonoBehaviour {
|
||||
|
||||
@@ -11,70 +8,47 @@ public class Dice : MonoBehaviour {
|
||||
public SpriteRenderer hely1;
|
||||
public SpriteRenderer hely2;
|
||||
|
||||
public int[] diceResult = new int[2];
|
||||
private int[] diceResult = { 0, 0 };
|
||||
public int valasztottErtek; //a jatekos altal valasztott dobott ertek helye
|
||||
|
||||
private void Start() {
|
||||
//renderer = go.GetComponent<SpriteRenderer>();
|
||||
private bool locked = false; //ne lehessen ujra kivalasztani a masikat ha mar tortent egy valasztas
|
||||
|
||||
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") {
|
||||
valasztottErtek = diceResult[0];
|
||||
locked = true;
|
||||
}else if (gomb.name == "dice2btn") {
|
||||
valasztottErtek = diceResult[1];
|
||||
locked = true;
|
||||
}
|
||||
}
|
||||
|
||||
Debug.Log("valasztott ertek: " + valasztottErtek + "locked status: " + locked);
|
||||
}
|
||||
|
||||
// Ha rákattintassz meghívja a RollTheDice-ot
|
||||
/*public void OnMouseDown()
|
||||
{
|
||||
StartCoroutine("RollTheDice");
|
||||
}*/
|
||||
|
||||
// A RollTheDice
|
||||
/*private IEnumerator RollTheDice()
|
||||
{
|
||||
|
||||
int randomDiceSide = 0;
|
||||
int finalSide = 0;
|
||||
public int[] getDices() { return diceResult; }
|
||||
|
||||
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
randomDiceSide = Random.Range(0, 5);
|
||||
private int RollDice(SpriteRenderer renderer) {
|
||||
int randomDiceSide = Random.Range(0, 5);
|
||||
int finalSide = randomDiceSide + 1;
|
||||
|
||||
rend.sprite = diceSides[Random.Range(0, 5)];
|
||||
rend.size = new Vector2(38, 38);
|
||||
|
||||
yield return new WaitForSeconds(0.05f);
|
||||
}
|
||||
|
||||
finalSide = randomDiceSide + 1;
|
||||
Debug.Log(finalSide);
|
||||
}*/
|
||||
|
||||
public int RollDice(SpriteRenderer renderer) {
|
||||
int randomDiceSide = 0;
|
||||
int finalSide = 0;
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
randomDiceSide = Random.Range(0, 5);
|
||||
|
||||
renderer.sprite = diceSides[Random.Range(0, 5)];
|
||||
renderer.size = new Vector2(38, 38);
|
||||
|
||||
//yield return new WaitForSeconds(0.05f);
|
||||
Thread.Sleep(500);
|
||||
}
|
||||
|
||||
finalSide = randomDiceSide + 1;
|
||||
Debug.Log(finalSide);
|
||||
|
||||
return finalSide;
|
||||
}
|
||||
|
||||
public void renderDice(GameObject go) {
|
||||
public void renderDice() {
|
||||
do {
|
||||
diceResult[0] = RollDice(hely1);
|
||||
diceResult[1] = RollDice(hely2);
|
||||
} while (diceResult[0] == diceResult[1]);
|
||||
|
||||
hely1.sprite = diceSides[diceResult[0]];
|
||||
hely1.sprite = diceSides[diceResult[0]-1];
|
||||
hely1.size = new Vector2(38, 38);
|
||||
|
||||
hely2.sprite = diceSides[diceResult[0]];
|
||||
hely2.sprite = diceSides[diceResult[1]-1];
|
||||
hely2.size = new Vector2(38, 38);
|
||||
}
|
||||
}
|
||||
|
||||
11
Assets/Scripts/Test.cs
Normal file
11
Assets/Scripts/Test.cs
Normal file
@@ -0,0 +1,11 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
public class Test : MonoBehaviour
|
||||
{
|
||||
public void testPass() {
|
||||
Debug.Log("Passhthrough test: " + FindObjectOfType<Dice>().getDices()[0]);
|
||||
Debug.Log("Passhthrough test: " + FindObjectOfType<Dice>().getDices()[1]);
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Test.cs.meta
Normal file
11
Assets/Scripts/Test.cs.meta
Normal file
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7187ff75d86420a4981438f408c7dfd6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -19,12 +19,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: 4302
|
||||
controlID: 21
|
||||
--- !u!114 &2
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
@@ -136,12 +136,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: 4303
|
||||
controlID: 50
|
||||
--- !u!114 &4
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
@@ -161,12 +161,12 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 1057
|
||||
height: 396
|
||||
width: 1486
|
||||
height: 591
|
||||
m_MinSize: {x: 200, y: 100}
|
||||
m_MaxSize: {x: 16192, y: 8096}
|
||||
vertical: 0
|
||||
controlID: 4304
|
||||
controlID: 51
|
||||
--- !u!114 &5
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
@@ -184,8 +184,8 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 261
|
||||
height: 396
|
||||
width: 298
|
||||
height: 591
|
||||
m_MinSize: {x: 201, y: 221}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 6}
|
||||
@@ -215,18 +215,18 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 73
|
||||
width: 260
|
||||
height: 375
|
||||
width: 297
|
||||
height: 570
|
||||
m_ViewDataDictionary: {fileID: 0}
|
||||
m_OverlayCanvas:
|
||||
m_LastAppliedPresetName: Default
|
||||
m_SaveData: []
|
||||
m_SceneHierarchy:
|
||||
m_TreeViewState:
|
||||
scrollPos: {x: 0, y: 560}
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs:
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: 98c4ffffb2c5fffff09100000c920000b69200000a9500006a950000a0950000e895000070960000a6960000ee960000029700002497000028970000e4970000e8970000
|
||||
m_ExpandedIDs: 1efbffff926100009662000068630000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@@ -265,10 +265,10 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 261
|
||||
x: 298
|
||||
y: 0
|
||||
width: 796
|
||||
height: 396
|
||||
width: 1188
|
||||
height: 591
|
||||
m_MinSize: {x: 202, y: 221}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_ActualView: {fileID: 2}
|
||||
@@ -297,10 +297,10 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 261
|
||||
x: 298
|
||||
y: 73
|
||||
width: 794
|
||||
height: 375
|
||||
width: 1186
|
||||
height: 570
|
||||
m_ViewDataDictionary: {fileID: 0}
|
||||
m_OverlayCanvas:
|
||||
m_LastAppliedPresetName: Default
|
||||
@@ -557,9 +557,9 @@ MonoBehaviour:
|
||||
m_PlayAudio: 0
|
||||
m_AudioPlay: 0
|
||||
m_Position:
|
||||
m_Target: {x: -8.970268, y: -1.6368613, z: 0.080547474}
|
||||
m_Target: {x: 1.097747, y: -5.537953, z: -0.028699528}
|
||||
speed: 2
|
||||
m_Value: {x: -8.970268, y: -1.6368613, z: 0.080547474}
|
||||
m_Value: {x: 1.097747, y: -5.537953, z: -0.028699528}
|
||||
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: 2.236849
|
||||
m_Target: 7.9420705
|
||||
speed: 2
|
||||
m_Value: 2.236849
|
||||
m_Value: 7.9420705
|
||||
m_Ortho:
|
||||
m_Target: 1
|
||||
speed: 2
|
||||
@@ -655,13 +655,13 @@ MonoBehaviour:
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 396
|
||||
width: 1057
|
||||
height: 239
|
||||
y: 591
|
||||
width: 1486
|
||||
height: 356
|
||||
m_MinSize: {x: 200, y: 100}
|
||||
m_MaxSize: {x: 16192, y: 8096}
|
||||
vertical: 0
|
||||
controlID: 4258
|
||||
controlID: 64
|
||||
--- !u!114 &10
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 52
|
||||
@@ -679,10 +679,10 @@ MonoBehaviour:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 0
|
||||
width: 535
|
||||
height: 239
|
||||
m_MinSize: {x: 231, y: 271}
|
||||
m_MaxSize: {x: 10001, y: 10021}
|
||||
width: 749
|
||||
height: 356
|
||||
m_MinSize: {x: 230, y: 250}
|
||||
m_MaxSize: {x: 10000, y: 10000}
|
||||
m_ActualView: {fileID: 11}
|
||||
m_Panes:
|
||||
- {fileID: 11}
|
||||
@@ -709,9 +709,9 @@ MonoBehaviour:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 0
|
||||
y: 469
|
||||
width: 534
|
||||
height: 218
|
||||
y: 664
|
||||
width: 748
|
||||
height: 335
|
||||
m_ViewDataDictionary: {fileID: 0}
|
||||
m_OverlayCanvas:
|
||||
m_LastAppliedPresetName: Default
|
||||
@@ -729,22 +729,22 @@ MonoBehaviour:
|
||||
m_SkipHidden: 0
|
||||
m_SearchArea: 1
|
||||
m_Folders:
|
||||
- Assets/Scripts
|
||||
- Assets/Assets/Pics/Dice
|
||||
m_Globs: []
|
||||
m_OriginalText:
|
||||
m_ViewMode: 1
|
||||
m_StartGridSize: 55
|
||||
m_LastFolders:
|
||||
- Assets/Scripts
|
||||
- Assets/Assets/Pics/Dice
|
||||
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: 2a730000
|
||||
m_LastClickedID: 29482
|
||||
m_ExpandedIDs: 00000000ea650000fc65000026730000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@@ -772,7 +772,7 @@ MonoBehaviour:
|
||||
scrollPos: {x: 0, y: 0}
|
||||
m_SelectedIDs:
|
||||
m_LastClickedID: 0
|
||||
m_ExpandedIDs: 000000009e91000000ca9a3bffffff7f
|
||||
m_ExpandedIDs: 00000000ea650000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
m_Name:
|
||||
@@ -797,9 +797,9 @@ MonoBehaviour:
|
||||
m_Icon: {fileID: 0}
|
||||
m_ResourceFile:
|
||||
m_ListAreaState:
|
||||
m_SelectedInstanceIDs: 58baffff
|
||||
m_LastClickedInstanceID: -17832
|
||||
m_HadKeyboardFocusLastEvent: 0
|
||||
m_SelectedInstanceIDs: a85f0000
|
||||
m_LastClickedInstanceID: 24488
|
||||
m_HadKeyboardFocusLastEvent: 1
|
||||
m_ExpandedInstanceIDs: c623000000000000
|
||||
m_RenameOverlay:
|
||||
m_UserAcceptedRename: 0
|
||||
@@ -843,10 +843,10 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 535
|
||||
x: 749
|
||||
y: 0
|
||||
width: 522
|
||||
height: 239
|
||||
width: 737
|
||||
height: 356
|
||||
m_MinSize: {x: 102, y: 121}
|
||||
m_MaxSize: {x: 4002, y: 4021}
|
||||
m_ActualView: {fileID: 13}
|
||||
@@ -874,10 +874,10 @@ MonoBehaviour:
|
||||
m_Tooltip:
|
||||
m_Pos:
|
||||
serializedVersion: 2
|
||||
x: 535
|
||||
y: 469
|
||||
width: 520
|
||||
height: 218
|
||||
x: 749
|
||||
y: 664
|
||||
width: 735
|
||||
height: 335
|
||||
m_ViewDataDictionary: {fileID: 0}
|
||||
m_OverlayCanvas:
|
||||
m_LastAppliedPresetName: Default
|
||||
@@ -897,10 +897,10 @@ MonoBehaviour:
|
||||
m_Children: []
|
||||
m_Position:
|
||||
serializedVersion: 2
|
||||
x: 1057
|
||||
x: 1486
|
||||
y: 0
|
||||
width: 309
|
||||
height: 635
|
||||
width: 434
|
||||
height: 947
|
||||
m_MinSize: {x: 276, y: 71}
|
||||
m_MaxSize: {x: 4001, y: 4021}
|
||||
m_ActualView: {fileID: 15}
|
||||
@@ -928,10 +928,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
|
||||
@@ -942,7 +942,7 @@ MonoBehaviour:
|
||||
m_CachedPref: 160
|
||||
m_ControlHash: -371814159
|
||||
m_PrefName: Preview_InspectorPreview
|
||||
m_LastInspectedObjectInstanceID: -17832
|
||||
m_LastInspectedObjectInstanceID: 24488
|
||||
m_LastVerticalScrollValue: 0
|
||||
m_GlobalObjectId:
|
||||
m_InspectorMode: 0
|
||||
|
||||
Reference in New Issue
Block a user