added alpha version of word puzzle and simon says puzzle to tablet
All checks were successful
Build project / Build for (StandaloneLinux64, 6000.0.37f1) (push) Successful in 15m19s
Build project / Build for (StandaloneWindows64, 6000.0.37f1) (push) Successful in 9m28s
Build project / Publish to itch.io (StandaloneLinux64) (push) Successful in 6s
Build project / Publish to itch.io (StandaloneWindows64) (push) Successful in 5s

This commit is contained in:
EthanPisani 2025-03-24 23:51:27 -04:00
parent f319ba2bf1
commit e5e9a77b01
42 changed files with 31888 additions and 39 deletions

View File

@ -56,7 +56,7 @@ public class BombNumberScript : MonoBehaviour {
/// 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)
if (_parent.GameState != EGameState.Uninitialized)
return;
if (Input.GetMouseButtonDown(0))
_leftDown = true;

View File

@ -4,11 +4,6 @@ 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
@ -20,6 +15,11 @@ public class ControlScript : MonoBehaviour {
Lose
}
#endregion
/// <summary>
/// The control script of the game, defines the logic. Should have been a singleton.
/// </summary>
public class ControlScript : MonoBehaviour {
#region Fields
/// <summary>

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 0eeedb7fbece25a4e9efa83d6c3c02bc
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 7bee7b8556d52aa4791e66418c150bda
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.5 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: bc8e07e549db14645bc4b93cf6060144
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 32bb9271fb16d5842ac164eb503af846
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: 1d5d46cffb17f694987ced466c5888e3
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

@ -0,0 +1,389 @@
%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: 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: 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 &245157515
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 245157518}
- component: {fileID: 245157517}
- component: {fileID: 245157516}
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 &245157516
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245157515}
m_Enabled: 1
--- !u!20 &245157517
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245157515}
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: 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: 1
m_AllowMSAA: 1
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 1
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &245157518
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 245157515}
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 &1495083771
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1495083774}
- component: {fileID: 1495083773}
- component: {fileID: 1495083772}
m_Layer: 0
m_Name: EventSystem
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1495083772
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1495083771}
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 &1495083773
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1495083771}
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: 10
--- !u!4 &1495083774
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1495083771}
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!1 &2041617717
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 2041617721}
- component: {fileID: 2041617720}
- component: {fileID: 2041617719}
- component: {fileID: 2041617718}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &2041617718
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2041617717}
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 &2041617719
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2041617717}
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 &2041617720
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2041617717}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 1
m_Camera: {fileID: 245157517}
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 &2041617721
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2041617717}
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: []
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!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 245157518}
- {fileID: 2041617721}
- {fileID: 1495083774}

View File

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

View File

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

View File

