Merge branch 'main' of https://git.cef.icu/Max/PuzzleGame
This commit is contained in:
commit
50abb6f9a9
31 changed files with 2483 additions and 173 deletions
259
PuzzleGameProject/Assets/Prefabs/BlackDieAbiliy.prefab
Normal file
259
PuzzleGameProject/Assets/Prefabs/BlackDieAbiliy.prefab
Normal file
|
|
@ -0,0 +1,259 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &5293741749250652686
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4874973863404433756}
|
||||
- component: {fileID: 1855216729025243642}
|
||||
- component: {fileID: 6494629451359164186}
|
||||
m_Layer: 0
|
||||
m_Name: Text (TMP)
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &4874973863404433756
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5293741749250652686}
|
||||
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: 8989188457857827130}
|
||||
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!222 &1855216729025243642
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5293741749250652686}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6494629451359164186
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5293741749250652686}
|
||||
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:
|
||||
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_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 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!1 &6167039396952026974
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8989188457857827130}
|
||||
- component: {fileID: 7568565659390603518}
|
||||
- component: {fileID: 9157113186282288804}
|
||||
- component: {fileID: 1648245930821754079}
|
||||
m_Layer: 0
|
||||
m_Name: BlackDieAbiliy
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8989188457857827130
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6167039396952026974}
|
||||
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: 4874973863404433756}
|
||||
m_Father: {fileID: 0}
|
||||
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: 0, y: 0}
|
||||
m_SizeDelta: {x: 30, y: 30}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &7568565659390603518
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6167039396952026974}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &9157113186282288804
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6167039396952026974}
|
||||
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: 0.21698111, g: 0.21698111, b: 0.21698111, 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: 0
|
||||
m_FillMethod: 4
|
||||
m_FillAmount: 1
|
||||
m_FillClockwise: 1
|
||||
m_FillOrigin: 0
|
||||
m_UseSpriteMesh: 0
|
||||
m_PixelsPerUnitMultiplier: 1
|
||||
--- !u!114 &1648245930821754079
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6167039396952026974}
|
||||
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: 9157113186282288804}
|
||||
m_OnClick:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 66fcddbe7a3c341c5b9ca4f8801259a6
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
8
PuzzleGameProject/Assets/Prefabs/Rooms.meta
Normal file
8
PuzzleGameProject/Assets/Prefabs/Rooms.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 019e87d54a9324c11a1797ffdd19e836
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
409
PuzzleGameProject/Assets/Prefabs/Rooms/Monster Room.prefab
Normal file
409
PuzzleGameProject/Assets/Prefabs/Rooms/Monster Room.prefab
Normal file
|
|
@ -0,0 +1,409 @@
|
|||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &2435349004046080434
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9187907134033443523}
|
||||
- component: {fileID: 3406749035128918688}
|
||||
- component: {fileID: 1770509300873928573}
|
||||
- component: {fileID: 4019891345885281529}
|
||||
- component: {fileID: -1465197196826248026}
|
||||
m_Layer: 0
|
||||
m_Name: Monster Room
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!4 &9187907134033443523
|
||||
Transform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: 0.3302, y: -1.2268, z: 0}
|
||||
m_LocalScale: {x: 2, y: 2, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 2539620726141895785}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &3406749035128918688
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 7646eec3a0fb541528b0d43bb830e4bf, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
adjacentRooms: []
|
||||
isEntrance: 0
|
||||
keyType: 0
|
||||
locks:
|
||||
numberTextObject: {fileID: 8119019481281764985}
|
||||
--- !u!212 &1770509300873928573
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
m_Enabled: 1
|
||||
m_CastShadows: 0
|
||||
m_ReceiveShadows: 0
|
||||
m_DynamicOccludee: 1
|
||||
m_StaticShadowCaster: 0
|
||||
m_MotionVectors: 1
|
||||
m_LightProbeUsage: 1
|
||||
m_ReflectionProbeUsage: 1
|
||||
m_RayTracingMode: 0
|
||||
m_RayTraceProcedural: 0
|
||||
m_RayTracingAccelStructBuildFlagsOverride: 0
|
||||
m_RayTracingAccelStructBuildFlags: 1
|
||||
m_SmallMeshCulling: 1
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
m_StaticBatchRoot: {fileID: 0}
|
||||
m_ProbeAnchor: {fileID: 0}
|
||||
m_LightProbeVolumeOverride: {fileID: 0}
|
||||
m_ScaleInLightmap: 1
|
||||
m_ReceiveGI: 1
|
||||
m_PreserveUVs: 0
|
||||
m_IgnoreNormalsForChartDetection: 0
|
||||
m_ImportantGI: 0
|
||||
m_StitchLightmapSeams: 1
|
||||
m_SelectedEditorRenderState: 0
|
||||
m_MinimumChartSize: 4
|
||||
m_AutoUVMaxDistance: 0.5
|
||||
m_AutoUVMaxAngle: 89
|
||||
m_LightmapParameters: {fileID: 0}
|
||||
m_SortingLayerID: 0
|
||||
m_SortingLayer: 0
|
||||
m_SortingOrder: 0
|
||||
m_Sprite: {fileID: 7482667652216324306, guid: 311925a002f4447b3a28927169b83ea6, type: 3}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_FlipX: 0
|
||||
m_FlipY: 0
|
||||
m_DrawMode: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_AdaptiveModeThreshold: 0.5
|
||||
m_SpriteTileMode: 0
|
||||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!61 &4019891345885281529
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_Density: 1
|
||||
m_Material: {fileID: 0}
|
||||
m_IncludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_ExcludeLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 0
|
||||
m_LayerOverridePriority: 0
|
||||
m_ForceSendLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ForceReceiveLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_ContactCaptureLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_CallbackLayers:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
m_IsTrigger: 1
|
||||
m_UsedByEffector: 0
|
||||
m_CompositeOperation: 0
|
||||
m_CompositeOrder: 0
|
||||
m_Offset: {x: 0, y: 0}
|
||||
m_SpriteTilingProperty:
|
||||
border: {x: 0, y: 0, z: 0, w: 0}
|
||||
pivot: {x: 0.5, y: 0.5}
|
||||
oldSize: {x: 1, y: 1}
|
||||
newSize: {x: 1, y: 1}
|
||||
adaptiveTilingThreshold: 0.5
|
||||
drawMode: 0
|
||||
adaptiveTiling: 0
|
||||
m_AutoTiling: 0
|
||||
m_Size: {x: 1, y: 1}
|
||||
m_EdgeRadius: 0
|
||||
--- !u!114 &-1465197196826248026
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_EffectColor: {r: 0, g: 1, b: 0.09941673, a: 0.5}
|
||||
m_EffectDistance: {x: 10, y: 10}
|
||||
m_UseGraphicAlpha: 1
|
||||
--- !u!1 &7488793311042651820
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2539620726141895785}
|
||||
- component: {fileID: 5098311427343145193}
|
||||
- component: {fileID: 8840412798147865769}
|
||||
- component: {fileID: 3878377942961622899}
|
||||
m_Layer: 0
|
||||
m_Name: NumberCanvas
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2539620726141895785
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7488793311042651820}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
m_LocalPosition: {x: 0, y: 0, z: 0}
|
||||
m_LocalScale: {x: 0.0008, y: 0.0008, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children:
|
||||
- {fileID: 6916722731958000395}
|
||||
m_Father: {fileID: 9187907134033443523}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0.0012, y: -0.0025}
|
||||
m_SizeDelta: {x: 1246.4895, y: 1249.6101}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!223 &5098311427343145193
|
||||
Canvas:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7488793311042651820}
|
||||
m_Enabled: 1
|
||||
serializedVersion: 3
|
||||
m_RenderMode: 2
|
||||
m_Camera: {fileID: 0}
|
||||
m_PlaneDistance: 100
|
||||
m_PixelPerfect: 0
|
||||
m_ReceivesEvents: 1
|
||||
m_OverrideSorting: 0
|
||||
m_OverridePixelPerfect: 0
|
||||
m_SortingBucketNormalizedSize: 0
|
||||
m_VertexColorAlwaysGammaSpace: 0
|
||||
m_AdditionalShaderChannelsFlag: 25
|
||||
m_UpdateRectTransformForStandalone: 0
|
||||
m_SortingLayerID: 0
|
||||
m_SortingOrder: 0
|
||||
m_TargetDisplay: 0
|
||||
--- !u!114 &8840412798147865769
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7488793311042651820}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_UiScaleMode: 0
|
||||
m_ReferencePixelsPerUnit: 100
|
||||
m_ScaleFactor: 1
|
||||
m_ReferenceResolution: {x: 800, y: 600}
|
||||
m_ScreenMatchMode: 0
|
||||
m_MatchWidthOrHeight: 0
|
||||
m_PhysicalUnit: 3
|
||||
m_FallbackScreenDPI: 96
|
||||
m_DefaultSpriteDPI: 96
|
||||
m_DynamicPixelsPerUnit: 1
|
||||
m_PresetInfoIsWorld: 1
|
||||
--- !u!114 &3878377942961622899
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7488793311042651820}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_IgnoreReversedGraphics: 1
|
||||
m_BlockingObjects: 0
|
||||
m_BlockingMask:
|
||||
serializedVersion: 2
|
||||
m_Bits: 4294967295
|
||||
--- !u!1 &8119019481281764985
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 6916722731958000395}
|
||||
- component: {fileID: 4388791003193272984}
|
||||
- component: {fileID: 1449398387393309740}
|
||||
m_Layer: 0
|
||||
m_Name: FirstNumber
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &6916722731958000395
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8119019481281764985}
|
||||
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: 2539620726141895785}
|
||||
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: 486.7102, y: 485.13855}
|
||||
m_SizeDelta: {x: 273, y: 279.3}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4388791003193272984
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8119019481281764985}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &1449398387393309740
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 8119019481281764985}
|
||||
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: 10
|
||||
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: 4278190080
|
||||
m_fontColor: {r: 0, 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: 200
|
||||
m_fontSizeBase: 200
|
||||
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_TextWrappingMode: 1
|
||||
m_wordWrappingRatios: 0.4
|
||||
m_overflowMode: 0
|
||||
m_linkedTextComponent: {fileID: 0}
|
||||
parentLinkedComponent: {fileID: 0}
|
||||
m_enableKerning: 0
|
||||
m_ActiveFontFeatures: 6e72656b
|
||||
m_enableExtraPadding: 0
|
||||
checkPaddingRequired: 0
|
||||
m_isRichText: 1
|
||||
m_EmojiFallbackSupport: 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}
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
fileFormatVersion: 2
|
||||
guid: dffcf67f187414eacb9e7abf6d8cf39b
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -9,8 +9,8 @@ GameObject:
|
|||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 9187907134033443523}
|
||||
- component: {fileID: 849256457500513523}
|
||||
- component: {fileID: 1770509300873928573}
|
||||
- component: {fileID: 2727030095425591755}
|
||||
- component: {fileID: 4019891345885281529}
|
||||
- component: {fileID: -1465197196826248026}
|
||||
m_Layer: 0
|
||||
|
|
@ -36,6 +36,23 @@ Transform:
|
|||
- {fileID: 2539620726141895785}
|
||||
m_Father: {fileID: 0}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
--- !u!114 &849256457500513523
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: a0eb90a8b6576487b8e5fac5c80e781d, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
adjacentRooms: []
|
||||
isEntrance: 0
|
||||
keyType: 0
|
||||
numberTextObject: {fileID: 8119019481281764985}
|
||||
number: 0
|
||||
--- !u!212 &1770509300873928573
|
||||
SpriteRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -91,22 +108,6 @@ SpriteRenderer:
|
|||
m_WasSpriteAssigned: 1
|
||||
m_MaskInteraction: 0
|
||||
m_SpriteSortPoint: 0
|
||||
--- !u!114 &2727030095425591755
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2435349004046080434}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 129987f6d2a5e97458682506ddec4576, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
number: 0
|
||||
numberTextObject: {fileID: 8119019481281764985}
|
||||
adjacentRooms: []
|
||||
isEntrance: 0
|
||||
--- !u!61 &4019891345885281529
|
||||
BoxCollider2D:
|
||||
m_ObjectHideFlags: 0
|
||||
|
|
@ -344,8 +345,8 @@ MonoBehaviour:
|
|||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
rgba: 4278190080
|
||||
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
File diff suppressed because it is too large
Load diff
8
PuzzleGameProject/Assets/Scripts/Abilities.meta
Normal file
8
PuzzleGameProject/Assets/Scripts/Abilities.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 69edbaa8bf5994173afe7cd0eef03075
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
@ -0,0 +1,74 @@
|
|||
using System;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
namespace Abilities
|
||||
{
|
||||
public class BlackDieAbility : MonoBehaviour
|
||||
{
|
||||
public static event Action AbilitySelected;
|
||||
|
||||
[SerializeField] private GameObject abilityUseOne;
|
||||
[SerializeField] private GameObject abilityUseTwo;
|
||||
[SerializeField] private GameObject abilityUseThree;
|
||||
[SerializeField] private int _uses = 3;
|
||||
|
||||
private GameObject[] _usesUsed;
|
||||
private bool _canClick;
|
||||
|
||||
private void OnEnable() {
|
||||
GameManager.StateChanged += HandleStateChanged;
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
GameManager.StateChanged -= HandleStateChanged;
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
_usesUsed = new GameObject[_uses];
|
||||
abilityUseOne.GetComponent<Button>().onClick.AddListener(() => UseClicked(abilityUseOne));
|
||||
abilityUseTwo.GetComponent<Button>().onClick.AddListener(() => UseClicked(abilityUseTwo));
|
||||
abilityUseThree.GetComponent<Button>().onClick.AddListener(() => UseClicked(abilityUseThree));
|
||||
}
|
||||
|
||||
private void UseClicked(GameObject abilityUseObject) {
|
||||
if (!_canClick) return;
|
||||
|
||||
if (_uses > 0)
|
||||
{
|
||||
_usesUsed[_uses - 1] = abilityUseObject;
|
||||
MarkUseUsed(abilityUseObject);
|
||||
AbilitySelected?.Invoke();
|
||||
_uses -= 1;
|
||||
}
|
||||
}
|
||||
|
||||
private void MarkUseUsed(GameObject useObject) {
|
||||
useObject.GetComponentInChildren<TextMeshProUGUI>().text = "X";
|
||||
}
|
||||
|
||||
private void UnmarkUseUsed(GameObject useObject) {
|
||||
useObject.GetComponentInChildren<TextMeshProUGUI>().text = string.Empty;
|
||||
}
|
||||
|
||||
public void AbilitySelectedButNotUsed() {
|
||||
UnmarkUseUsed(_usesUsed[_uses - 1]);
|
||||
_uses += 1;
|
||||
}
|
||||
|
||||
private void HandleStateChanged(GameState state) {
|
||||
switch (state)
|
||||
{
|
||||
case GameState.PickDiceOne:
|
||||
case GameState.PickDiceTwo:
|
||||
_canClick = true;
|
||||
break;
|
||||
default:
|
||||
_canClick = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 79af16baa8fbe4744817b63d2b6f2007
|
||||
|
|
@ -6,6 +6,8 @@ public class DicePair
|
|||
|
||||
public void SelectDie(Die die)
|
||||
{
|
||||
if (ContainsDie(die)) return;
|
||||
|
||||
if (_pair.Item1 == null && _pair.Item2 == null)
|
||||
{
|
||||
_pair.Item1 = die;
|
||||
|
|
|
|||
|
|
@ -39,11 +39,11 @@ public class DiceRoller: MonoBehaviour
|
|||
_rolledBlackDice.Clear();
|
||||
for (int i = 0; i < NUMBER_OF_WHITE_DICE; i++)
|
||||
{
|
||||
_rolledWhiteDice.Add(_randomGen.Next(1,6));
|
||||
_rolledWhiteDice.Add(_randomGen.Next(1,7));
|
||||
}
|
||||
for (int i = 0; i < NUMBER_OF_BLACK_DICE; i++)
|
||||
{
|
||||
_rolledBlackDice.Add(_randomGen.Next(1,6));
|
||||
_rolledBlackDice.Add(_randomGen.Next(1,7));
|
||||
}
|
||||
diceRolled?.Invoke(this, EventArgs.Empty);
|
||||
UpdateGUI();
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
using System;
|
||||
using Abilities;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
|
||||
|
|
@ -15,12 +17,24 @@ public class Die : MonoBehaviour
|
|||
private int _result = 0;
|
||||
[SerializeField] private Button dieButton; // assign in the editor
|
||||
private Color originalColor;
|
||||
public event EventHandler<Die> DieClicked;
|
||||
private bool _isClickable = false;
|
||||
private bool _selected = false;
|
||||
private bool _blackDieAbilityUsed = false;
|
||||
public event Action<Die> DieSelected;
|
||||
public event Action<Die> DieUnselected;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
dieButton.onClick.AddListener(() => { DiePressed();});
|
||||
private void OnEnable() {
|
||||
GameManager.StateChanged += HandleStateChange;
|
||||
BlackDieAbility.AbilitySelected += HandleOnBlackDieAbilitySelected;
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
GameManager.StateChanged -= HandleStateChange;
|
||||
BlackDieAbility.AbilitySelected -= HandleOnBlackDieAbilitySelected;
|
||||
}
|
||||
|
||||
private void Start() {
|
||||
dieButton.onClick.AddListener(DiePressed);
|
||||
originalColor = gameObject.GetComponent<Image>().color;
|
||||
}
|
||||
|
||||
|
|
@ -34,8 +48,8 @@ public class Die : MonoBehaviour
|
|||
return _result;
|
||||
}
|
||||
|
||||
public void ResetDie()
|
||||
{
|
||||
public void ResetDie() {
|
||||
_selected = false;
|
||||
gameObject.GetComponent<Image>().color = originalColor;
|
||||
gameObject.GetComponent<Outline>().enabled = false;
|
||||
}
|
||||
|
|
@ -56,18 +70,50 @@ public class Die : MonoBehaviour
|
|||
|
||||
private void DiePressed()
|
||||
{
|
||||
DieClicked?.Invoke(this, this);
|
||||
if (!_isClickable || (color == DiceColor.Black && !_blackDieAbilityUsed)) return;
|
||||
|
||||
if (_selected)
|
||||
{
|
||||
DieUnselected?.Invoke(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
DieSelected?.Invoke(this);
|
||||
}
|
||||
}
|
||||
|
||||
private void DieSelectedButPairNotComplete()
|
||||
{
|
||||
_selected = true;
|
||||
gameObject.GetComponent<Outline>().enabled = true;
|
||||
}
|
||||
|
||||
private void DieSelectedAndPairComplete()
|
||||
{
|
||||
private void DieSelectedAndPairComplete() {
|
||||
_selected = true;
|
||||
gameObject.GetComponent<Outline>().enabled = false;
|
||||
gameObject.GetComponent<Image>().color =
|
||||
ColorHelper.AddColorTint(gameObject.GetComponent<Image>().color, ColorHelper.OkayGreen, 0.5f);
|
||||
}
|
||||
|
||||
private void HandleStateChange(GameState state) {
|
||||
switch (state)
|
||||
{
|
||||
case GameState.PickDiceOne:
|
||||
case GameState.PickDiceTwo:
|
||||
case GameState.PickRoomOne:
|
||||
case GameState.PickRoomTwo:
|
||||
_isClickable = true;
|
||||
break;
|
||||
case GameState.RollDice:
|
||||
_isClickable = false;
|
||||
break;
|
||||
default:
|
||||
_isClickable = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleOnBlackDieAbilitySelected() {
|
||||
_blackDieAbilityUsed = true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,7 +2,9 @@ using System;
|
|||
using UnityEngine;
|
||||
using Object = UnityEngine.Object;
|
||||
using System.Collections.Generic;
|
||||
using Abilities;
|
||||
using TMPro;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
public enum GameState
|
||||
{
|
||||
|
|
@ -14,31 +16,46 @@ public enum GameState
|
|||
}
|
||||
public class GameManager : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameState state;
|
||||
[SerializeField] public GameState state;
|
||||
[SerializeField] private GameObject rooms;
|
||||
[SerializeField] private DiceRoller diceRoller;
|
||||
[SerializeField] private PassManager passManager;
|
||||
[SerializeField] private Player player;
|
||||
|
||||
private DicePair _dicePairOne = new DicePair();
|
||||
private DicePair _dicePairTwo = new DicePair();
|
||||
private DicePair _dicePairOne = new();
|
||||
private DicePair _dicePairTwo = new();
|
||||
public static event Action<GameState> StateChanged;
|
||||
public static event Action<DicePair> DiceSelected;
|
||||
public static event Action DiceUnselected;
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
diceRoller.diceRolled += DiceRolled;
|
||||
passManager.PassRequested += PassRequested;
|
||||
foreach (Transform roomTransform in rooms.transform)
|
||||
{
|
||||
roomTransform.gameObject.GetComponent<Room>().ValidRoomClicked += ValidRoomClicked;
|
||||
}
|
||||
foreach (Transform diceTransform in diceRoller.dice.transform)
|
||||
{
|
||||
diceTransform.gameObject.GetComponent<Die>().DieClicked += DieClicked;
|
||||
diceTransform.gameObject.GetComponent<Die>().DieSelected += HandleDieSelected;
|
||||
diceTransform.gameObject.GetComponent<Die>().DieUnselected += HandleDieUnselected;
|
||||
}
|
||||
StartNewTurn();
|
||||
}
|
||||
|
||||
private void ChangeState(GameState stateToChangeTo) {
|
||||
if (state != stateToChangeTo)
|
||||
{
|
||||
state = stateToChangeTo;
|
||||
StateChanged?.Invoke(state);
|
||||
}
|
||||
}
|
||||
|
||||
private void StartNewTurn()
|
||||
{
|
||||
state = GameState.RollDice;
|
||||
ChangeState(GameState.RollDice);
|
||||
diceRoller.Enable();
|
||||
diceRoller.ResetDice();
|
||||
_dicePairOne = new DicePair();
|
||||
|
|
@ -46,11 +63,6 @@ public class GameManager : MonoBehaviour
|
|||
}
|
||||
|
||||
void ValidRoomClicked(object sender, Room room) {
|
||||
if (state != GameState.PickRoomOne && state != GameState.PickRoomTwo)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case GameState.PickRoomOne when !room.TryUnlock(_dicePairOne):
|
||||
|
|
@ -61,94 +73,65 @@ public class GameManager : MonoBehaviour
|
|||
room.SetRoomExplored();
|
||||
if (state == GameState.PickRoomOne)
|
||||
{
|
||||
state = GameState.PickDiceTwo;
|
||||
ChangeState(GameState.PickDiceTwo);
|
||||
}
|
||||
else
|
||||
{
|
||||
StartNewTurn();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void DieClicked(object sender, Die die)
|
||||
{
|
||||
private void HandleDieSelected(Die die) {
|
||||
switch (state)
|
||||
{
|
||||
case GameState.PickDiceOne:
|
||||
{
|
||||
if (!_dicePairOne.ContainsDie(die))
|
||||
_dicePairOne.SelectDie(die);
|
||||
if (_dicePairOne.AreBothDiceSelected())
|
||||
{
|
||||
_dicePairOne.SelectDie(die);
|
||||
|
||||
if (_dicePairOne.AreBothDiceSelected())
|
||||
{
|
||||
state = GameState.PickRoomOne;
|
||||
HighLightValidRoomsWithNumber(_dicePairOne);
|
||||
}
|
||||
ChangeState(GameState.PickRoomOne);
|
||||
DiceSelected?.Invoke(_dicePairOne);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dicePairOne.UnselectDie(die);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
case GameState.PickDiceTwo:
|
||||
{
|
||||
if (!_dicePairTwo.ContainsDie(die) && !_dicePairOne.ContainsDie(die))
|
||||
_dicePairTwo.SelectDie(die);
|
||||
if (_dicePairTwo.AreBothDiceSelected())
|
||||
{
|
||||
_dicePairTwo.SelectDie(die);
|
||||
|
||||
if (_dicePairTwo.AreBothDiceSelected())
|
||||
{
|
||||
state = GameState.PickRoomTwo;
|
||||
HighLightValidRoomsWithNumber(_dicePairTwo);
|
||||
}
|
||||
ChangeState(GameState.PickRoomTwo);
|
||||
DiceSelected?.Invoke(_dicePairTwo);
|
||||
}
|
||||
else if (_dicePairTwo.ContainsDie(die))
|
||||
{
|
||||
_dicePairTwo.UnselectDie(die);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void HandleDieUnselected(Die die) {
|
||||
switch (state)
|
||||
{
|
||||
case GameState.PickDiceOne:
|
||||
case GameState.PickRoomOne:
|
||||
if (_dicePairOne.ContainsDie(die))
|
||||
if (state == GameState.PickRoomOne)
|
||||
{
|
||||
_dicePairOne.UnselectDie(die);
|
||||
UnhighLightRoomsAsOptions();
|
||||
state = GameState.PickDiceOne;
|
||||
ChangeState(GameState.PickDiceOne);
|
||||
}
|
||||
_dicePairOne.UnselectDie(die);
|
||||
DiceUnselected?.Invoke();
|
||||
break;
|
||||
case GameState.PickDiceTwo:
|
||||
case GameState.PickRoomTwo:
|
||||
if (_dicePairTwo.ContainsDie(die))
|
||||
if (state == GameState.PickRoomTwo)
|
||||
{
|
||||
_dicePairTwo.UnselectDie(die);
|
||||
UnhighLightRoomsAsOptions();
|
||||
state = GameState.PickDiceTwo;
|
||||
ChangeState(GameState.PickDiceTwo);
|
||||
}
|
||||
_dicePairTwo.UnselectDie(die);
|
||||
DiceUnselected?.Invoke();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void HighLightValidRoomsWithNumber(DicePair pair)
|
||||
{
|
||||
foreach (Transform roomTransform in rooms.transform)
|
||||
{
|
||||
Room room = roomTransform.gameObject.GetComponent<Room>();
|
||||
if (room.TryUnlock(pair) && room.IsValidRoomToExplore())
|
||||
{
|
||||
room.HighlightRoomAsOption();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void UnhighLightRoomsAsOptions()
|
||||
{
|
||||
foreach (Transform roomTransform in rooms.transform)
|
||||
{
|
||||
roomTransform.gameObject.GetComponent<Room>().UnhighlightRoomAsOption();
|
||||
}
|
||||
private void PassTurn() {
|
||||
player.TakeDamage(1);
|
||||
StartNewTurn();
|
||||
}
|
||||
|
||||
private void DiceRolled(object sender, EventArgs e)
|
||||
|
|
@ -156,7 +139,14 @@ public class GameManager : MonoBehaviour
|
|||
if (state == GameState.RollDice)
|
||||
{
|
||||
diceRoller.Disable();
|
||||
state = GameState.PickDiceOne;
|
||||
ChangeState(GameState.PickDiceOne);
|
||||
}
|
||||
}
|
||||
|
||||
private void PassRequested(object sender, EventArgs e) {
|
||||
if (state is GameState.PickDiceOne or GameState.PickDiceTwo)
|
||||
{
|
||||
PassTurn();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,2 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 85fe57d438ef1ec4fa8b36b9c17c11a4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 1
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
|||
|
|
@ -14,6 +14,18 @@ public class PassManager : MonoBehaviour
|
|||
void Start()
|
||||
{
|
||||
passButton.onClick.AddListener(OnPassClicked);
|
||||
GameManager.StateChanged += HandleStateChange;
|
||||
}
|
||||
|
||||
private void HandleStateChange(GameState state) {
|
||||
if (state == GameState.RollDice)
|
||||
{
|
||||
passButton.interactable = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
passButton.interactable = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPassClicked()
|
||||
|
|
|
|||
|
|
@ -1,2 +1,11 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 95487118287b4514fb9b9fb7018ae717
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
|
|
|||
|
|
@ -1,33 +1,39 @@
|
|||
using System;
|
||||
using Microsoft.Unity.VisualStudio.Editor;
|
||||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class Player : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private int health;
|
||||
[SerializeField] private int maxHealth;
|
||||
[SerializeField] private GameObject healthGameObject;
|
||||
private int _healthIndex = 0;
|
||||
private readonly int[] _healthBar = {0, 0, -1, -2, -4, -6, -9, -12, -16, -20};
|
||||
|
||||
private void Start() {
|
||||
UpdateGUI();
|
||||
}
|
||||
|
||||
public void TakeDamage(int damage)
|
||||
{
|
||||
if (health + damage > 0)
|
||||
if (_healthIndex + damage < _healthBar.Length)
|
||||
{
|
||||
health -= damage;
|
||||
_healthIndex += damage;
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
|
||||
public void Heal(int healAmount)
|
||||
{
|
||||
if (health + healAmount <= maxHealth)
|
||||
if (_healthIndex - healAmount >= 0)
|
||||
{
|
||||
health += healAmount;
|
||||
_healthIndex -= healAmount;
|
||||
UpdateGUI();
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateGUI()
|
||||
{
|
||||
healthGameObject.GetComponent<TextMeshProUGUI>().text = health.ToString();
|
||||
healthGameObject.GetComponent<TextMeshProUGUI>().text = _healthBar[_healthIndex].ToString();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
41
PuzzleGameProject/Assets/Scripts/PlayerController.cs
Normal file
41
PuzzleGameProject/Assets/Scripts/PlayerController.cs
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
using UnityEngine;
|
||||
using UnityEngine.EventSystems;
|
||||
|
||||
public class PlayerController : MonoBehaviour
|
||||
{
|
||||
private Vector3 _lastMousePosition;
|
||||
private Camera _camera;
|
||||
private bool _canMove;
|
||||
|
||||
private void Start() {
|
||||
_camera = Camera.main;
|
||||
}
|
||||
|
||||
private void Update() {
|
||||
CheckMovementInput();
|
||||
}
|
||||
|
||||
private void CheckMovementInput() {
|
||||
if (Input.GetMouseButtonDown(0))
|
||||
{
|
||||
_lastMousePosition = Input.mousePosition;
|
||||
_canMove = !IsMouseOverUI();
|
||||
}
|
||||
|
||||
if (!Input.GetMouseButton(0) || !_canMove) return;
|
||||
|
||||
Vector3 mouseWorldPoint = _camera.ScreenToWorldPoint(Input.mousePosition);
|
||||
Vector3 lastWorldPoint = _camera.ScreenToWorldPoint(_lastMousePosition);
|
||||
|
||||
Vector3 delta = mouseWorldPoint - lastWorldPoint;
|
||||
|
||||
_lastMousePosition = Input.mousePosition;
|
||||
|
||||
_camera.transform.position -= delta;
|
||||
}
|
||||
|
||||
private bool IsMouseOverUI() {
|
||||
return EventSystem.current.IsPointerOverGameObject();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 01621b291be214dc6bf7ab90a7cb0d79
|
||||
8
PuzzleGameProject/Assets/Scripts/Rooms.meta
Normal file
8
PuzzleGameProject/Assets/Scripts/Rooms.meta
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 78d0e4d369ddb4b2faafc371989b76ca
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
50
PuzzleGameProject/Assets/Scripts/Rooms/EmptyRoom.cs
Normal file
50
PuzzleGameProject/Assets/Scripts/Rooms/EmptyRoom.cs
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
|
||||
public class EmptyRoom : Room
|
||||
{
|
||||
[SerializeField] private GameObject numberTextObject;
|
||||
[SerializeField] private int number;
|
||||
|
||||
protected override void InitializeRoom() {
|
||||
base.InitializeRoom();
|
||||
TextMeshProUGUI numberText = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||
if (keyType == KeyType.Number)
|
||||
{
|
||||
numberText.SetText(number.ToString());
|
||||
}
|
||||
else if (keyType == KeyType.MatchingDice)
|
||||
{
|
||||
numberText.SetText("=");
|
||||
}
|
||||
}
|
||||
|
||||
public override bool TryUnlock(DicePair pair)
|
||||
{
|
||||
switch (keyType)
|
||||
{
|
||||
case KeyType.Number:
|
||||
if (number == pair.Sum())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case KeyType.MatchingDice:
|
||||
if (pair.DoResultsMatch())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void SetRoomExplored() {
|
||||
_isExplored = true;
|
||||
UnhighlightRoomAsOption();
|
||||
gameObject.GetComponent<SpriteRenderer>().color =
|
||||
ColorHelper.AddColorTint(gameObject.GetComponent<SpriteRenderer>().color, Color.grey, 0.5f);
|
||||
}
|
||||
}
|
||||
2
PuzzleGameProject/Assets/Scripts/Rooms/EmptyRoom.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/Rooms/EmptyRoom.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: a0eb90a8b6576487b8e5fac5c80e781d
|
||||
16
PuzzleGameProject/Assets/Scripts/Rooms/Key.cs
Normal file
16
PuzzleGameProject/Assets/Scripts/Rooms/Key.cs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
using UnityEngine;
|
||||
|
||||
public class Key : MonoBehaviour
|
||||
{
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
// Update is called once per frame
|
||||
void Update()
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
2
PuzzleGameProject/Assets/Scripts/Rooms/Key.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/Rooms/Key.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 65db8ffa325fb48e89716418fa310bca
|
||||
53
PuzzleGameProject/Assets/Scripts/Rooms/Monster Room.cs
Normal file
53
PuzzleGameProject/Assets/Scripts/Rooms/Monster Room.cs
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TMPro;
|
||||
|
||||
public class MonsterRoom : Room
|
||||
{
|
||||
[SerializeField] private List<int> locks = new();
|
||||
[SerializeField] private GameObject numberTextObject;
|
||||
[SerializeField] private int _health; // Number of times the room needs to be unlocked before becoming explored.
|
||||
|
||||
protected override void InitializeRoom() {
|
||||
base.InitializeRoom();
|
||||
|
||||
// Create the lock numbers on the room.
|
||||
numberTextObject.GetComponent<TextMeshProUGUI>().text = locks[0].ToString();
|
||||
GameObject lockToDuplicate = numberTextObject;
|
||||
for (int i = 1; i < locks.Count; i++)
|
||||
{
|
||||
lockToDuplicate = DuplicateToTheLeft(lockToDuplicate, ((RectTransform)lockToDuplicate.transform).rect.width);
|
||||
lockToDuplicate.GetComponent<TextMeshProUGUI>().text = locks[i].ToString();
|
||||
}
|
||||
}
|
||||
|
||||
public override bool TryUnlock(DicePair pair) {
|
||||
foreach (int lockNumber in locks)
|
||||
{
|
||||
if (pair.Sum() == lockNumber)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void SetRoomExplored() {
|
||||
_health -= 1;
|
||||
if (_health == 0)
|
||||
{
|
||||
_isExplored = true;
|
||||
UnhighlightRoomAsOption();
|
||||
gameObject.GetComponent<SpriteRenderer>().color =
|
||||
ColorHelper.AddColorTint(gameObject.GetComponent<SpriteRenderer>().color, Color.grey, 0.5f);
|
||||
}
|
||||
}
|
||||
|
||||
private GameObject DuplicateToTheLeft(GameObject original, float offset) {
|
||||
GameObject clone = Instantiate(original, original.transform.parent);
|
||||
clone.transform.localPosition -= new Vector3(offset, 0, 0);
|
||||
return clone;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,2 @@
|
|||
fileFormatVersion: 2
|
||||
guid: 7646eec3a0fb541528b0d43bb830e4bf
|
||||
|
|
@ -3,60 +3,57 @@ using System.Collections;
|
|||
using TMPro;
|
||||
using UnityEngine;
|
||||
using System.Collections.Generic;
|
||||
using Unity.VisualScripting;
|
||||
|
||||
enum KeyType
|
||||
public enum KeyType
|
||||
{
|
||||
Number,
|
||||
MatchinDice
|
||||
MatchingDice
|
||||
}
|
||||
|
||||
public class Room : MonoBehaviour
|
||||
public abstract class Room : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private GameObject numberTextObject;
|
||||
[SerializeField] private List<GameObject> adjacentRooms;
|
||||
[SerializeField] private bool isEntrance;
|
||||
[SerializeField] private KeyType keyType;
|
||||
[SerializeField] private int number;
|
||||
[SerializeField] protected KeyType keyType;
|
||||
public event EventHandler<Room> ValidRoomClicked;
|
||||
|
||||
bool _isExplored = false;
|
||||
|
||||
private Color _roomNumberOriginalColor;
|
||||
|
||||
protected bool _isExplored = false;
|
||||
private bool _isClickable = true;
|
||||
|
||||
private void OnEnable() {
|
||||
GameManager.StateChanged += HandleStateChange;
|
||||
GameManager.DiceSelected += HandleDiceSelected;
|
||||
GameManager.DiceUnselected += HandDiceUnselected;
|
||||
}
|
||||
|
||||
private void OnDisable() {
|
||||
GameManager.StateChanged -= HandleStateChange;
|
||||
GameManager.DiceSelected -= HandleDiceSelected;
|
||||
GameManager.DiceUnselected -= HandDiceUnselected;
|
||||
}
|
||||
|
||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||
void Start() {
|
||||
InitializeRoom();
|
||||
_roomNumberOriginalColor = gameObject.GetComponentInChildren<TextMeshProUGUI>().color;
|
||||
}
|
||||
|
||||
public abstract void SetRoomExplored();
|
||||
|
||||
protected virtual void InitializeRoom() {
|
||||
if (isEntrance) {
|
||||
SetPropertiesOfEntrance();
|
||||
}
|
||||
|
||||
TextMeshProUGUI numberText = numberTextObject.GetComponent<TextMeshProUGUI>();
|
||||
_roomNumberOriginalColor = gameObject.GetComponentInChildren<TextMeshProUGUI>().color;
|
||||
|
||||
if (keyType == KeyType.Number)
|
||||
{
|
||||
numberText.SetText(number.ToString());
|
||||
}
|
||||
else if (keyType == KeyType.MatchinDice)
|
||||
{
|
||||
numberText.SetText("=");
|
||||
}
|
||||
}
|
||||
|
||||
public void SetRoomExplored() {
|
||||
_isExplored = true;
|
||||
UnhighlightRoomAsOption();
|
||||
gameObject.GetComponent<SpriteRenderer>().color =
|
||||
ColorHelper.AddColorTint(gameObject.GetComponent<SpriteRenderer>().color, Color.grey, 0.5f);
|
||||
}
|
||||
|
||||
public void HighlightRoomAsOption()
|
||||
protected void HighlightRoomAsOption()
|
||||
{
|
||||
gameObject.GetComponentInChildren<TextMeshProUGUI>().color = Color.blue;
|
||||
}
|
||||
|
||||
public void UnhighlightRoomAsOption()
|
||||
protected void UnhighlightRoomAsOption()
|
||||
{
|
||||
gameObject.GetComponentInChildren<TextMeshProUGUI>().color = _roomNumberOriginalColor;
|
||||
}
|
||||
|
|
@ -66,12 +63,11 @@ public class Room : MonoBehaviour
|
|||
isEntrance = true;
|
||||
}
|
||||
|
||||
IEnumerator OnMouseDown()
|
||||
{
|
||||
void OnMouseDown() {
|
||||
if (!_isClickable) return;
|
||||
if (IsValidRoomToExplore()) {
|
||||
OnValidRoomClicked();
|
||||
}
|
||||
yield return null;
|
||||
}
|
||||
|
||||
protected virtual void OnValidRoomClicked() {
|
||||
|
|
@ -79,7 +75,7 @@ public class Room : MonoBehaviour
|
|||
}
|
||||
|
||||
// Check if the room is valid to be explored. If so trigger the event.
|
||||
public bool IsValidRoomToExplore() {
|
||||
private bool IsValidRoomToExplore() {
|
||||
if (_isExplored) {
|
||||
return false;
|
||||
}
|
||||
|
|
@ -105,25 +101,32 @@ public class Room : MonoBehaviour
|
|||
return false;
|
||||
}
|
||||
|
||||
public bool TryUnlock(DicePair pair)
|
||||
{
|
||||
switch (keyType)
|
||||
public abstract bool TryUnlock(DicePair pair);
|
||||
|
||||
private void HandleStateChange(GameState state) {
|
||||
UnhighlightRoomAsOption();
|
||||
switch (state)
|
||||
{
|
||||
case KeyType.Number:
|
||||
if (number == pair.Sum())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case KeyType.MatchinDice:
|
||||
if (pair.DoResultsMatch())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
case GameState.PickDiceOne:
|
||||
case GameState.PickDiceTwo:
|
||||
case GameState.RollDice:
|
||||
_isClickable = false;
|
||||
break;
|
||||
case GameState.PickRoomTwo:
|
||||
case GameState.PickRoomOne:
|
||||
_isClickable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
private void HandleDiceSelected(DicePair pair) {
|
||||
if (TryUnlock(pair) && IsValidRoomToExplore())
|
||||
{
|
||||
HighlightRoomAsOption();
|
||||
}
|
||||
}
|
||||
|
||||
private void HandDiceUnselected() {
|
||||
UnhighlightRoomAsOption();
|
||||
}
|
||||
}
|
||||
|
|
@ -62,7 +62,7 @@ Material:
|
|||
- _WeightNormal: 0
|
||||
m_Colors:
|
||||
- _ClipRect: {r: -32767, g: -32767, b: 32767, a: 32767}
|
||||
- _FaceColor: {r: 0.3207547, g: 0.3207547, b: 0.3207547, a: 1}
|
||||
- _FaceColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
- _OutlineColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
- _UnderlayColor: {r: 0, g: 0, b: 0, a: 0.5}
|
||||
m_BuildTextureStacks: []
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue