add mines puzzle game to unlock doors
All checks were successful
Build project / Build for (StandaloneLinux64, 6000.0.37f1) (push) Successful in 5m17s
Build project / Build for (StandaloneWindows64, 6000.0.37f1) (push) Successful in 5m19s
Build project / Publish to itch.io (StandaloneLinux64) (push) Successful in 5s
Build project / Publish to itch.io (StandaloneWindows64) (push) Successful in 5s

This commit is contained in:
EthanPisani 2025-03-16 12:08:54 -04:00
parent 8933b2db13
commit d479a27770
97 changed files with 17166 additions and 391 deletions

8
Assets/Puzzles.meta Normal file
View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 01982073e6d99c7da9a474cd2dd16157
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b81e6518d3fb8031abf41afe92f246ee
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a4280c1da8f14b7b6b35a9ba3a38e53b
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,162 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &196046
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 497712}
- component: {fileID: 21282626}
- component: {fileID: 6193452}
- component: {fileID: 11442674}
m_Layer: 5
m_Name: BombNumber
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &497712
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 196046}
serializedVersion: 2
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &21282626
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 196046}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
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: 21300018, guid: bbf1608df437159458ebfa96e34067ae, 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 &6193452
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 196046}
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: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0.07, y: -0.135}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0, y: 0.5}
oldSize: {x: 0.14, y: 0.27}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Size: {x: 0.14, y: 0.27}
m_EdgeRadius: 0
--- !u!114 &11442674
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 196046}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 024f5d849c53d8d4dbf14256c10aeaa4, type: 3}
m_Name:
m_EditorClassIdentifier:
Digit: 0
NumberSprites:
- {fileID: 21300018, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300000, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300002, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300004, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300006, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300008, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300010, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300012, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300014, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300016, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300062, guid: bbf1608df437159458ebfa96e34067ae, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2ff309f4b7d9a64d861a747b3220eb8
timeCreated: 1454430859
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: bac7bf9fd912f344bbb6cdce59171a98
timeCreated: 1456398582
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &142206
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 496660}
- component: {fileID: 11411202}
m_Layer: 0
m_Name: PersistentInfo
m_TagString: PersistentInfo
m_Icon: {fileID: 7250588514170254948, guid: 0000000000000000d000000000000000, type: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &496660
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 142206}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.81, y: 0.24, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &11411202
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 142206}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b76f0b57b8ec93046add8bdbfde69355, type: 3}
m_Name:
m_EditorClassIdentifier:
DefaultFieldSizeX: 10
DefaultFieldSizeY: 10
DefaultMines: 15
AudioEnabled: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d26f692b6379f6c4d8ad51138973138e
timeCreated: 1455458156
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 9ae164088afb38744880ffc3cdd45160
timeCreated: 1455021976
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0d1736691a535024ea4b610f1e108084
timeCreated: 1455022040
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,167 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &160026
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 436094}
- component: {fileID: 21271522}
- component: {fileID: 6135604}
- component: {fileID: 11447650}
m_Layer: 5
m_Name: Tile
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &436094
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 160026}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -3.2177064, y: -3.65, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &21271522
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 160026}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
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: 21300030, guid: bbf1608df437159458ebfa96e34067ae, 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 &6135604
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 160026}
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.08}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 1}
oldSize: {x: 0.16, y: 0.16}
newSize: {x: 1, y: 1}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Size: {x: 0.16, y: 0.16}
m_EdgeRadius: 0
--- !u!114 &11447650
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 160026}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: cef84f0df244f09439e1b65d792abbc9, type: 3}
m_Name:
m_EditorClassIdentifier:
TileUnknown: {fileID: 21300030, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TilePressed: {fileID: 21300032, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile0: {fileID: 21300032, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile1: {fileID: 21300046, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile2: {fileID: 21300048, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile3: {fileID: 21300050, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile4: {fileID: 21300052, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile5: {fileID: 21300054, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile6: {fileID: 21300056, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile7: {fileID: 21300058, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
Tile8: {fileID: 21300060, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TileMine: {fileID: 21300040, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TileFlag: {fileID: 21300034, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TileQuestion: {fileID: 21300036, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TileQuestionPressed: {fileID: 21300038, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TileDead: {fileID: 21300042, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
TileWrong: {fileID: 21300044, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
LocalScale: 3

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5f11d9a655ee94f499d2f27f8fdc5a24
timeCreated: 1454275694
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,114 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &108778
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 448474}
- component: {fileID: 21238736}
- component: {fileID: 11428858}
m_Layer: 5
m_Name: TimeNumber
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &448474
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 108778}
serializedVersion: 2
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &21238736
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 108778}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 0
m_ReflectionProbeUsage: 0
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
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: 21300018, guid: bbf1608df437159458ebfa96e34067ae, 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!114 &11428858
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 108778}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 69125d056127da746a8a1ed8371ea8d6, type: 3}
m_Name:
m_EditorClassIdentifier:
Type: 7
NumberSprites:
- {fileID: 21300018, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300000, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300002, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300004, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300006, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300008, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300010, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300012, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300014, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- {fileID: 21300016, guid: bbf1608df437159458ebfa96e34067ae, type: 3}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 5514e6abc62ebab4ba941e5358b46891
timeCreated: 1455127081
licenseType: Free
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 05599566e5e96017ba478780c1dac7f4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1 @@
{"androidStore":"GooglePlay"}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: feb61ad6783990148bb280c41dee8c3c
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6b24525e224c490a7b5268b66117831c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 96013dd8490eca24ab1b0ac2d89e77a9
timeCreated: 1455070343
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: MainMenuSceneSettings
serializedVersion: 9
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 0
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_LightmapSizeFixed: 0
m_UseMipmapLimits: 1
m_BakeResolution: 40
m_Padding: 2
m_LightmapCompression: 3
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 1
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_EnableWorkerProcessBaking: 1
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentImportanceSampling: 0
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_RespectSceneVisibilityWhenBakingGI: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b55ca687a88d3ae4ebdf1aa78134ca56
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57cac0a425277e74da0ba59979d4a145
timeCreated: 1454277850
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: PlaySceneSettings
serializedVersion: 9
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 0
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_LightmapSizeFixed: 0
m_UseMipmapLimits: 1
m_BakeResolution: 40
m_Padding: 2
m_LightmapCompression: 3
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 1
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_EnableWorkerProcessBaking: 1
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentImportanceSampling: 0
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_RespectSceneVisibilityWhenBakingGI: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 99abf4e7e0016b1c3a0808a7711a835e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,432 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0.18028378, g: 0.22571412, b: 0.30692285, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 20201, guid: 0000000000000000f000000000000000, type: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &330585543
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 330585546}
- component: {fileID: 330585545}
- component: {fileID: 330585544}
- component: {fileID: 330585547}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &330585544
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
--- !u!20 &330585545
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 0
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &330585546
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 1, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &330585547
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 330585543}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 1
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
quality: 3
frameInfluence: 0.1
jitterScale: 1
mipBias: 0
varianceClampScale: 0.9
contrastAdaptiveSharpening: 0
--- !u!1 &410087039
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 410087041}
- component: {fileID: 410087040}
- component: {fileID: 410087042}
m_Layer: 0
m_Name: Directional Light
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!108 &410087040
Light:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
m_Enabled: 1
serializedVersion: 11
m_Type: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 2
m_Range: 10
m_SpotAngle: 30
m_InnerSpotAngle: 21.80208
m_CookieSize: 10
m_Shadows:
m_Type: 2
m_Resolution: -1
m_CustomResolution: -1
m_Strength: 1
m_Bias: 0.05
m_NormalBias: 0.4
m_NearPlane: 0.2
m_CullingMatrixOverride:
e00: 1
e01: 0
e02: 0
e03: 0
e10: 0
e11: 1
e12: 0
e13: 0
e20: 0
e21: 0
e22: 1
e23: 0
e30: 0
e31: 0
e32: 0
e33: 1
m_UseCullingMatrixOverride: 0
m_Cookie: {fileID: 0}
m_DrawHalo: 0
m_Flare: {fileID: 0}
m_RenderMode: 0
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingLayerMask: 1
m_Lightmapping: 4
m_LightShadowCasterMode: 0
m_AreaSize: {x: 1, y: 1}
m_BounceIntensity: 1
m_ColorTemperature: 5000
m_UseColorTemperature: 1
m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0}
m_UseBoundingSphereOverride: 0
m_UseViewFrustumForShadowCasterCull: 1
m_ForceVisible: 0
m_ShadowRadius: 0
m_ShadowAngle: 0
--- !u!4 &410087041
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
serializedVersion: 2
m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261}
m_LocalPosition: {x: 0, y: 3, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0}
--- !u!114 &410087042
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 410087039}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Version: 3
m_UsePipelineSettings: 1
m_AdditionalLightsShadowResolutionTier: 2
m_LightLayerMask: 1
m_RenderingLayers: 1
m_CustomShadowLayers: 0
m_ShadowLayerMask: 1
m_ShadowRenderingLayers: 1
m_LightCookieSize: {x: 1, y: 1}
m_LightCookieOffset: {x: 0, y: 0}
m_SoftShadowQuality: 1
--- !u!1 &832575517
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 832575519}
- component: {fileID: 832575518}
m_Layer: 0
m_Name: Global Volume
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &832575518
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 832575517}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IsGlobal: 1
priority: 0
blendDistance: 0
weight: 1
sharedProfile: {fileID: 11400000, guid: 10fc4df2da32a41aaa32d77bc913491c, type: 2}
--- !u!4 &832575519
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 832575517}
serializedVersion: 2
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 330585546}
- {fileID: 410087041}
- {fileID: 832575519}

View File

@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 9ded798cd6df9f9a2a877f7af71e7d7a
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,489 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 1
m_BakeBackend: 0
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 0
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 4890085278179872738, guid: 19808b8cd5c4efb7a8888d3908d66053, type: 2}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1349921023
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1349921028}
- component: {fileID: 1349921027}
- component: {fileID: 1349921025}
- component: {fileID: 1349921024}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &1349921024
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1349921023}
m_Enabled: 1
--- !u!124 &1349921025
Behaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1349921023}
m_Enabled: 1
--- !u!20 &1349921027
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1349921023}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 1
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0.019607844}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 60
orthographic: 1
orthographic size: 5
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 3
m_HDR: 0
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &1349921028
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1349921023}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -10}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1477558171
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1477558175}
- component: {fileID: 1477558174}
- component: {fileID: 1477558173}
- component: {fileID: 1477558172}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1477558172
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1477558171}
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!114 &1477558173
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1477558171}
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: 0
--- !u!223 &1477558174
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1477558171}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 1349921027}
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!224 &1477558175
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1477558171}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 2065992486}
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &2040090073
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2040090076}
- component: {fileID: 2040090075}
- component: {fileID: 2040090074}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2040090074
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2040090073}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3}
m_Name:
m_EditorClassIdentifier:
m_SendPointerHoverToParent: 1
m_HorizontalAxis: Horizontal
m_VerticalAxis: Vertical
m_SubmitButton: Submit
m_CancelButton: Cancel
m_InputActionsPerSecond: 10
m_RepeatDelay: 0.5
m_ForceModuleActive: 0
--- !u!114 &2040090075
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2040090073}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_FirstSelected: {fileID: 0}
m_sendNavigationEvents: 1
m_DragThreshold: 5
--- !u!4 &2040090076
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2040090073}
serializedVersion: 2
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: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1001 &2065992485
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1477558175}
m_Modifications:
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_RootOrder
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_AnchorMax.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_AnchorMax.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_AnchorMin.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_AnchorMin.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_SizeDelta.x
value: 100
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_SizeDelta.y
value: 100
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalRotation.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalRotation.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_LocalRotation.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0.0000038146973
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
--- !u!224 &2065992486 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 22499018, guid: bac7bf9fd912f344bbb6cdce59171a98, type: 3}
m_PrefabInstance: {fileID: 2065992485}
m_PrefabAsset: {fileID: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1349921028}
- {fileID: 1477558175}
- {fileID: 2040090076}

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c426c99243ac61f4a8dda559528e7e99
timeCreated: 1456305560
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!850595691 &4890085278179872738
LightingSettings:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: TestSceneSettings
serializedVersion: 9
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_RealtimeEnvironmentLighting: 1
m_BounceScale: 1
m_AlbedoBoost: 1
m_IndirectOutputScale: 1
m_UsingShadowmask: 0
m_BakeBackend: 1
m_LightmapMaxSize: 1024
m_LightmapSizeFixed: 0
m_UseMipmapLimits: 1
m_BakeResolution: 40
m_Padding: 2
m_LightmapCompression: 3
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 0
m_CompAOExponentDirect: 0
m_ExtractAO: 0
m_MixedBakeMode: 1
m_LightmapsBakeMode: 1
m_FilterMode: 1
m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
m_ExportTrainingData: 0
m_EnableWorkerProcessBaking: 1
m_TrainingDataDestination: TrainingData
m_RealtimeResolution: 2
m_ForceWhiteAlbedo: 0
m_ForceUpdates: 0
m_PVRCulling: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVREnvironmentSampleCount: 512
m_PVREnvironmentReferencePointCount: 2048
m_LightProbeSampleCountMultiplier: 4
m_PVRBounces: 2
m_PVRMinBounces: 2
m_PVREnvironmentImportanceSampling: 0
m_PVRFilteringMode: 0
m_PVRDenoiserTypeDirect: 0
m_PVRDenoiserTypeIndirect: 0
m_PVRDenoiserTypeAO: 0
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 1
m_PVRFilteringGaussRadiusAO: 1
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_RespectSceneVisibilityWhenBakingGI: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 19808b8cd5c4efb7a8888d3908d66053
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 4890085278179872738
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57ba7ce0b5bc4780fb8f182587383305
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,121 @@
using System;
using UnityEngine;
/// <summary>
/// Behaviour to show the amount of bombs left
/// </summary>
public class BombNumberScript : MonoBehaviour {
#region Types
/// <summary>
/// Digit number X from a number where the rightmost is considered as the first
/// </summary>
public enum EDigit {
First,
Second,
Third
}
#endregion
#region Fields
/// <summary>
/// Which digit this script is attached to
/// </summary>
public EDigit Digit;
/// <summary>
/// The collection of all the number sprites (must be ordered)
/// </summary>
public Sprite[] NumberSprites;
private int _number;
private ControlScript _parent;
private bool _leftDown, _rightDown;
#endregion
#region Properties
/// <summary>
/// The control script of the game
/// </summary>
public ControlScript Parent {
set { _parent = value; }
}
#endregion
#region Unity events
/// <summary>
/// LateUpdate is called at the end of every frame.
/// </summary>
void LateUpdate() {
if (Input.GetMouseButtonUp(0))
_leftDown = false;
if (Input.GetMouseButtonUp(1))
_rightDown = false;
}
/// <summary>
/// OnMouseOver is called every frame as long as the mouse is hovering over this objects bounding box
/// </summary>
void OnMouseOver() {
if (_parent.GameState != ControlScript.EGameState.Uninitialized)
return;
if (Input.GetMouseButtonDown(0))
_leftDown = true;
if (Input.GetMouseButtonUp(0) && _leftDown)
_parent.OnBombNumberClick(Digit);
if (Input.GetMouseButtonDown(1))
_rightDown = true;
if (Input.GetMouseButtonUp(1) && _rightDown)
_parent.OnBombNumberRightClick(Digit);
}
#endregion
#region Methods
/// <summary>
/// Sets the number for this digit based on the total amount of bombs
/// </summary>
/// <param name="number"></param>
public void SetNumber(int number) {
_number = number;
ChangeSprite();
}
#endregion
#region Helper methods
/// <summary>
/// Updates the sprite so that it matches the number.
/// </summary>
/// <remarks>
/// This works for whatever number was given. Negative numbers are set to 9 so that it easily loops:
/// <code>
/// 1 -> 2 -> ... -> 9 -> 0 -> 1 -> ...
/// 2 -> 1 -> 0 -> 9 -> 8 -> ...
/// </code>
/// </remarks>
private void ChangeSprite() {
int index;
switch (Digit) {
case EDigit.First:
index = Math.Abs(_number) % 10;
break;
case EDigit.Second:
if (-10 < _number && _number < 0)
index = 10;
else
index = (Math.Abs(_number) / 10) % 10;
break;
case EDigit.Third:
if (-100 < _number && _number < -9)
index = 10;
else
index = Math.Abs(_number) / 100;
break;
default:
throw new ArgumentOutOfRangeException();
}
GetComponent<SpriteRenderer>().sprite = NumberSprites[index];
// set layer to 5
GetComponent<SpriteRenderer>().sortingOrder = 5;
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 024f5d849c53d8d4dbf14256c10aeaa4
timeCreated: 1454430473
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,223 @@
using System;
using UnityEngine;
using System.Collections;
/// <summary>
/// Behaviour for the camera
/// </summary>
public class CameraScript : MonoBehaviour {
#region Fields
/// <summary>
/// The speed at which the camera scrolls through the field
/// </summary>
public float ScrollSpeed;
/// <summary>
/// How wide the area at the side of the screen should be before the camera moves
/// </summary>
public int ScrollAreaSize;
private bool _allowScrollUp, _allowScrollDown, _allowScrollLeft, _allowScrollRight;
private float _maxUp, _maxDown, _maxLeft, _maxRight;
private Vector3 _initialPosition;
#endregion
#region Properties
/// <summary>
/// Is scrolling up allowed?
/// </summary>
public bool AllowScrollUp {
get { return _allowScrollUp; }
set {
_allowScrollUp = value;
//UpperScrollBox.GetComponent<BoxCollider2D>().enabled = value;
}
}
/// <summary>
/// Is scrolling down allowed?
/// </summary>
public bool AllowScrollDown {
get { return _allowScrollDown; }
set {
_allowScrollDown = value;
//LowerScrollBox.GetComponent<BoxCollider2D>().enabled = value;
}
}
/// <summary>
/// Is scrolling left allowed?
/// </summary>
public bool AllowScrollLeft {
get { return _allowScrollLeft; }
set {
_allowScrollLeft = value;
//LeftScrollBox.GetComponent<BoxCollider2D>().enabled = value;
}
}
/// <summary>
/// Is scrolling right allowed?
/// </summary>
public bool AllowScrollRight {
get { return _allowScrollRight; }
set {
_allowScrollRight = value;
//RightScrollBox.GetComponentInParent<BoxCollider2D>().enabled = value;
}
}
/// <summary>
/// Highest possible value to scroll up to
/// </summary>
public float MaxUpperView {
get { return _maxUp; }
set {
_maxUp = value;
AllowAllScrollingDirections();
FitViewToBoundaries();
}
}
/// <summary>
/// Lowest possible value to scroll down to
/// </summary>
public float MaxLowerView {
get { return _maxDown; }
set {
_maxDown = value;
AllowAllScrollingDirections();
FitViewToBoundaries();
}
}
/// <summary>
/// Lowest possible value to scroll left to
/// </summary>
public float MaxLeftView {
get { return _maxLeft; }
set {
_maxLeft = value;
AllowAllScrollingDirections();
FitViewToBoundaries();
}
}
/// <summary>
/// Highest possible value to scroll right to
/// </summary>
public float MaxRightView {
get { return _maxRight; }
set {
_maxRight = value;
AllowAllScrollingDirections();
FitViewToBoundaries();
}
}
#endregion
#region Methods
/// <summary>
/// Sets default values needed before handling the object before anything else
/// </summary>
void Awake() {
var cam = this.GetComponentInParent<Camera>();
_initialPosition = cam.transform.position;
MaxLeftView = cam.ViewportToWorldPoint(new Vector3(0, 0, cam.nearClipPlane)).x;
MaxLowerView = cam.ViewportToWorldPoint(new Vector3(0, 0, cam.nearClipPlane)).y;
MaxRightView = cam.ViewportToWorldPoint(new Vector3(1, 1, cam.nearClipPlane)).x;
MaxUpperView = cam.ViewportToWorldPoint(new Vector3(1, 1, cam.nearClipPlane)).y;
}
/// <summary>
/// Use this for initialization
/// </summary>
void Start() {
AllowScrollUp = true;
AllowScrollDown = true;
AllowScrollLeft = true;
AllowScrollRight = true;
}
/// <summary>
/// Update is called once per frame. Primarily handles input.
/// </summary>
void Update() {
// Get some values
var mPos = Input.mousePosition;
var cam = GetComponent<Camera>();
var bottomLeft = cam.ViewportToScreenPoint(new Vector3(0, 0, cam.nearClipPlane)); //get bounds
var topRight = cam.ViewportToScreenPoint(new Vector3(1, 1, cam.nearClipPlane)); //^
var speed = ScrollSpeed * Time.deltaTime;
// // Check input
// if (bottomLeft.x < mPos.x && mPos.x < bottomLeft.x + ScrollAreaSize && _allowScrollLeft) {
// this.transform.Translate(-speed, 0f, 0f);
// AllowScrollRight = true;
// }
// if (bottomLeft.y < mPos.y && mPos.y < bottomLeft.y + ScrollAreaSize && _allowScrollDown) {
// this.transform.Translate(0f, -speed, 0);
// AllowScrollUp = true;
// }
// if (topRight.x - ScrollAreaSize < mPos.x && mPos.x < topRight.x && _allowScrollRight) {
// this.transform.Translate(speed, 0f, 0f);
// AllowScrollLeft = true;
// }
// if (topRight.y - ScrollAreaSize < mPos.y && mPos.y < topRight.y && _allowScrollUp) {
// this.transform.Translate(0f, speed, 0f);
// AllowScrollDown = true;
// }
FitViewToBoundaries();
}
/// <summary>
/// Moves the camera to its initial position
/// </summary>
public void Reset() {
// this.GetComponent<Camera>().transform.position = _initialPosition;
//UnityEditor.PrefabUtility.ResetToPrefabState(this.gameObject);
}
#endregion
#region Helper Methods
/// <summary>
/// Less copy-pastas
/// </summary>
private void AllowAllScrollingDirections() {
_allowScrollDown = true;
_allowScrollLeft = true;
_allowScrollRight = true;
_allowScrollUp = true;
}
/// <summary>
/// Makes sure the view does not go out of bounds
/// </summary>
private void FitViewToBoundaries() {
// Get some needed values
var camera = GetComponent<Camera>();
var bottomLeft = camera.ViewportToWorldPoint(new Vector3(0, 0, camera.nearClipPlane));
var topRight = camera.ViewportToWorldPoint(new Vector3(1, 1, camera.nearClipPlane));
// if (bottomLeft.x < _maxLeft) {
// camera.transform.Translate(new Vector3(_maxLeft - bottomLeft.x, 0f, 0f));
// AllowScrollLeft = false;
// }
// if (bottomLeft.y < _maxDown) {
// camera.transform.Translate(new Vector3(0f, _maxDown - bottomLeft.y, 0f));
// AllowScrollDown = false;
// }
// if (topRight.x > _maxRight) {
// camera.transform.Translate(new Vector3(_maxRight - topRight.x, 0f, 0f));
// AllowScrollRight = false;
// }
// if (topRight.y > _maxUp) {
// camera.transform.Translate(new Vector3(0f, _maxUp - topRight.y, 0f));
// AllowScrollUp = false;
// }
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a4b15968604fd3a48bdb850d069950f7
timeCreated: 1454975528
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,39 @@
using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;
/// <summary>
/// Controll class for the main menu view. It's pretty barebones
/// </summary>
public class ControlMainMenuScript : MonoBehaviour {
///// <summary>
///// Executes before all Start methods are called. This makes sure it doesn't get destroyed.
///// </summary>
//void Awake() {
// DontDestroyOnLoad(this);
//}
#region Events
/// <summary>
/// Action is executed when the user presses the Start button
/// </summary>
public void OnStartButtonClick() {
SceneManager.LoadScene("PlayScene");
}
/// <summary>
/// Action is executed when the user presses the Options button
/// </summary>
public void OnOptionsButtonClick() {
//TODO: add options
}
/// <summary>
/// Action is executed when te user presses the Quit button
/// </summary>
public void OnQuitButtonClick() {
Application.Quit();
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c67d5fca7728e854fb3be2b42a9a54c2
timeCreated: 1455229044
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,655 @@
using System;
using UnityEngine;
using Random = UnityEngine.Random;
using System.Collections.Generic;
using System.Linq;
using UnityEngine.UI;
/// <summary>
/// The control script of the game, defines the logic. Should have been a singleton.
/// </summary>
public class ControlScript : MonoBehaviour {
#region Structs/Enums
/// <summary>
/// States of the game
/// </summary>
public enum EGameState {
Uninitialized,
Playing,
Win,
Lose
}
#endregion
#region Fields
/// <summary>
/// Width of the next generated grid
/// </summary>
[Header("Field properties")]
public int GridSizeX;
/// <summary>
/// Height of the next generated grid
/// </summary>
public int GridSizeY;
/// <summary>
/// Number of mines for the next game
/// </summary>
[Range(0, 999)]
public int TotalMines;
/// <summary>
/// Bounds so the field does not get too small or too big
/// </summary>
public float MinScale,
MaxScale;
/// <summary>
/// Reference to the scrolling (game view) camera
/// </summary>
[Header("Object references")]
public GameObject ScrollingCamera;
/// <summary>
/// Reference to the screen overlay canvas (doesn't do anything)
/// </summary>
public GameObject OverlayCanvas;
/// <summary>
/// Reference to the button that shows the current state of the game (playing or dead)
/// </summary>
public Image StateButton;
/// <summary>
/// Reference to all bomb number objects
/// </summary>
public BombNumberScript[] BombNumbers;
/// <summary>
/// Reference to all time number objects
/// </summary>
public TimeScript[] TimeNumbers;
/// <summary>
/// Prefab of a single tile
/// </summary>
public GameObject TilePrefab;
/// <summary>
/// Prefab of some information
/// </summary>
public GameObject PersistentInfoPrefab;
/// <summary>
/// Prefab for the options form when the user clicks on the cog
/// </summary>
public GameObject OptionsFormPrefab;
// Private vars
private PersistentInfoScript _persistentInfo;
private GameObject OptionsForm;
private GameObject[,] _tiles;
private int _numRevealedTiles;
private int _numBombsLeft;
private EGameState _gameState = EGameState.Uninitialized;
private float _startTime;
private TimeSpan _showTime;
private bool _updateTime;
public GameObject ParentCanvas;
public AudioClip loseSound;
public AudioClip winSound;
public float timeLimitSeconds = 10f;
#endregion
#region Properties
/// <summary>
/// Current state of the game. When set, also changes the actual state
/// </summary>
public EGameState GameState {
set {
_gameState = value;
OnGameStateChange();
}
get { return _gameState; }
}
/// <summary>
/// Number of bombs that are left on the field
/// </summary>
public int NumBombsLeft {
get { return _numBombsLeft; }
set { _numBombsLeft = value; }
}
/// <summary>
/// Rectangle that gives the current visible part of the field
/// </summary>
public Rect VisibleField {
get {
var cam = ScrollingCamera.GetComponent<Camera>();
var bottomLeft = cam.ViewportToWorldPoint(new Vector3(0, 0, cam.nearClipPlane));
var topRight = cam.ViewportToWorldPoint(new Vector3(1, 1, cam.nearClipPlane));
return new Rect(bottomLeft, topRight - bottomLeft);
}
}
/// <summary>
/// The controls
/// </summary>
public ActionMap<EControls> Controls {
get { return _persistentInfo.Controls; }
}
#endregion
#region Unity methods
/// <summary>
/// Use this for initialization
/// </summary>
void Start() {
// Check if PersistentInfo exists
var info = GameObject.FindGameObjectsWithTag("PersistentInfo");
switch (info.Length) {
case 0:
_persistentInfo = Instantiate(PersistentInfoPrefab).GetComponent<PersistentInfoScript>();
break;
case 1:
_persistentInfo = info[0].GetComponent<PersistentInfoScript>();
CopyPersistentInfo();
break;
default:
//TODO: fix it
throw new MissingComponentException("Multiple copies of PersistentInfo were found");
}
// Assign some variables
BombNumbers[0].Parent = this;
BombNumbers[1].Parent = this;
BombNumbers[2].Parent = this;
// set layer
BombNumbers[0].GetComponent<SpriteRenderer>().sortingOrder = 5;
BombNumbers[1].GetComponent<SpriteRenderer>().sortingOrder = 5;
BombNumbers[2].GetComponent<SpriteRenderer>().sortingOrder = 5;
// Set camera bounds
// ScrollingCamera.GetComponent<CameraScript>().Reset();
CreateTiles();
}
/// <summary>
/// Update is called once per frame
/// </summary>
void Update() {
// Update timer
if (_updateTime) {
_showTime = TimeSpan.FromSeconds(Time.time - _startTime);
Array.ForEach(TimeNumbers, tnum => tnum.SetTimeSprite(_showTime));
// if above the time limit, lose
if (_showTime.TotalSeconds > timeLimitSeconds) {
GameState = EGameState.Lose;
CheckWin();
}
}
}
#endregion
#region Methods
/// <summary>
/// Places mines randomly on the field
/// </summary>
public void PlaceMines() {
PlaceMines(-1, -1);
}
/// <summary>
/// Places mines on the field and make sure that the given position is an empty tile
/// </summary>
/// <param name="posX"></param>
/// <param name="posY"></param>
public void PlaceMines(int posX, int posY) {
// Create list of all possible mine locations
HashSet<Vector2i> tileList = new HashSet<Vector2i>(new Vector2iComparer());
for (int i = 0; i < GridSizeX; i++) {
for (int j = 0; j < GridSizeY; j++) {
tileList.Add(new Vector2i(i, j));
}
}
// Create safe zone if specified
if (posX >= 0 && posY >= 0) {
for (int i = posX - 1; i <= posX + 1; i++) {
for (int j = posY - 1; j <= posY + 1; j++) {
tileList.Remove(new Vector2i(i, j));
}
}
}
// Place rest of mines in field
int minesPlaced = 0;
while (minesPlaced < TotalMines && tileList.Count > 0) {
var r = tileList.ElementAt(Random.Range(0, tileList.Count));
var tile = _tiles[r.X, r.Y].GetComponent<TileScript>();
tile.Type = TileScript.EType.Mine;
// Set numbers around it accordingly
foreach (var neighbour in tile.Neighbours) {
neighbour.Number++;
}
// Remove placed mine from list
tileList.Remove(r);
minesPlaced++;
}
// Update number of mines and gamestate
TotalMines = minesPlaced;
_numBombsLeft = minesPlaced;
UpdateBombNumber();
GameState = EGameState.Playing;
StartTimer();
_updateTime = true;
}
/// <summary>
/// Check if field is initialized, place mines if not
/// </summary>
/// <param name="posX"></param>
/// <param name="posY"></param>
public void CheckInitialization(int posX, int posY) {
if (_gameState == EGameState.Uninitialized)
PlaceMines(posX, posY);
}
/// <summary>
/// Check for win conditions
/// </summary>
/// <returns></returns>
public EGameState CheckWin() {
if (_numRevealedTiles >= GridSizeX * GridSizeY - TotalMines && _gameState != EGameState.Lose) {
SoundFXManager.instance.PlaySound(winSound, transform, 1.0f);
return EGameState.Win;
}
if (_gameState == EGameState.Lose) {
SoundFXManager.instance.PlaySound(loseSound, transform, 1.0f);
// restart with dealy of 1 second
Invoke("Restart", 1.0f);
}
return _gameState;
}
/// <summary>
/// Set state as losing (reveals all mines)
/// </summary>
public void SetLoseState() {
_gameState = EGameState.Lose;
RevealAllMines();
}
/// <summary>
/// Restart the game
/// </summary>
public void Restart() {
foreach (var tile in _tiles) {
Destroy(tile);
}
_gameState = EGameState.Uninitialized;
_numRevealedTiles = 0;
CreateTiles();
ResetTimer();
StateButton.sprite = StateButton.GetComponent<StateButtonScript>().DefaultSprite;
}
#endregion
#region Helper Methods
/// <summary>
/// Copy all info from PersistentInfo
/// </summary>
private void CopyPersistentInfo() {
GridSizeX = _persistentInfo.DefaultFieldSizeX;
GridSizeY = _persistentInfo.DefaultFieldSizeY;
TotalMines = _persistentInfo.DefaultMines;
}
/// <summary>
/// Removes any interaction with all tiles
/// </summary>
private void DisablePlayField() {
StopTimer();
foreach (var tile in _tiles) {
tile.GetComponent<TileScript>().enabled = false;
tile.GetComponent<TileScript>().Enabled = false;
}
}
/// <summary>
/// Re-enables all interaction with tiles
/// </summary>
private void EnablePlayField() {
foreach (var tile in _tiles) {
tile.GetComponent<TileScript>().Enabled = true;
}
if (_gameState == EGameState.Playing)
Debug.Log("Resuming timer");
ResumeTimer();
}
/// <summary>
/// Initializes <see cref="_tiles"/> and places them centralized around (0,0),
/// ensuring they are parented to the UI canvas and have correct rendering layers.
/// </summary>
private void CreateTiles() {
// Reset scrolling camera
var camScript = ScrollingCamera.GetComponent<CameraScript>();
camScript.Reset();
// Find scale to draw tiles with
var tileRenderSize = TilePrefab.GetComponent<Renderer>().bounds.size;
// Debug.Log("Tile render size: " + tileRenderSize);
var fieldRenderSize = new Vector3(GridSizeX * tileRenderSize.x, GridSizeY * tileRenderSize.y);
var cameraWorldViewSize = VisibleField;
// get scale to draw tiles with
var scale = Mathf.Clamp(Math.Min(cameraWorldViewSize.width / fieldRenderSize.x,
cameraWorldViewSize.height / fieldRenderSize.y),
MinScale,
MaxScale);
// Debug.Log("Calculation: " + cameraWorldViewSize.width + " / " + fieldRenderSize.x + " = " + cameraWorldViewSize.width / fieldRenderSize.x);
// Debug.Log("Calculation: " + cameraWorldViewSize.height + " / " + fieldRenderSize.y + " = " + cameraWorldViewSize.height / fieldRenderSize.y);
// Debug.Log("Scale: " + scale);
scale = 300;
tileRenderSize *= scale;
fieldRenderSize *= scale;
// Debug.Log("Tile render size: " + tileRenderSize);
// Debug.Log("Field render size: " + fieldRenderSize);
// Update scrolling camera
camScript.MaxUpperView = 0f;
camScript.MaxLeftView = Math.Min(-fieldRenderSize.x / 2f, cameraWorldViewSize.xMin);
camScript.MaxRightView = Math.Max(fieldRenderSize.x / 2f, cameraWorldViewSize.xMax);
camScript.MaxLowerView = Math.Min(-fieldRenderSize.y, cameraWorldViewSize.yMin);
// Create new container
_tiles = new GameObject[GridSizeX, GridSizeY];
for (int i = 0; i < GridSizeX; i++) {
for (int j = 0; j < GridSizeY; j++) {
// Instantiate tiles under the Canvas
_tiles[i, j] = Instantiate(TilePrefab, ParentCanvas.transform);
// Set position
_tiles[i, j].transform.localPosition = new Vector3((i + .5f) * tileRenderSize.x - fieldRenderSize.x / 2f,
-j * tileRenderSize.y);
_tiles[i, j].transform.localScale = Vector3.one; // Ensure consistent scaling
// Debug.Log("Creating tile at: " + _tiles[i, j].transform.localPosition);
// Assign layers
_tiles[i, j].layer = 5; // UI layer
var tileRenderer = _tiles[i, j].GetComponent<Renderer>();
if (tileRenderer != null)
{
tileRenderer.renderingLayerMask = 1 << 2; // Light Layer 2
}
// Initialize tile script
var tile = _tiles[i, j].GetComponent<TileScript>();
tile.Parent = this;
tile.Container = _tiles;
tile.GridPos = new Vector2i(i, j);
tile.LocalScale = scale;
// Debug.Log("Edit tile at: " + _tiles[i, j].transform.localPosition);
}
}
// Assign neighbours
for (int i = 0; i < GridSizeX; i++) {
for (int j = 0; j < GridSizeY; j++) {
for (int ii = i - 1; ii <= i + 1; ii++) {
for (int jj = j - 1; jj <= j + 1; jj++) {
if (i == ii && j == jj)
continue;
try {
_tiles[i, j].GetComponent<TileScript>().NewNeighbour =
_tiles[ii, jj].GetComponent<TileScript>();
}
catch (IndexOutOfRangeException) { } //ignore
}
}
}
}
// Set number of mines back to original value
_numBombsLeft = TotalMines;
UpdateBombNumber();
}
/// <summary>
/// Starts the timer
/// </summary>
private void StartTimer() {
_startTime = Time.time;
Debug.Log("Start time: " + _startTime);
ResetTimer();
}
/// <summary>
/// Resumes the timer from a pauzed state
/// </summary>
private void ResumeTimer() {
_startTime += (float)(Time.time - (_startTime + _showTime.TotalSeconds));
_updateTime = true;
}
/// <summary>
/// Stops the timer
/// </summary>
private void StopTimer() {
_showTime = TimeSpan.FromSeconds(Time.time - _startTime);
_updateTime = false;
}
/// <summary>
/// Sets the timer to 0 without starting it
/// </summary>
private void ResetTimer() {
_showTime = new TimeSpan();
_updateTime = false;
}
/// <summary>
/// Reveals all the mines
/// </summary>
private void RevealAllMines() {
foreach (var tile in _tiles) {
tile.GetComponent<TileScript>().RevealAsLoseState();
}
}
/// <summary>
/// Updates the bomb number
/// </summary>
private void UpdateBombNumber() {
Array.ForEach(BombNumbers, bnum => bnum.SetNumber(_numBombsLeft));
Debug.Log("Number of bombs left: " + _numBombsLeft);
}
#endregion
#region Events
/// <summary>
/// Is called whenever GameState is altered
/// </summary>
private void OnGameStateChange() {
switch (_gameState) {
case EGameState.Lose: // Actions to do when lost
//StateButton.LoseState();
StateButton.sprite = StateButton.GetComponent<StateButtonScript>().LoseSprite;
RevealAllMines();
DisablePlayField();
break;
case EGameState.Win: // Actions to do when won
//StateButton.WinState();
StateButton.sprite = StateButton.GetComponent<StateButtonScript>().WinSprite;
DisablePlayField();
break;
}
}
/// <summary>
/// What to do when a tile has been clicked
/// </summary>
/// <param name="sender"></param>
public void OnTileClick(GameObject sender) {
var tile = sender.GetComponent<TileScript>();
// Place mines if field is uninitialized
if (_gameState == EGameState.Uninitialized)
PlaceMines(tile.GridPos.X, tile.GridPos.Y);
// Don't do anything unless the game is playing
if (_gameState != EGameState.Playing)
return;
tile.Revealed = true;
if (tile.Revealed && tile.Type == TileScript.EType.Mine) {
Debug.Log("You clicked on a mine!");
GameState = EGameState.Lose;
sender.GetComponent<TileScript>().SetAsDeadMine();
}
GameState = CheckWin();
}
/// <summary>
/// What to do when a tile was revealed
/// </summary>
/// <param name="sender"></param>
public void OnTileReveal(GameObject sender) {
_numRevealedTiles++;
}
/// <summary>
/// What to do when a tile has been right clicked
/// </summary>
/// <param name="sender"></param>
public void OnTileRightClick(GameObject sender) {
var tile = sender.GetComponent<TileScript>();
_numBombsLeft += tile.Flagged.ToIntSign();
tile.Flagged = !tile.Flagged;
UpdateBombNumber();
}
/// <summary>
/// What to do when a tile has been middle clicked
/// </summary>
/// <param name="sender"></param>
public void OnTileMiddleClick(GameObject sender) {
var tile = sender.GetComponent<TileScript>();
if ((int)tile.Number == tile.Neighbours.Count(neighbour => neighbour.Flagged))
tile.Neighbours.ForEach(neighbour => neighbour.Revealed = true);
GameState = CheckWin();
}
/// <summary>
/// What to do if a bomb number was clicked
/// </summary>
/// <param name="digit"></param>
public void OnBombNumberClick(BombNumberScript.EDigit digit) {
switch (digit) {
case BombNumberScript.EDigit.First:
TotalMines += (TotalMines % 10 != 9 ? 1 : -9);
break;
case BombNumberScript.EDigit.Second:
TotalMines += ((TotalMines / 10) % 10 != 9 ? 10 : -90);
break;
case BombNumberScript.EDigit.Third:
TotalMines += (TotalMines / 100 != 9 ? 100 : -900);
break;
default:
throw new ArgumentOutOfRangeException("digit");
}
_numBombsLeft = TotalMines;
UpdateBombNumber();
}
/// <summary>
/// What to do if a bomb number was right clicked
/// </summary>
/// <param name="digit"></param>
public void OnBombNumberRightClick(BombNumberScript.EDigit digit) {
switch (digit) {
case BombNumberScript.EDigit.First:
TotalMines -= (TotalMines % 10 != 0 ? 1 : -9);
break;
case BombNumberScript.EDigit.Second:
TotalMines -= ((TotalMines / 10) % 10 != 0 ? 10 : -90);
break;
case BombNumberScript.EDigit.Third:
TotalMines -= (TotalMines / 100 != 0 ? 100 : -900);
break;
default:
throw new ArgumentOutOfRangeException("digit");
}
_numBombsLeft = TotalMines;
UpdateBombNumber();
}
/// <summary>
/// What to do when the options button is clicked
/// </summary>
public void OnOptionsButtonClick() {
// Check if an options form is already present
if (OptionsForm != null) {
OnOptionsButtonCancelClick();
return;
}
// Disable playing field
DisablePlayField();
OptionsForm = Instantiate(OptionsFormPrefab);
OptionsForm.transform.SetParent(OverlayCanvas.transform, false);
var buttons = OptionsForm.GetComponentsInChildren<Button>();
foreach (var button in buttons) {
switch (button.name) {
case "ButtonOK":
button.onClick.AddListener(OnOptionsButtonOKClick);
break;
case "ButtonCancel":
button.onClick.AddListener(OnOptionsButtonCancelClick);
break;
default:
throw new MissingComponentException("Object does not belong to OptionsForm");
}
}
}
/// <summary>
/// What to do if the OK button was pressed on the options screen
/// </summary>
public void OnOptionsButtonOKClick() {
var ofs = OptionsForm.GetComponent<OptionsFormScript>();
TotalMines = ofs.Mines;
GridSizeX = ofs.FieldWidth;
GridSizeY = ofs.FieldHeight;
Destroy(OptionsForm);
EnablePlayField();
}
/// <summary>
/// What to do when the Cancel button was pressed on the options screen
/// </summary>
public void OnOptionsButtonCancelClick() {
Destroy(OptionsForm);
EnablePlayField();
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 5dbbbf210c418854c87889e3bf45b2bf
timeCreated: 1454275495
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 7c51b85845e38d84ba935725c75a0c32
folderAsset: yes
timeCreated: 1455461104
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,58 @@
using System;
using UnityEngine;
public class Action {
#region Structs/Enums
public enum EActionType {
Hold, PressOnce, ReleaseOnce, HoldTwice, PressTwice, ReleaseTwice, MultiHold, MultiPress, MultiRelease
}
#endregion
#region Fields
// Maximum time between 2 presses before it's considered a multi-press
public static TimeSpan MultiDelayTime = TimeSpan.FromMilliseconds(200);
private ActionNode _node;
#endregion
#region Properties
#endregion
#region Constructor
public Action(KeyCode key, EActionType type = EActionType.Hold, int multi =0) {
if ((int) type >= 3 && multi <= 1)
multi = 2;
_node = new ActionNodeManager(key, type, multi);
}
private Action(ActionNode node) {
_node = node;
}
#endregion
#region Methods
public bool IsActive() {
return _node.IsActive();
}
#endregion
#region Operators
static public Action operator &(Action lhs, Action rhs) {
return new Action(new AndActionNode(lhs._node, rhs._node));
}
static public Action operator |(Action lhs, Action rhs) {
return new Action(new OrActionNode(lhs._node, rhs._node));
}
static public Action operator !(Action rhs) {
return new Action(new NotActionNode(rhs._node));
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 540ea246c1d22274385f668c30a985b9
timeCreated: 1455461048
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,45 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
public class ActionMap<T> {
#region Fields
private Dictionary<T, Action> _dictionary;
#endregion
#region Properties
public ActionMap() {
_dictionary = new Dictionary<T, Action>();
}
#endregion
#region Constructor
#endregion
#region Methods
// alternative of operator[]
public bool IsActive(T ID) {
return this[ID].IsActive();
}
#endregion
#region Operators
// operator[] to access dictionary
public Action this[T ID] {
get {
return _dictionary.ContainsKey(ID) ? _dictionary[ID] : null;
}
set {
if (!_dictionary.ContainsKey(ID))
_dictionary.Add(ID, value);
else
_dictionary[ID] = value;
}
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: ba2a3a99aabaa9e468083643c50154b0
timeCreated: 1455627296
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,285 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.InteropServices;
using System.Text;
using UnityEngine;
using UnityEngine.Playables;
abstract class ActionNode : MonoBehaviour
{
public PlayableDirector director;
public abstract bool IsActive();
public abstract void ForceUpdate();
void Start()
{
if (director != null)
{
director.Play();
}
}
}
class ActionNodeManager : ActionNode {
private ActionNode _node;
public ActionNodeManager(KeyCode key, Action.EActionType type =Action.EActionType.Hold, int multi =2) {
// Create the correct ActionNode type depending on the EActionType given
switch (type) {
case Action.EActionType.Hold:
case Action.EActionType.PressOnce:
case Action.EActionType.ReleaseOnce:
_node = new SimpleActionNode(key, type);
break;
case Action.EActionType.HoldTwice:
case Action.EActionType.MultiHold:
_node = new MultiHoldActionNode(key, multi);
break;
case Action.EActionType.PressTwice:
case Action.EActionType.MultiPress:
_node = new MultiPressActionNode(key, multi);
break;
case Action.EActionType.ReleaseTwice:
case Action.EActionType.MultiRelease:
_node = new MultiReleaseActionNode(key, multi);
break;
default:
throw new ArgumentOutOfRangeException("type");
}
}
public override bool IsActive() {
return _node.IsActive();
}
public override void ForceUpdate() {}
#region Subclasses
private class SimpleActionNode : ActionNode {
private KeyCode _key;
private Action.EActionType _type;
public SimpleActionNode(KeyCode key, Action.EActionType type) {
// If a multi-press was given, throw an exception
if ((int)type >= 3)
throw new InvalidEnumArgumentException("type");
_key = key;
_type = type;
}
public override bool IsActive() {
switch (_type) {
case Action.EActionType.Hold:
return Keyboard.IsKeyDown(_key);
case Action.EActionType.PressOnce:
return Keyboard.IsKeyPressed(_key);
case Action.EActionType.ReleaseOnce:
return Keyboard.IsKeyReleased(_key);
default:
throw new ArgumentOutOfRangeException();
}
}
public override void ForceUpdate() {}
}
private abstract class MultiActionNode : ActionNode {
#region Fields
protected KeyCode _key; // The key
protected int _multiTarget = 2; // Number of times key has to be pressed
protected int _multiCurrent = 0; // Current amount of presses
protected float _startTime = -1; // Time of first click
protected bool _isActive; // If IsActive() should return true
private int _lastFrameUpdate; // Last frame IsActive() was called
#endregion
#region Properties
// Time that have passed since the first click
protected TimeSpan TimeSinceFirstClick {
get { return TimeSpan.FromSeconds(Time.time - _startTime); }
}
#endregion
#region Constructor
// Immediately set the key and target number of presses
public MultiActionNode(KeyCode key, int multiTarget =2) {
_key = key;
_multiTarget = multiTarget;
}
#endregion
#region Methods
// If action is currently active
public override bool IsActive() {
if (_lastFrameUpdate != Time.frameCount) {
Update();
_lastFrameUpdate = Time.frameCount;
}
return _isActive;
}
public override void ForceUpdate() {
Update();
}
// Update the _isActive state, is called once per frame
protected void Update() {
// Reset if timer has passed
if (_startTime < 0 || TimeSinceFirstClick > Action.MultiDelayTime.Multiply(_multiTarget))
Reset();
// Do every frame
UpdateFrame();
// When key is pressed
if (Keyboard.IsKeyPressed(_key))
Next();
// Do every frame after everything else
LateUpdateFrame();
}
// Do every frame (before Next())
protected virtual void UpdateFrame() {}
// Do when the key is pressed
protected virtual void Next() {
if (_multiCurrent == 0)
_startTime = Time.time;
_multiCurrent++;
}
// Do every frame (after Next())
protected virtual void LateUpdateFrame() {}
// Do if timer has passed (before anything else)
protected virtual void Reset() {
_startTime = -1;
_multiCurrent = 0;
}
#endregion
}
private class MultiHoldActionNode : MultiActionNode {
public MultiHoldActionNode(KeyCode key, int multiTarget)
: base(key, multiTarget) {}
#region Methods
protected override void Next() {
base.Next();
if (_multiCurrent == _multiTarget)
_isActive = true;
}
protected override void UpdateFrame() {
base.UpdateFrame();
if (Keyboard.IsKeyReleased(_key))
_isActive = false;
}
#endregion
}
private class MultiPressActionNode : MultiActionNode {
private int _frameActive;
public MultiPressActionNode(KeyCode key, int multiTarget)
: base(key, multiTarget) {}
#region Methods
protected override void UpdateFrame() {
base.UpdateFrame();
_isActive = false;
if (_frameActive + 1 == Time.frameCount)
_multiCurrent = 0;
}
protected override void Next() {
base.Next();
if (_multiCurrent == _multiTarget) {
_isActive = true;
_frameActive = Time.frameCount;
}
}
protected override void Reset() {
base.Reset();
_isActive = false;
}
#endregion
}
private class MultiReleaseActionNode : MultiActionNode {
private bool _isHolding;
private int _frameActive;
public MultiReleaseActionNode(KeyCode key, int multiTarget)
: base(key, multiTarget) {}
#region Methods
protected override void Next() {
base.Next();
Debug.Log("MultiCurrent (release)=" + _multiCurrent);
if (_multiCurrent == _multiTarget) {
_isHolding = true;
}
}
protected override void UpdateFrame() {
base.UpdateFrame();
if (_frameActive + 1 == Time.frameCount)
_multiCurrent = 0;
if (_isHolding && Keyboard.IsKeyReleased(_key)) {
_isHolding = false;
_isActive = true;
_frameActive = Time.frameCount;
} else
_isActive = false;
}
#endregion
}
#endregion
}
class AndActionNode : ActionNode {
private ActionNode _lhs, _rhs;
public AndActionNode(ActionNode lhs, ActionNode rhs) {
_lhs = lhs;
_rhs = rhs;
}
public override bool IsActive() {
return _lhs.IsActive() && _rhs.IsActive();
}
public override void ForceUpdate() {}
}
class OrActionNode : ActionNode {
private ActionNode _lhs, _rhs;
public OrActionNode(ActionNode lhs, ActionNode rhs) {
_lhs = lhs;
_rhs = rhs;
}
public override bool IsActive() {
return _lhs.IsActive() || _rhs.IsActive();
}
public override void ForceUpdate() {}
}
class NotActionNode : ActionNode {
private ActionNode _node;
public NotActionNode(ActionNode node) {
_node = node;
}
public override bool IsActive() {
return !_node.IsActive();
}
public override void ForceUpdate() {}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: c613a16ac217c3945bcca92d18bca41f
timeCreated: 1455613982
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,57 @@
using UnityEngine;
public static class Keyboard {
#region Properties
/// <summary>
/// Returns true is any key is currently held
/// </summary>
public static bool IsAnyKeyDown {
get { return Input.anyKey; }
}
/// <summary>
/// Returns true if any key was pressed this frame
/// </summary>
public static bool IsAnyKeyPressed {
get { return Input.anyKeyDown; }
}
#endregion
#region Methods
/// <summary>
/// Returns true if the key is currently held down
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool IsKeyDown(KeyCode key) {
return Input.GetKey(key);
}
/// <summary>
/// Returns true if the key is currently not held down
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool IsKeyUp(KeyCode key) {
return !IsKeyDown(key);
}
/// <summary>
/// Returns true if key was pressed this frame
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool IsKeyPressed(KeyCode key) {
return Input.GetKeyDown(key);
}
/// <summary>
/// Returns true if key was released this frame
/// </summary>
/// <param name="key"></param>
/// <returns></returns>
public static bool IsKeyReleased(KeyCode key) {
return Input.GetKeyUp(key);
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 4eb4f21db6996d046933a133cb419c9e
timeCreated: 1455461100
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,112 @@
using System;
using UnityEngine;
public static class Mouse {
#region Properties
/// <summary>
/// Returns current mouse coordinates in screen coordinates
/// </summary>
public static Vector2 MouseScreenCoordinates {
get { return Input.mousePosition; }
}
/// <summary>
/// Difference of the mouse scroll this frame
/// </summary>
public static Vector2 ScrollDelta {
get { return Input.mouseScrollDelta; }
}
#endregion
#region Methods
/// <summary>
/// Returns the position of the mouse in pixels
/// </summary>
/// <returns></returns>
public static Vector2 GetMouseScreenCoordinates() {
return MouseScreenCoordinates;
}
/// <summary>
/// Returns the position of the mouse in world coordinates
/// </summary>
/// <param name="cam"></param>
/// <returns></returns>
public static Vector3 GetMouseWorldCoordinates(Camera cam) {
return cam.ScreenToWorldPoint(new Vector3(Input.mousePosition.x, Input.mousePosition.y, cam.nearClipPlane));
}
/// <summary>
/// Returns true if button is currently held down
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
public static bool IsButtonDown(KeyCode button) {
ThrowIfNoMouseKey(button);
return Input.GetMouseButton(GetMouseButton(button));
}
/// <summary>
/// Return true if button is currently not down
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
public static bool IsButtonUp(KeyCode button) {
ThrowIfNoMouseKey(button);
return !IsButtonDown(button);
}
/// <summary>
/// Returns true if the button was pressed this frame
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
public static bool IsButtonPressed(KeyCode button) {
ThrowIfNoMouseKey(button);
return Input.GetMouseButtonDown(GetMouseButton(button));
}
/// <summary>
/// Returns true if the button was released this frame
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
public static bool IsButtonReleased(KeyCode button) {
ThrowIfNoMouseKey(button);
return Input.GetMouseButtonUp(GetMouseButton(button));
}
private static void ThrowIfNoMouseKey(KeyCode button) {
if (GetMouseButton(button) == -1)
throw new ArgumentException("Only KeyCode.Mouse# is accepted here", "button");
}
#endregion
#region Helper methods
/// <summary>
/// Returns the number of the mouse button or -1 if not a mouse button
/// </summary>
/// <param name="button"></param>
/// <returns></returns>
private static int GetMouseButton(KeyCode button) {
switch (button) {
case KeyCode.Mouse0:
return 0;
case KeyCode.Mouse1:
return 1;
case KeyCode.Mouse2:
return 2;
case KeyCode.Mouse3:
return 3;
case KeyCode.Mouse4:
return 4;
case KeyCode.Mouse5:
return 5;
case KeyCode.Mouse6:
return 6;
default:
return -1;
}
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1069296f2b7649e42ac9379ad1789421
timeCreated: 1455461108
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,49 @@
using UnityEngine;
using System.Collections;
using System.Linq;
using UnityEngine.UI;
public class OptionsFormScript : MonoBehaviour {
#region Properties
/// <summary>
/// Gets the value of the 'Mines' field
/// </summary>
public int Mines {
get { return int.Parse(Get("Text", "Mines").text); }
}
/// <summary>
/// Gets the value of the 'Width' field
/// </summary>
public int FieldWidth {
get { return int.Parse(Get("Text", "FieldWidth").text); }
}
/// <summary>
/// Gets the value of the 'Height' field
/// </summary>
public int FieldHeight {
get { return int.Parse(Get("Text", "FieldHeight").text); }
}
#endregion
/// <summary>
/// Gets the field with name <paramref name="name"/> and parent <paramref name="parentName"/>
/// </summary>
/// <param name="name">Name of the <see cref="Text"/> object</param>
/// <param name="parentName">Name of the parent of the object</param>
/// <returns></returns>
private Text Get(string name, string parentName) {
var texts =
this.GetComponentsInChildren<Text>()
.Where(text => text.name == name && text.transform.parent.transform.parent.name == parentName);
if (texts.Count() == 1)
return texts.First();
string temp = " text field found named " + name + " of parent " + parentName;
if (!texts.Any())
throw new MissingComponentException("No" + temp);
throw new MissingComponentException("Multiple" + temp);
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 43bf6ab6231749c44bb149c322cb9974
timeCreated: 1456828623
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,97 @@
using System;
using UnityEngine;
using System.Collections;
using System.Runtime.InteropServices;
using UnityEngine.SceneManagement;
public enum EControls {
TilePressed,
TileReleased,
TileFlagPressed,
TileFlagReleased,
TileSquarePressed,
TileSquareReleased,
GameEscape
}
/// <summary>
/// Defines a couple of default variables. Should be a singleton
/// </summary>
public class PersistentInfoScript : MonoBehaviour {
#region Fields
/// <summary>
/// Default width of the field
/// </summary>
[Header("Default values")]
public int DefaultFieldSizeX;
/// <summary>
/// Default height of the field
/// </summary>
public int DefaultFieldSizeY;
/// <summary>
/// Default number of mines on the field
/// </summary>
public int DefaultMines;
/// <summary>
/// If audio is enabled or not (unused)
/// </summary>
[Header("Options")]
public bool AudioEnabled;
/// <summary>
/// Controls of the game
/// </summary>
public ActionMap<EControls> Controls = new ActionMap<EControls>();
#endregion
#region Methods
void Awake() {
SetDefaultControls();
DontDestroyOnLoad(this);
}
/// <summary>
/// Reload default controls scheme
/// </summary>
public void SetDefaultControls() {
Controls = new ActionMap<EControls>();
SetControl(EControls.TilePressed, KeyCode.Mouse0);
SetControl(EControls.TileFlagPressed, KeyCode.Mouse1);
SetControl(EControls.TileSquarePressed, KeyCode.Mouse2);
SetControl(EControls.GameEscape, KeyCode.Escape);
}
/// <summary>
/// Set separate controls
/// </summary>
/// <param name="control"></param>
/// <param name="key"></param>
public void SetControl(EControls control, KeyCode key) {
switch (control) {
case EControls.TilePressed:
case EControls.TileReleased:
Controls[EControls.TilePressed] = new Action(key, Action.EActionType.PressOnce);
Controls[EControls.TileReleased] = new Action(key, Action.EActionType.ReleaseOnce);
break;
case EControls.TileFlagPressed:
case EControls.TileFlagReleased:
Controls[EControls.TileFlagPressed] = new Action(key, Action.EActionType.PressOnce);
Controls[EControls.TileFlagReleased] = new Action(key, Action.EActionType.ReleaseOnce);
break;
case EControls.TileSquarePressed:
case EControls.TileSquareReleased:
Controls[EControls.TileSquarePressed] = new Action(key, Action.EActionType.PressOnce);
Controls[EControls.TileSquareReleased] = new Action(key, Action.EActionType.ReleaseOnce);
break;
case EControls.GameEscape:
Controls[EControls.GameEscape] = new Action(key, Action.EActionType.ReleaseOnce);
break;
default:
throw new ArgumentOutOfRangeException("control");
}
}
#endregion
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: b76f0b57b8ec93046add8bdbfde69355
timeCreated: 1455272457
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,15 @@
using UnityEngine;
using System.Collections;
/// <summary>
/// Holds some information for the smiley face on top
/// </summary>
public class StateButtonScript : MonoBehaviour {
/// <summary>
/// Different sprites that are used for certain states.
/// </summary>
/// <remarks>Should be a dictionary with the different Enums</remarks>
public Sprite DefaultSprite, WinSprite, ClickedSprite, PressedSprite, LoseSprite;
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: e6279ae2de0a128448ff9bf212191843
timeCreated: 1454430460
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
#if UNITY_EDITOR
using System;
using UnityEngine;
using System.Collections;
using UnityEditor;
/// <summary>
/// No worries about this one
/// </summary>
public class TestScript : MonoBehaviour {
public void DoSomething() {
Debug.Log("30s * 3 = " + TimeSpan.FromSeconds(30).Multiply(3).TotalSeconds + "s");
}
}
[CustomEditor(typeof(TestScript))]
public class TestEditor : Editor {
public override void OnInspectorGUI() {
DrawDefaultInspector();
TestScript obj = (TestScript)target;
if (GUILayout.Button("Click MEEE!"))
obj.DoSomething();
}
}
#endif

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 69c8043d9335a3442ba9571f8d655f8c
timeCreated: 1456305665
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,423 @@
using System;
using UnityEngine;
using System.Collections.Generic;
using System.Linq;
/// <summary>
/// Handles the logic of a single tile
/// </summary>
public class TileScript : MonoBehaviour {
#region Enums
/// <summary>
/// Type of tile (bomb or mine)
/// </summary>
public enum EType {
Safe,
Mine
}
/// <summary>
/// Number of the tile (can be correctly casted to an integer)
/// </summary>
public enum ENumber {
Empty,
One,
Two,
Three,
Four,
Five,
Six,
Seven,
Eight
}
#endregion
#region Fields
/// <summary>
/// References to unrevealed tiles
/// </summary>
public Sprite TileUnknown,
TilePressed;
/// <summary>
/// References to revealed empty tiles
/// </summary>
public Sprite Tile0,
Tile1,
Tile2,
Tile3,
Tile4,
Tile5,
Tile6,
Tile7,
Tile8;
/// <summary>
/// References to mine-related tiles
/// </summary>
public Sprite TileMine,
TileFlag,
TileQuestion,
TileQuestionPressed;
/// <summary>
/// References to revealed or wrongly placed flag tiles
/// </summary>
public Sprite TileDead,
TileWrong;
public float LocalScale = 1;
/// <summary>
/// What type is this
/// </summary>
private EType _type = EType.Safe;
private ENumber _num = ENumber.Empty;
private bool _flagged;
private bool _revealed;
private Sprite _sprRevealed;
private SpriteRenderer _sprRend;
private bool _enabled = true;
// Tile container
private ControlScript _parent;
private GameObject[,] _container;
private Vector2i _gridPos;
private List<TileScript> _neighbours = new List<TileScript>();
// Tile mouse fields
private bool _leftDown;
private bool _rightDown;
private bool _middleDown;
#endregion
#region Properties
/// <summary>
/// What type is this tile (safe or not)?
/// </summary>
public EType Type {
get { return _type; }
set {
_type = value;
AssignTexture();
}
}
/// <summary>
/// What number does this tile have? Only applicable if not a mine
/// </summary>
public ENumber Number {
get { return _num; }
set {
_num = value;
AssignTexture();
}
}
/// <summary>
/// Reference to the control script
/// </summary>
public ControlScript Parent {
get { return _parent; }
set { _parent = value; }
}
/// <summary>
/// Reference to the tiles container
/// </summary>
public GameObject[,] Container {
get { return _container; }
set { _container = value; }
}
/// <summary>
/// Position of this tile within the grid
/// </summary>
public Vector2i GridPos {
get { return _gridPos; }
set { _gridPos = value; }
}
/// <summary>
/// Is the tile revealed? Setting it will apply its value.
/// </summary>
public bool Revealed {
get { return _revealed; }
set {
if (_revealed && !value) {
Unreveal();
_revealed = false;
} else if (!_revealed && value) {
Reveal();
}
}
}
/// <summary>
/// Is the tile flagged? Setting it will apply or remove the flag
/// </summary>
public bool Flagged {
get { return _flagged; }
set {
if (value)
Flag();
else
Unflag();
}
}
/// <summary>
/// All neighbours of this tile
/// </summary>
public List<TileScript> Neighbours {
get { return _neighbours; }
}
/// <summary>
/// Adds a neighbour. Strange that this is a property...
/// </summary>
public TileScript NewNeighbour {
set { _neighbours.Add(value); }
}
/// <summary>
/// Should the tile react to user input
/// </summary>
public bool Enabled {
get { return _enabled; }
set { _enabled = value; }
}
#endregion
#region Unity Methods
/// <summary>
/// First initailization, called before all Start methods
/// </summary>
void Awake() {
_sprRevealed = Tile0; // default reveal tile
}
/// <summary>
/// Use this for initialization
/// </summary>
void Start() {
_sprRend = GetComponent<SpriteRenderer>();
_sprRend.sprite = TileUnknown;
transform.localScale = new Vector3(LocalScale, LocalScale, LocalScale);
}
/// <summary>
/// Update is called once per frame
/// </summary>
void Update() {
// Left mouse button released
if (_parent.Controls[EControls.TileReleased].IsActive() && _leftDown) {
_leftDown = false;
if (!_revealed)
TileRelease();
}
// Right mouse button released
if (_parent.Controls[EControls.TileFlagReleased].IsActive() && _rightDown)
_rightDown = false;
// Middle mouse button released
if (_parent.Controls[EControls.TileSquareReleased].IsActive() && _middleDown) {
_middleDown = false;
foreach (var neighbour in _neighbours.Where(neighbour => !neighbour._flagged && !neighbour._revealed))
neighbour.TileRelease();
}
}
/// <summary>
/// Is called every frame that the mouse is over this objects bounding box
/// </summary>
void OnMouseOver() {
if (!_enabled)
return;
// Left mouse button behaviour
if (!_revealed && _parent.Controls[EControls.TilePressed].IsActive()) {
_leftDown = true;
TilePress();
}
if (_parent.Controls[EControls.TileReleased].IsActive() && _leftDown)
_parent.OnTileClick(gameObject);
// Right mouse button behaviour
if (!_revealed && _parent.Controls[EControls.TileFlagPressed].IsActive())
_rightDown = true;
if (_parent.Controls[EControls.TileFlagReleased].IsActive() && _rightDown)
_parent.OnTileRightClick(gameObject);
// Middle mouse button behaviour
if (_revealed && _parent.Controls[EControls.TileSquarePressed].IsActive()) {
_middleDown = true;
foreach (var neighbour in _neighbours.Where(neighbour => !neighbour._flagged && !neighbour._revealed))
neighbour.TilePress();
}
if (_parent.Controls[EControls.TileSquareReleased].IsActive() && _middleDown)
_parent.OnTileMiddleClick(gameObject);
}
#endregion
#region Methods
/// <summary>
/// Removes all neighbours
/// </summary>
public void ClearNeighbours() {
_neighbours.Clear();
}
/// <summary>
/// Reveals current tile and nearby ones if ENumber == Empty
/// </summary>
public void Reveal() {
// skip if already revealed or flagged
if (_revealed || _flagged)
return;
_revealed = true;
_sprRend.sprite = _sprRevealed;
if (_type != EType.Mine && _num == ENumber.Empty)
Neighbours.ForEach(neighbour => neighbour.Revealed = true);
_parent.OnTileReveal(gameObject);
}
/// <summary>
/// Used when the user reveals this mine
/// </summary>
public void SetAsDeadMine() {
_sprRend.sprite = TileDead;
}
/// <summary>
/// Hides the tile again
/// </summary>
public void Unreveal() {
// Skip if already hidden
if (!_revealed)
return;
_revealed = false;
_sprRend.sprite = TileUnknown;
}
/// <summary>
/// Reveals the tile as if the game was lost (only mines are revealed, empty tiles and correctly flagged mines are
/// unaffected, incorrectly flagged mines are tagged)
/// </summary>
public void RevealAsLoseState() {
if (_type == EType.Mine && !_flagged && !_revealed) {
_sprRend.sprite = TileMine;
} else if (_type != EType.Mine && _flagged) {
_sprRend.sprite = TileWrong;
}
}
/// <summary>
/// Swap the flag state
/// </summary>
public void FlagSwap() {
if (_flagged)
Unflag();
else
Flag();
}
/// <summary>
/// Forces a flag on the tile
/// </summary>
public void Flag() {
// skip if already flagged or revealed
if (_flagged || _revealed)
return;
_flagged = true;
_sprRend.sprite = TileFlag;
}
/// <summary>
/// Forces to remove the flag
/// </summary>
public void Unflag() {
// skip if already unflagged
if (!_flagged)
return;
_flagged = false;
_sprRend.sprite = TileUnknown;
}
#endregion
#region Helper functions
/// <summary>
/// Visual feedback when the user clicks a mine
/// </summary>
private void TilePress() {
if (!_revealed && !_flagged)
_sprRend.sprite = TilePressed;
}
/// <summary>
/// Visual feedback for when the user releases the click
/// </summary>
private void TileRelease() {
if (!_revealed && !_flagged)
_sprRend.sprite = TileUnknown;
}
/// <summary>
/// Assigns the correct texture for when the tile is revealed
/// </summary>
private void AssignTexture() {
switch (_type) {
case EType.Safe:
switch (_num) {
case ENumber.Empty:
_sprRevealed = Tile0;
break;
case ENumber.One:
_sprRevealed = Tile1;
break;
case ENumber.Two:
_sprRevealed = Tile2;
break;
case ENumber.Three:
_sprRevealed = Tile3;
break;
case ENumber.Four:
_sprRevealed = Tile4;
break;
case ENumber.Five:
_sprRevealed = Tile5;
break;
case ENumber.Six:
_sprRevealed = Tile6;
break;
case ENumber.Seven:
_sprRevealed = Tile7;
break;
case ENumber.Eight:
_sprRevealed = Tile8;
break;
default:
throw new ArgumentOutOfRangeException();
}
break;
case EType.Mine:
_sprRevealed = TileMine;
break;
default:
throw new ArgumentOutOfRangeException();
}
}
#endregion
}

View File

@ -0,0 +1,30 @@
fileFormatVersion: 2
guid: cef84f0df244f09439e1b65d792abbc9
timeCreated: 1454352093
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences:
- TileUnknown: {fileID: 21300030, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- TilePressed: {fileID: 21300032, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile0: {fileID: 21300032, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile1: {fileID: 21300046, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile2: {fileID: 21300048, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile3: {fileID: 21300050, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile4: {fileID: 21300052, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile5: {fileID: 21300054, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile6: {fileID: 21300056, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile7: {fileID: 21300058, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- Tile8: {fileID: 21300060, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- TileMine: {fileID: 21300040, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- TileFlag: {fileID: 21300034, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- TileQuestion: {fileID: 21300036, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- TileQuestionPressed: {fileID: 21300038, guid: bbf1608df437159458ebfa96e34067ae,
type: 3}
- TileDead: {fileID: 21300042, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
- TileWrong: {fileID: 21300044, guid: bbf1608df437159458ebfa96e34067ae, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,72 @@
using System;
using UnityEngine;
using System.Collections;
/// <summary>
/// Handles the logic of the time counters
/// </summary>
public class TimeScript : MonoBehaviour {
#region Enums/Structs
/// <summary>
/// Different digits in the time counter
/// </summary>
public enum ETimeNumber {
Hundred0,
Hundred00,
Second0,
Second00,
Minute0,
Minute00,
Hour0,
Hour00
}
#endregion
#region Fields
/// <summary>
/// Which digit does this tile represent?
/// </summary>
public ETimeNumber Type;
/// <summary>
/// Reference to all of the number sprites
/// </summary>
public Sprite[] NumberSprites;
#endregion
/// <summary>
/// Sets the correct sprite for this digit
/// </summary>
/// <param name="elapsed"></param>
public void SetTimeSprite(TimeSpan elapsed) {
var sr = GetComponent<SpriteRenderer>();
switch (Type) {
case ETimeNumber.Hundred0:
sr.sprite = NumberSprites[(elapsed.Milliseconds / 10) % 10];
break;
case ETimeNumber.Hundred00:
sr.sprite = NumberSprites[(elapsed.Milliseconds / 100) % 10];
break;
case ETimeNumber.Second0:
sr.sprite = NumberSprites[elapsed.Seconds % 10];
break;
case ETimeNumber.Second00:
sr.sprite = NumberSprites[(elapsed.Seconds / 10) % 10];
break;
case ETimeNumber.Minute0:
sr.sprite = NumberSprites[elapsed.Minutes % 10];
break;
case ETimeNumber.Minute00:
sr.sprite = NumberSprites[(elapsed.Minutes / 10) % 10];
break;
case ETimeNumber.Hour0:
sr.sprite = NumberSprites[elapsed.Hours % 10];
break;
case ETimeNumber.Hour00:
sr.sprite = NumberSprites[(elapsed.Hours / 10) % 10];
break;
default:
throw new ArgumentOutOfRangeException();
}
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 69125d056127da746a8a1ed8371ea8d6
timeCreated: 1455123626
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 0f9e8527c8a84bf41aea7b59e7881f0b
folderAsset: yes
timeCreated: 1455782979
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,39 @@
using System;
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
/// <summary>
/// Utility functions
/// </summary>
public static class Utility {
/// <summary>
/// Bool conversion to int (false=-1, true=1)
/// </summary>
/// <param name="val"></param>
/// <returns></returns>
public static int ToIntSign(this bool val) {
return val ? 1 : -1;
}
/// <summary>
/// Multiplies the TimeSpan with the given integer
/// </summary>
/// <param name="ts"></param>
/// <param name="num"></param>
/// <returns></returns>
public static TimeSpan Multiply(this TimeSpan ts, int num) {
return TimeSpan.FromTicks(ts.Ticks * num);
}
/// <summary>
/// Multiplier the TimeSpan with the given float
/// </summary>
/// <param name="ts"></param>
/// <param name="num"></param>
/// <returns></returns>
public static TimeSpan Multiply(this TimeSpan ts, float num) {
return TimeSpan.FromTicks((long)(ts.Ticks * num));
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 0cf81e4d3acab1c4c80a2d89dfbb8cd7
timeCreated: 1455783284
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,27 @@
using UnityEngine;
using System.Collections;
using System.Collections.Generic;
public class Vector2i {
public int X { get; set; }
public int Y { get; set; }
public Vector2i(int x, int y) {
X = x;
Y = y;
}
}
public class Vector2iComparer : IEqualityComparer<Vector2i> {
public bool Equals(Vector2i v1, Vector2i v2) {
if (v1 == null && v2 == null)
return true;
if (v1 == null || v2 == null)
return false;
return (v1.X == v2.X && v1.Y == v2.Y);
}
public int GetHashCode(Vector2i vec) {
return 0;
}
}

View File

@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: dd882db2b20d193459c61b1f76813d6f
timeCreated: 1455782999
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8061c9363372c1dcfa87700945103ec5
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,22 @@
fileFormatVersion: 2
guid: c8a01352658eae445a4e84bc230d9d01
timeCreated: 1455748263
licenseType: Free
AudioImporter:
serializedVersion: 6
defaultSettings:
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
preloadAudioData: 1
loadInBackground: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6907c4fd3f1f543f4bb2a285408678c1
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 B

View File

@ -0,0 +1,169 @@
fileFormatVersion: 2
guid: 24b4a5f30a4ff9c489da7df8bb254c77
TextureImporter:
internalIDToNameTable:
- first:
213: 21300000
second: Button_0
- first:
213: 21300002
second: Button_1
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 16
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 2
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites:
- serializedVersion: 2
name: Button_0
rect:
serializedVersion: 2
x: 0
y: 41
width: 92
height: 41
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 02305410000000000800000000000000
internalID: 21300000
vertices: []
indices:
edges: []
weights: []
- serializedVersion: 2
name: Button_1
rect:
serializedVersion: 2
x: 0
y: 0
width: 92
height: 41
alignment: 0
pivot: {x: 0.5, y: 0.5}
border: {x: 0, y: 0, z: 0, w: 0}
customData:
outline: []
physicsShape: []
tessellationDetail: -1
bones: []
spriteID: 22305410000000000800000000000000
internalID: 21300002
vertices: []
indices:
edges: []
weights: []
outline: []
customData:
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable:
Button_0: 21300000
Button_1: 21300002
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 578 B

View File

@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: 75cc345e710c3564c88bb952129f0a76
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,117 @@
fileFormatVersion: 2
guid: a39b53f506aa29640b7fcaf26c39d56c
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 13
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: -1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 1
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 1
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 8
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 1
swizzle: 50462976
cookieLightType: 1
platformSettings:
- serializedVersion: 4
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 4
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
customData:
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spriteCustomMetadata:
entries: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -10,6 +10,20 @@ public class OpenDoor : MonoBehaviour
[SerializeField] private string animationFile = "DoorAnimation.013"; [SerializeField] private string animationFile = "DoorAnimation.013";
[SerializeField] private bool playTabletAnimation = true; [SerializeField] private bool playTabletAnimation = true;
[SerializeField] private GameObject crosshair = null; // enable and disable crosshair when player in tablet trigger
[SerializeField] private StarterAssets.StarterAssetsInputs mouseLook = null;
[SerializeField] private ControlScript controlScript = null;
[SerializeField] private AudioClip victorySound = null;
// set number of bombs and grid size
[SerializeField] private int bombs = 9;
[SerializeField] private int gridSize = 11;
[SerializeField] private int timeLimitSeconds = 10;
private void OnTriggerEnter(Collider other) private void OnTriggerEnter(Collider other)
{ {
if (other.CompareTag("Player")) if (other.CompareTag("Player"))
@ -38,7 +52,31 @@ public class OpenDoor : MonoBehaviour
return; return;
} }
puzzleScript.puzzleComplete = false; puzzleScript.puzzleComplete = false;
tabletAnimator.Play("Tablet_Open", 0, 0.0f); // disable crosshair
crosshair.SetActive(false);
// set player motion to 0
mouseLook.move = Vector2.zero;
mouseLook.look = Vector2.zero;
// play the tablet open animation
tabletAnimator.Play("Tablet_Open", 0, 0.0f);
if (mouseLook != null)
{
mouseLook.cursorInputForLook = false;
}
// unlock cursor
Cursor.lockState = CursorLockMode.None;
Cursor.visible = true;
// set state to playing on control script for mines, reset the game
if (controlScript != null)
{
controlScript.GridSizeX = gridSize;
controlScript.GridSizeY = gridSize;
controlScript.TotalMines = bombs;
controlScript.timeLimitSeconds = timeLimitSeconds;
controlScript.Restart();
}
} }
else else
{ {
@ -63,10 +101,20 @@ public class OpenDoor : MonoBehaviour
// set the text of the tablet to the current door number, will be last 3 letter of the door name // set the text of the tablet to the current door number, will be last 3 letter of the door name
var doorNumber = gameObject.name.Substring(gameObject.name.Length - 3); var doorNumber = gameObject.name.Substring(gameObject.name.Length - 3);
string doorText = "Target Door: " + doorNumber; string doorText = "Target Door: " + doorNumber;
puzzleScript.SetTargetText(doorText); puzzleScript.SetDoorTargetText(doorText);
// convert time limit to minutes:seconds
var doorTimeLimit = "Time Limit: " + timeLimitSeconds / 60 + ":" + timeLimitSeconds % 60 + " ";
puzzleScript.SetDoorTimeLimitText(doorTimeLimit);
// Wait until the puzzle is complete // Wait until controlscript is in state Win
yield return new WaitUntil(() => puzzleScript.puzzleComplete); yield return new WaitUntil(() => controlScript.GameState == ControlScript.EGameState.Win);
// SoundFXManager.instance.PlaySound(victorySound, transform, 1.0f);
// wait 5 seconds
yield return new WaitForSeconds(1.0f);
// reset the game state
controlScript.Restart();
Debug.Log("Puzzle completed! Playing animations..."); Debug.Log("Puzzle completed! Playing animations...");
@ -74,6 +122,16 @@ public class OpenDoor : MonoBehaviour
if (playTabletAnimation) if (playTabletAnimation)
{ {
tabletAnimator.Play("Tablet_Close", 0, 0.0f); tabletAnimator.Play("Tablet_Close", 0, 0.0f);
// enable crosshair
crosshair.SetActive(true);
// lock cursor
Cursor.lockState = CursorLockMode.Locked;
Cursor.visible = false;
// var mouseLook = GetComponent<StarterAssets.StarterAssetsInputs>();
if (mouseLook != null)
{
mouseLook.cursorInputForLook = true;
}
} }
// Play the door open animation // Play the door open animation

View File

@ -33,28 +33,28 @@ MonoBehaviour:
m_Settings: m_Settings:
m_SettingsList: m_SettingsList:
m_List: m_List:
- rid: 3800322662763593946 - rid: 2002001032582004933
- rid: 3800322662763593947 - rid: 2002001032582004934
- rid: 6852985685364965378 - rid: 6852985685364965378
- rid: 6852985685364965379 - rid: 6852985685364965379
- rid: 6852985685364965380 - rid: 6852985685364965380
- rid: 6852985685364965381 - rid: 6852985685364965381
- rid: 3800322662763593948 - rid: 2002001032582004935
- rid: 3800322662763593949 - rid: 2002001032582004936
- rid: 6852985685364965384 - rid: 6852985685364965384
- rid: 6852985685364965385 - rid: 6852985685364965385
- rid: 3800322662763593950 - rid: 2002001032582004937
- rid: 3800322662763593951 - rid: 2002001032582004938
- rid: 3800322662763593952 - rid: 2002001032582004939
- rid: 3800322662763593953 - rid: 2002001032582004940
- rid: 3800322662763593954 - rid: 2002001032582004941
- rid: 3800322662763593955 - rid: 2002001032582004942
- rid: 6852985685364965392 - rid: 6852985685364965392
- rid: 3800322662763593956 - rid: 2002001032582004943
- rid: 6852985685364965394 - rid: 6852985685364965394
- rid: 8712630790384254976 - rid: 8712630790384254976
- rid: 4726762159971237888 - rid: 4726762159971237888
- rid: 3800322662763593957 - rid: 2002001032582004944
m_RuntimeSettings: m_RuntimeSettings:
m_List: m_List:
- rid: 6852985685364965378 - rid: 6852985685364965378
@ -97,14 +97,14 @@ MonoBehaviour:
references: references:
version: 2 version: 2
RefIds: RefIds:
- rid: 3800322662763593946 - rid: 2002001032582004933
type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} type: {class: URPShaderStrippingSetting, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data: data:
m_Version: 0 m_Version: 0
m_StripUnusedPostProcessingVariants: 1 m_StripUnusedPostProcessingVariants: 1
m_StripUnusedVariants: 1 m_StripUnusedVariants: 1
m_StripScreenCoordOverrideVariants: 1 m_StripScreenCoordOverrideVariants: 1
- rid: 3800322662763593947 - rid: 2002001032582004934
type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} type: {class: UniversalRenderPipelineEditorShaders, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data: data:
m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3} m_AutodeskInteractive: {fileID: 4800000, guid: 0e9d5a909a1f7e84882a534d0d11e49f, type: 3}
@ -116,7 +116,7 @@ MonoBehaviour:
m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3} m_DefaultSpeedTree7Shader: {fileID: 4800000, guid: 0f4122b9a743b744abe2fb6a0a88868b, type: 3}
m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3} m_DefaultSpeedTree8Shader: {fileID: -6465566751694194690, guid: 9920c1f1781549a46ba081a2a15a16ec, type: 3}
m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3} m_DefaultSpeedTree9Shader: {fileID: -6465566751694194690, guid: cbd3e1cc4ae141c42a30e33b4d666a61, type: 3}
- rid: 3800322662763593948 - rid: 2002001032582004935
type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} type: {class: Renderer2DResources, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data: data:
m_Version: 0 m_Version: 0
@ -131,7 +131,7 @@ MonoBehaviour:
m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2} m_DefaultLitMaterial: {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} m_DefaultUnlitMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2} m_DefaultMaskMaterial: {fileID: 2100000, guid: 15d0c3709176029428a0da2f8cecf0b5, type: 2}
- rid: 3800322662763593949 - rid: 2002001032582004936
type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} type: {class: UniversalRenderPipelineEditorMaterials, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data: data:
m_DefaultMaterial: {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} m_DefaultMaterial: {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
@ -140,7 +140,7 @@ MonoBehaviour:
m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2} m_DefaultTerrainMaterial: {fileID: 2100000, guid: 594ea882c5a793440b60ff72d896021e, type: 2}
m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2} m_DefaultDecalMaterial: {fileID: 2100000, guid: 31d0dcc6f2dd4e4408d18036a2c93862, type: 2}
m_DefaultSpriteMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2} m_DefaultSpriteMaterial: {fileID: 2100000, guid: 9dfc825aed78fcd4ba02077103263b40, type: 2}
- rid: 3800322662763593950 - rid: 2002001032582004937
type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime} type: {class: GPUResidentDrawerResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.GPUDriven.Runtime}
data: data:
m_Version: 0 m_Version: 0
@ -153,13 +153,13 @@ MonoBehaviour:
m_OcclusionCullingDebugKernels: {fileID: 7200000, guid: b23e766bcf50ca4438ef186b174557df, type: 3} m_OcclusionCullingDebugKernels: {fileID: 7200000, guid: b23e766bcf50ca4438ef186b174557df, type: 3}
m_DebugOcclusionTestPS: {fileID: 4800000, guid: d3f0849180c2d0944bc71060693df100, type: 3} m_DebugOcclusionTestPS: {fileID: 4800000, guid: d3f0849180c2d0944bc71060693df100, type: 3}
m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248, type: 3} m_DebugOccluderPS: {fileID: 4800000, guid: b3c92426a88625841ab15ca6a7917248, type: 3}
- rid: 3800322662763593951 - rid: 2002001032582004938
type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} type: {class: STP/RuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data: data:
m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3} m_setupCS: {fileID: 7200000, guid: 33be2e9a5506b2843bdb2bdff9cad5e1, type: 3}
m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3} m_preTaaCS: {fileID: 7200000, guid: a679dba8ec4d9ce45884a270b0e22dda, type: 3}
m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3} m_taaCS: {fileID: 7200000, guid: 3923900e2b41b5e47bc25bfdcbcdc9e6, type: 3}
- rid: 3800322662763593952 - rid: 2002001032582004939
type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} type: {class: ProbeVolumeBakingResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data: data:
m_Version: 1 m_Version: 1
@ -172,12 +172,12 @@ MonoBehaviour:
skyOcclusionRT: {fileID: -5126288278712620388, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3} skyOcclusionRT: {fileID: -5126288278712620388, guid: 5a2a534753fbdb44e96c3c78b5a6999d, type: 3}
renderingLayerCS: {fileID: -6772857160820960102, guid: 94a070d33e408384bafc1dea4a565df9, type: 3} renderingLayerCS: {fileID: -6772857160820960102, guid: 94a070d33e408384bafc1dea4a565df9, type: 3}
renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9, type: 3} renderingLayerRT: {fileID: -5126288278712620388, guid: 94a070d33e408384bafc1dea4a565df9, type: 3}
- rid: 3800322662763593953 - rid: 2002001032582004940
type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} type: {class: ProbeVolumeGlobalSettings, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data: data:
m_Version: 1 m_Version: 1
m_ProbeVolumeDisableStreamingAssets: 0 m_ProbeVolumeDisableStreamingAssets: 0
- rid: 3800322662763593954 - rid: 2002001032582004941
type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} type: {class: ProbeVolumeDebugResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data: data:
m_Version: 1 m_Version: 1
@ -187,21 +187,21 @@ MonoBehaviour:
probeVolumeOffsetDebugShader: {fileID: 4800000, guid: db8bd7436dc2c5f4c92655307d198381, type: 3} probeVolumeOffsetDebugShader: {fileID: 4800000, guid: db8bd7436dc2c5f4c92655307d198381, type: 3}
probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 20be25aac4e22ee49a7db76fb3df6de2, type: 3} probeSamplingDebugMesh: {fileID: -3555484719484374845, guid: 20be25aac4e22ee49a7db76fb3df6de2, type: 3}
numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a, type: 3} numbersDisplayTex: {fileID: 2800000, guid: 73fe53b428c5b3440b7e87ee830b608a, type: 3}
- rid: 3800322662763593955 - rid: 2002001032582004942
type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} type: {class: IncludeAdditionalRPAssets, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data: data:
m_version: 0 m_version: 0
m_IncludeReferencedInScenes: 0 m_IncludeReferencedInScenes: 0
m_IncludeAssetsByLabel: 0 m_IncludeAssetsByLabel: 0
m_LabelToInclude: m_LabelToInclude:
- rid: 3800322662763593956 - rid: 2002001032582004943
type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime} type: {class: ProbeVolumeRuntimeResources, ns: UnityEngine.Rendering, asm: Unity.RenderPipelines.Core.Runtime}
data: data:
m_Version: 1 m_Version: 1
probeVolumeBlendStatesCS: {fileID: 7200000, guid: a3f7b8c99de28a94684cb1daebeccf5d, type: 3} probeVolumeBlendStatesCS: {fileID: 7200000, guid: a3f7b8c99de28a94684cb1daebeccf5d, type: 3}
probeVolumeUploadDataCS: {fileID: 7200000, guid: 0951de5992461754fa73650732c4954c, type: 3} probeVolumeUploadDataCS: {fileID: 7200000, guid: 0951de5992461754fa73650732c4954c, type: 3}
probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931, type: 3} probeVolumeUploadDataL2CS: {fileID: 7200000, guid: 6196f34ed825db14b81fb3eb0ea8d931, type: 3}
- rid: 3800322662763593957 - rid: 2002001032582004944
type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime} type: {class: UniversalRenderPipelineEditorAssets, ns: UnityEngine.Rendering.Universal, asm: Unity.RenderPipelines.Universal.Runtime}
data: data:
m_DefaultSettingsVolumeProfile: {fileID: 11400000, guid: eda47df5b85f4f249abf7abd73db2cb2, type: 2} m_DefaultSettingsVolumeProfile: {fileID: 11400000, guid: eda47df5b85f4f249abf7abd73db2cb2, type: 2}

Binary file not shown.

View File

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 1e22e339795e907f988c2ba69d64450e
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

View File

@ -0,0 +1,23 @@
fileFormatVersion: 2
guid: 4dd66ba7a2fe90297a0974569d92785b
AudioImporter:
externalObjects: {}
serializedVersion: 8
defaultSettings:
serializedVersion: 2
loadType: 0
sampleRateSetting: 0
sampleRateOverride: 44100
compressionFormat: 1
quality: 1
conversionMode: 0
preloadAudioData: 0
platformSettingOverrides: {}
forceToMono: 0
normalize: 1
loadInBackground: 0
ambisonic: 0
3D: 1
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,8 @@ public class TabletScript : MonoBehaviour
{ {
// Start is called once before the first execution of Update after the MonoBehaviour is created // Start is called once before the first execution of Update after the MonoBehaviour is created
public bool puzzleComplete = false; public bool puzzleComplete = false;
[SerializeField] private TextMeshProUGUI targetText = null; [SerializeField] private TextMeshProUGUI targetDoorText = null;
[SerializeField] private TextMeshProUGUI targetDoorTimeLimit = null;
void Start() void Start()
{ {
@ -23,9 +24,13 @@ public class TabletScript : MonoBehaviour
} }
public void SetTargetText(string text) public void SetDoorTargetText(string text)
{ {
targetText.text = text; targetDoorText.text = text;
} }
public void SetDoorTimeLimitText(string text)
{
targetDoorTimeLimit.text = text;
}
} }

View File

@ -82,7 +82,7 @@ QualitySettings:
billboardsFaceCameraPosition: 1 billboardsFaceCameraPosition: 1
useLegacyDetailDistribution: 1 useLegacyDetailDistribution: 1
adaptiveVsync: 0 adaptiveVsync: 0
vSyncCount: 0 vSyncCount: 1
realtimeGICPUUsage: 100 realtimeGICPUUsage: 100
adaptiveVsyncExtraA: 0 adaptiveVsyncExtraA: 0
adaptiveVsyncExtraB: 0 adaptiveVsyncExtraB: 0