@ -0,0 +1,70 @@
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
public enum SGameState
{
Uninitialized,
Playing,
Win,
Lose
}
public class SimonSaysGameManager : MonoBehaviour
{
public int currentPuzzle = 1;
public SimonSaysPuzzle[] shapePuzzles = null;
public Button startPuzzleButton;
public SGameState gameState = SGameState.Uninitialized;
private void Start()
{
for (int i = 0; i < shapePuzzles.Length; i++)
{
SimonSaysPuzzle puzzle = shapePuzzles[i];
if (i == currentPuzzle)
{
puzzle.gameObject.SetActive(true);
continue;
}
puzzle.gameObject.SetActive(false);
}
startPuzzleButton.onClick.AddListener(ButtonClicked);
}
private void ButtonClicked()
{
if (currentPuzzle > shapePuzzles.Length)
return;
shapePuzzles[currentPuzzle].StartPuzzle();
gameState = SGameState.Playing;
shapePuzzles[currentPuzzle].completeScreen.SetActive(false);
shapePuzzles[currentPuzzle].failedScreen.SetActive(false);
}
public void PuzzleCompleted()
{
shapePuzzles[currentPuzzle].gameObject.SetActive(false);
gameState = SGameState.Win;
// currentPuzzle++;
// if (currentPuzzle < shapePuzzles.Length)
// {
// shapePuzzles[currentPuzzle].gameObject.SetActive(true);
// startPuzzleButton.gameObject.SetActive(true);
// print("Puzzle advanced!");
// }
// else
// {
// print("No more puzzles!");
// }
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 55af396c4265bf6439d45f04c39a42f3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,162 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
public class SimonSaysPuzzle : MonoBehaviour
{
private Dictionary<Button, Image> buttonPairs = new Dictionary<Button, Image>();
private Dictionary<Button, Color> buttonColors = new Dictionary<Button, Color>();
private List<Button> buttonSequence = new List<Button>();
private List<Button> clickedButtons = new List<Button>();
public int currentButtonSequence = 0;
public int buttonSequenceCount = 10;
public GameObject startButton;
public GameObject completeScreen;
public GameObject failedScreen;
[SerializeField] SimonSaysGameManager gameManager = null;
private bool isDoingPuzzle;
private Button clickedButton = null;
private void Awake()
{
foreach(var button in GetComponentsInChildren<Button>())
{
if (button.name == "Start")
continue;
var image = button.GetComponent<Image>();
buttonPairs.Add(button, image);
image.color = Color.black;
buttonColors.Add(button, new Color(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f),
UnityEngine.Random.Range(0f, 1f)));
button.onClick.AddListener(() => StartCoroutine(ButtonClicked(button)));
}
}
private IEnumerator ButtonClicked(Button button)
{
if (!isDoingPuzzle)
yield break;
if(buttonColors.TryGetValue(button, out var color))
{
clickedButton = button;
buttonPairs[button].color = color;
yield return new WaitForSeconds(0.25f);
buttonPairs[button].color = Color.black;
}
}
public void StartPuzzle()
{
startButton.SetActive(false);
ResetColors();
isDoingPuzzle = true;
for (int i = 0; i < buttonSequenceCount; i++)
{
var randomButton = buttonPairs.ElementAt(UnityEngine.Random.Range(0, buttonPairs.Count));
buttonSequence.Add(randomButton.Key);
}
StartCoroutine(DoPuzzleLoop());
}
private IEnumerator DoPuzzleLoop()
{
while(isDoingPuzzle)
{
if(currentButtonSequence > buttonSequence.Count)
{
//game complete
print("Game Complete!");
gameManager.gameState = SGameState.Win;
completeScreen.SetActive(true);
//EndPuzzle();
yield break;
}
for (int i = 0; i < currentButtonSequence; i++)
{
buttonPairs.TryGetValue(buttonSequence[i], out var image);
image.color = buttonColors[buttonSequence[i]];
yield return new WaitForSeconds(0.25f);
image.color = Color.black;
yield return new WaitForSeconds(0.25f);
}
currentButtonSequence++;
clickedButtons.Clear();
while(clickedButtons.Count != currentButtonSequence - 1)
{
yield return new WaitUntil(() => clickedButton != null);
if (clickedButton != buttonSequence[clickedButtons.Count])
{
print("Game Failed!");
failedScreen.SetActive(true);
gameManager.gameState = SGameState.Lose;
EndPuzzle();
}
clickedButtons.Add(clickedButton);
clickedButton = null;
}
yield return new WaitForSeconds(1f);
}
}
private void ResetColors()
{
foreach (var pair in buttonPairs) {
var image = pair.Value;
image.color = Color.black;
}
}
public void EndPuzzle()
{
isDoingPuzzle = false;
buttonSequence.Clear();
clickedButtons.Clear();
currentButtonSequence = 0;
clickedButton = null;
foreach (var pair in buttonPairs)
{
pair.Value.color = Color.black;
buttonColors[pair.Key] = new Color(UnityEngine.Random.Range(0f, 1f), UnityEngine.Random.Range(0f, 1f),
UnityEngine.Random.Range(0f, 1f));
}
startButton.SetActive(true);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 6115ac0b375ead644879f3d1a5a0c10a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 MiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: a93e077ba35a67049b715c183af5e346
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@ -0,0 +1,123 @@
fileFormatVersion: 2
guid: cab34039aff3c554fa717c34c6850223
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMasterTextureLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 0
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: 0
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 0
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID: 5e97eb03825dee720800000000000000
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

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

File diff suppressed because it is too large Load Diff

View File

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

View File

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

View File

@ -0,0 +1,213 @@
using System;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
using TMPro;
using System.Text.RegularExpressions;
using UnityEngine.UI;
public enum WGameState
{
Uninitialized,
Playing,
Win,
Lose
}
public class WordPuzzle : MonoBehaviour
{
private TMP_Text[] allLetterTexts;
private List<TMP_Text> usedLetterTexts = new List<TMP_Text>();
private List<string> words = new List<string>();
private int currentCount;
private int currentSubmit = 0;
public GameObject congratulations;
public GameObject retry;
public TMP_Text retryText;
public Color inWordColor = Color.yellow;
public Color perfectMatchColor = Color.green;
public Color wrongColor = Color.red;
public string currentWord = string.Empty;
public WGameState gameState = WGameState.Uninitialized;
[SerializeField] private TextAsset textAsset = null;
private void Awake()
{
allLetterTexts = GetComponentsInChildren<TMP_Text>();
foreach (var text in allLetterTexts)
{
text.text = string.Empty;
}
// var textAsset = Resources.Load<TextAsset>("words_alpha");
words = Regex.Split(textAsset.text, Environment.NewLine).ToList();
if (currentWord == string.Empty) {
currentWord = words[UnityEngine.Random.Range(0, words.Count)];
Debug.Log("Choose a random word: " + currentWord);
}
gameState = WGameState.Uninitialized;
}
private void HandleInput()
{
// Debug.Log("HandleInput");
foreach (char c in Input.inputString)
{
if (c == '\b')
{
RemoveChar();
}
else if ((c == '\n') || (c == '\r'))
{
SubmitButtonClick();
}
else if (char.IsLetter(c))
{
DoKeyPress(char.ToLower(c));
}
}
}
private void Update()
{
if (gameState == WGameState.Playing)
{
HandleInput();
}
}
public void SetGameState(WGameState state)
{
gameState = state;
}
public void StartGame(string overrideWord)
{
currentWord = overrideWord;
ResetPuzzle();
}
private void RemoveChar()
{
print("remove");
if (!usedLetterTexts.Any() || currentCount <= 0)
return;
usedLetterTexts.Last().text = string.Empty;
usedLetterTexts.RemoveAt(usedLetterTexts.Count - 1);
currentCount--;
}
private void DoKeyPress(char character)
{
print(character);
if (usedLetterTexts.Count >= allLetterTexts.Length || currentCount >= 5)
return;
var currentText = allLetterTexts[usedLetterTexts.Count];
currentText.text = character.ToString();
usedLetterTexts.Add(currentText);
currentCount++;
}
private void SubmitButtonClick()
{
print("submit");
if (currentCount != 5)
return;
var submittedWord = string.Empty;
int ii = 0;
for (int i = 0 + (currentSubmit * 5); i < usedLetterTexts.Count; i++)
{
TMP_Text texts = usedLetterTexts[i];
var textsChar = char.Parse(texts.text);
submittedWord += textsChar;
texts.color = wrongColor;
if (currentWord.Contains(textsChar))
{
texts.color = inWordColor;
if (textsChar == currentWord[ii])
texts.color = perfectMatchColor;
}
ii++;
}
print(submittedWord);
if (words.Contains(submittedWord))
{
if(submittedWord == currentWord)
{
congratulations.SetActive(true);
print("success!");
SetGameState(WGameState.Win);
return;
}
print("reset count");
currentSubmit++;
currentCount = 0;
}
else
{
print("fail!");
for (int i = 0 + (currentSubmit * 5); i < usedLetterTexts.Count; i++)
{
TMP_Text texts = usedLetterTexts[i];
texts.color = Color.white;
}
}
if(currentSubmit == 6)
{
retry.SetActive(true);
retryText.text = currentWord;
SetGameState(WGameState.Lose);
}
}
public void ResetPuzzle()
{
allLetterTexts = GetComponentsInChildren<TMP_Text>();
retry.SetActive(false);
congratulations.SetActive(false);
usedLetterTexts.Clear();
foreach (var texts in allLetterTexts)
{
texts.text = string.Empty;
texts.color = Color.white;
}
currentSubmit = 0;
currentCount = 0;
// currentWord = words[UnityEngine.Random.Range(0, words.Count)];
if (currentWord == string.Empty) {
currentWord = words[UnityEngine.Random.Range(0, words.Count)];
Debug.Log("Choose a random word: " + currentWord);
}
SetGameState(WGameState.Playing);
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 32190bfb1fb7f6343a963e38ff722cb8
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

File diff suppressed because it is too large Load Diff

View File

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

File diff suppressed because it is too large Load Diff

View File

@ -90,7 +90,7 @@ public class LightSwitchInteraction : MonoBehaviour
}
if (myDoor != null)
{
Invoke("PlayDoorAnimation", 16.0f);
Invoke("PlayDoorAnimation", 1.0f);
}
}

View File

@ -12,18 +12,25 @@ public class DoorInteraction : MonoBehaviour
[SerializeField] private float interactionDistance = 2f;
[SerializeField] private TabletController tabletController = null;
[SerializeField] private TabletScript tabletScript = null;
[SerializeField] private ControlScript controlScript = null;
// PUZZLES CONFIGS
// Mines puzzle
[SerializeField] private int bombs = 9;
[SerializeField] private int gridSize = 11;
[SerializeField] private int timeLimitSeconds = 10;
// Word puzzle
[SerializeField] private string overrideWord = string.Empty;
[SerializeField] private TextMeshProUGUI targetDoorText = null;
[SerializeField] private UnityEngine.UI.Image tabletIcon = null;
[SerializeField] private TextMeshProUGUI closeTabletPrompt = null;
public TabletScreen doorPuzzleType = TabletScreen.Mines;
public TMP_Text interactionPrompt;
// private bool isTabletOpen = false;
@ -98,12 +105,12 @@ public class DoorInteraction : MonoBehaviour
if (targetDoorText != null)
{
targetDoorText.text = "Target Door: " + animationFile.Substring(animationFile.Length - 3);
Debug.Log("Target Door: " + animationFile.Substring(animationFile.Length - 3));
// Debug.Log("Target Door: " + animationFile.Substring(animationFile.Length - 3));
}
// if player is not on main menu and game is not initialized and puzzle has not been started we start the puzzle for this door
if (!tabletController.isOnMainMenu && controlScript.GameState == ControlScript.EGameState.Uninitialized && !startedPuzzle)
if (!tabletController.isOnMainMenu && controlScript.GameState == EGameState.Uninitialized && !startedPuzzle)
{
StartPuzzle();
StartPuzzle(doorPuzzleType);
startedPuzzle = true;
}
}
@ -147,7 +154,7 @@ public class DoorInteraction : MonoBehaviour
return false;
}
private void StartPuzzle()
private void StartPuzzle(TabletScreen screen)
{
if (tabletController == null)
{
@ -156,28 +163,39 @@ public class DoorInteraction : MonoBehaviour
}
controlScript.GridSizeX = gridSize;
controlScript.GridSizeY = gridSize;
controlScript.TotalMines = bombs;
controlScript.timeLimitSeconds = timeLimitSeconds;
Debug.Log("Starting puzzle");
controlScript.Restart();
// get function to call for the set screen
switch (screen)
{
case TabletScreen.Word:
tabletScript.SetScreenWord(overrideWord);
break;
case TabletScreen.Mines:
tabletScript.SetScreenMines(gridSize, bombs, timeLimitSeconds);
break;
case TabletScreen.MainMenu:
tabletScript.SetScreen(TabletScreen.MainMenu);
break;
case TabletScreen.SimonSays:
tabletScript.SetScreenSimonSays();
break;
}
StartCoroutine(WaitForPuzzleCompletion());
}
private IEnumerator WaitForPuzzleCompletion()
{
yield return new WaitUntil(() => controlScript.GameState == ControlScript.EGameState.Win);
yield return new WaitUntil(() => tabletScript.gameState == PuzzleGameState.Win);
yield return new WaitForSeconds(1.0f);
controlScript.GameState = ControlScript.EGameState.Uninitialized;
// set prompt on screen to close tablet
closeTabletPrompt.enabled = true;
myDoor.Play(animationFile, 0, 0.0f);
startedPuzzle = false;
// TextPopUp("Press T to Close tablet.");
tabletScript.gameState = PuzzleGameState.Uninitialized; // reset the game state to default state
gameObject.SetActive(false);
}

View File

@ -16,7 +16,7 @@ public class TabletController : MonoBehaviour
[SerializeField] public TextMeshProUGUI closeTabletPrompt;
public bool isShowing = false;
private bool isMoving = false;
// private bool isMoving = false;
public void setIsOnMainMenu(bool isOnMainMenu)
{
@ -49,6 +49,7 @@ public class TabletController : MonoBehaviour
if (mouseLook != null)
{
mouseLook.cursorInputForLook = false;
mouseLook.moveLocked = true;
}
// unlock cursor
Cursor.lockState = CursorLockMode.None;
@ -71,6 +72,7 @@ public class TabletController : MonoBehaviour
if (mouseLook != null)
{
mouseLook.cursorInputForLook = true;
mouseLook.moveLocked = false;
}
}
isShowing = !isShowing; // Toggle state

View File

@ -20,9 +20,16 @@ namespace StarterAssets
public bool cursorLocked = true;
public bool cursorInputForLook = true;
[Header("Movement Lock Settings")]
public bool moveLocked = false;
#if ENABLE_INPUT_SYSTEM
public void OnMove(InputValue value)
{
if(moveLocked)
{
return;
}
MoveInput(value.Get<Vector2>());
}

View File

@ -1,5 +1,20 @@
using TMPro;
using UnityEngine;
using System.Collections;
using Unity.VisualScripting;
public enum TabletScreen {
Word,
Mines,
SimonSays,
MainMenu
}
public enum PuzzleGameState {
Uninitialized,
Playing,
Win,
Lose
}
public class TabletScript : MonoBehaviour
{
@ -7,23 +22,157 @@ public class TabletScript : MonoBehaviour
public bool puzzleComplete = false;
[SerializeField] private TextMeshProUGUI targetDoorText = null;
[SerializeField] private TextMeshProUGUI targetDoorTimeLimit = null;
void Start()
{
}
// objects containing the interactions for the different puzzles
[SerializeField] private GameObject minesPuzzleSheet = null;
[SerializeField] private GameObject wordPuzzleSheet = null;
[SerializeField] private GameObject simonSaysPuzzleSheet = null;
[SerializeField] private GameObject mainMenuSheet = null;
public PuzzleGameState gameState = PuzzleGameState.Uninitialized;
public TabletScreen currentScreen = TabletScreen.MainMenu;
// Update is called once per frame
void Update()
{
// if user press enter
if (Input.GetKeyDown(KeyCode.Return))
{
// set puzzleComplete to true
puzzleComplete = true;
}
// void Update()
// {
// // if user press enter
// if (Input.GetKeyDown(KeyCode.Return))
// {
// // set puzzleComplete to true
// puzzleComplete = true;
// }
// }
// control script for each puzzle
[SerializeField] private ControlScript minesControlScript = null;
[SerializeField] private WordPuzzle wordPuzzleScript = null;
[SerializeField] private SimonSaysGameManager simonSaysGameManager = null;
public void Awake()
{
SetScreen(TabletScreen.MainMenu);
}
public void SetScreen(TabletScreen screen)
{
currentScreen = screen;
switch (screen)
{
case TabletScreen.Word:
wordPuzzleSheet.SetActive(true);
minesPuzzleSheet.SetActive(false);
simonSaysPuzzleSheet.SetActive(false);
break;
case TabletScreen.Mines:
wordPuzzleSheet.SetActive(false);
minesPuzzleSheet.SetActive(true);
simonSaysPuzzleSheet.SetActive(false);
break;
case TabletScreen.MainMenu:
wordPuzzleSheet.SetActive(false);
minesPuzzleSheet.SetActive(false);
simonSaysPuzzleSheet.SetActive(false);
break;
case TabletScreen.SimonSays:
wordPuzzleSheet.SetActive(false);
minesPuzzleSheet.SetActive(false);
simonSaysPuzzleSheet.SetActive(true);
break;
}
}
public void SetScreenMines(int gridSize, int bombs, int timeLimitSeconds)
{
mainMenuSheet.SetActive(false);
wordPuzzleSheet.SetActive(false);
simonSaysPuzzleSheet.SetActive(false);
minesPuzzleSheet.SetActive(true);
minesControlScript.GridSizeX = gridSize;
minesControlScript.GridSizeY = gridSize;
minesControlScript.TotalMines = bombs;
minesControlScript.timeLimitSeconds = timeLimitSeconds;
minesControlScript.Restart();
StartCoroutine(WaitForPuzzleCompletionMines());
}
private IEnumerator WaitForPuzzleCompletionMines()
{
Debug.Log("Waiting for puzzle completion");
yield return new WaitUntil(() => minesControlScript.GameState == EGameState.Win);
yield return new WaitForSeconds(1.0f);
minesControlScript.GameState = EGameState.Uninitialized; // reset the game state to default state
gameState = PuzzleGameState.Win;
SetScreen(TabletScreen.MainMenu);
}
public void SetScreenWord(string word)
{
wordPuzzleSheet.SetActive(true);
wordPuzzleScript.StartGame(word);
mainMenuSheet.SetActive(false);
minesPuzzleSheet.SetActive(false);
simonSaysPuzzleSheet.SetActive(false);
StartCoroutine(WaitForPuzzleCompletionWord());
}
private IEnumerator WaitForPuzzleCompletionWord()
{
yield return new WaitUntil(() => wordPuzzleScript.gameState == WGameState.Win);
yield return new WaitForSeconds(1.0f);
wordPuzzleScript.gameState = WGameState.Uninitialized; // reset the game state to default state
wordPuzzleScript.ResetPuzzle();
gameState = PuzzleGameState.Win;
SetScreen(TabletScreen.MainMenu);
}
public void SetScreenSimonSays()
{
simonSaysPuzzleSheet.SetActive(true);
simonSaysGameManager.currentPuzzle = 0;
simonSaysGameManager.gameState = SGameState.Uninitialized;
mainMenuSheet.SetActive(false);
minesPuzzleSheet.SetActive(false);
wordPuzzleSheet.SetActive(false);
StartCoroutine(WaitForPuzzleCompletionSimonSays());
}
private IEnumerator WaitForPuzzleCompletionSimonSays()
{
yield return new WaitUntil(() => simonSaysGameManager.gameState == SGameState.Win);
yield return new WaitForSeconds(1.0f);
simonSaysGameManager.gameState = SGameState.Uninitialized; // reset the game state to default state
gameState = PuzzleGameState.Win;
SetScreen(TabletScreen.MainMenu);
}
public void SetGameState(PuzzleGameState state)
{
gameState = state;
}
public void SetDoorTargetText(string text)
{
targetDoorText.text = text;