Bug Fixes: AI.

This commit is contained in:
Ashby Issac 2026-01-28 20:57:35 +05:30
parent 1084e5dd08
commit 67b6da28c0
44 changed files with 1758 additions and 55 deletions

File diff suppressed because one or more lines are too long

8
Assets/Project.meta Normal file
View File

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

8
Assets/Project/Arts.meta Normal file
View File

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

View File

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

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: e7782384aad96034fb96a34c61cd080d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 152 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 4e15ca5ca6770244786eceb0ce29f7cb
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 5e9498e82f764864cbcaf2b28423511d
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 173 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 8cae2bfdbf0134241bb325816019d271
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 748 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 55b516b501be6544b9a6b8a65f827d1f
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
mipmaps:
mipMapMode: 0
enableMipMap: 1
sRGBTexture: 0
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
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 1
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 115 KiB

View File

@ -0,0 +1,96 @@
fileFormatVersion: 2
guid: 2331d5e483ac1274fb75c9a2ec577d91
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 11
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
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 0
wrapV: 0
wrapW: 0
nPOTScale: 1
lightmap: 0
compressionQuality: 50
spriteMode: 0
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: 0
spriteTessellationDetail: -1
textureType: 0
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 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
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
spritePackingTag:
pSDRemoveMatte: 0
pSDShowRemoveMatteOption: 0
userData:
assetBundleName:
assetBundleVariant:

View File

@ -0,0 +1,123 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: d6 Plastic Glossy Pure write 2k
m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0}
m_ValidKeywords:
- _METALLICGLOSSMAP
- _NORMALMAP
- _PARALLAXMAP
m_InvalidKeywords:
- _SPECGLOSSMAP
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap: {}
disabledShaderPasses: []
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BumpMap:
m_Texture: {fileID: 2800000, guid: 55b516b501be6544b9a6b8a65f827d1f, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 2800000, guid: 4e15ca5ca6770244786eceb0ce29f7cb, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 2800000, guid: 8cae2bfdbf0134241bb325816019d271, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 2800000, guid: e7782384aad96034fb96a34c61cd080d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 2800000, guid: 5e9498e82f764864cbcaf2b28423511d, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 2800000, guid: 2331d5e483ac1274fb75c9a2ec577d91, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _BumpScale: 1
- _Cutoff: 0.5
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _GlossMapScale: 1
- _Glossiness: 0.5
- _GlossyReflections: 1
- _Metallic: 0
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _QueueControl: 0
- _QueueOffset: 0
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _UVSec: 0
- _UseAoMap: 1
- _UseColorMap: 1
- _UseEmissiveMap: 0
- _UseMetallicMap: 1
- _UseNormalMap: 1
- _UseRoughnessMap: 1
- _ZWrite: 1
m_Colors:
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _UvOffset: {r: 0, g: 0, b: 0, a: 0}
- _UvTiling: {r: 1, g: 1, b: 0, a: 0}
m_BuildTextureStacks: []
--- !u!114 &2133764184593704540
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 5

View File

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

View File

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

View File

@ -0,0 +1,14 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!134 &13400000
PhysicMaterial:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: DiceCollider
dynamicFriction: 0.6
staticFriction: 0.6
bounciness: 0
frictionCombine: 1
bounceCombine: 0

View File

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 293afd50062fb4522b881325912fdf45
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 13400000
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

Binary file not shown.

View File

@ -0,0 +1,102 @@
fileFormatVersion: 2
guid: 31fc8cbe82b70ba4ca86014d7df73c1d
ModelImporter:
serializedVersion: 20200
internalIDToNameTable: []
externalObjects: {}
materials:
materialImportMode: 2
materialName: 0
materialSearch: 1
materialLocation: 1
animations:
legacyGenerateAnimations: 4
bakeSimulation: 0
resampleCurves: 1
optimizeGameObjects: 0
motionNodeName:
rigImportErrors:
rigImportWarnings:
animationImportErrors:
animationImportWarnings:
animationRetargetingWarnings:
animationDoRetargetingWarnings: 0
importAnimatedCustomProperties: 0
importConstraints: 0
animationCompression: 1
animationRotationError: 0.5
animationPositionError: 0.5
animationScaleError: 0.5
animationWrapMode: 0
extraExposedTransformPaths: []
extraUserProperties: []
clipAnimations: []
isReadable: 0
meshes:
lODScreenPercentages: []
globalScale: 1
meshCompression: 0
addColliders: 0
useSRGBMaterialColor: 1
sortHierarchyByName: 1
importVisibility: 1
importBlendShapes: 1
importCameras: 1
importLights: 1
fileIdsGeneration: 2
swapUVChannels: 0
generateSecondaryUV: 0
useFileUnits: 1
keepQuads: 0
weldVertices: 1
bakeAxisConversion: 0
preserveHierarchy: 0
skinWeightsMode: 0
maxBonesPerVertex: 4
minBoneWeight: 0.001
meshOptimizationFlags: -1
indexFormat: 0
secondaryUVAngleDistortion: 8
secondaryUVAreaDistortion: 15.000001
secondaryUVHardAngle: 88
secondaryUVMarginMethod: 1
secondaryUVMinLightmapResolution: 40
secondaryUVMinObjectScale: 1
secondaryUVPackMargin: 4
useFileScale: 1
tangentSpace:
normalSmoothAngle: 60
normalImportMode: 0
tangentImportMode: 3
normalCalculationMode: 4
legacyComputeAllNormalsFromSmoothingGroupsWhenMeshHasBlendShapes: 0
blendShapeNormalImportMode: 1
normalSmoothingSource: 0
referencedClips: []
importAnimation: 1
humanDescription:
serializedVersion: 3
human: []
skeleton: []
armTwist: 0.5
foreArmTwist: 0.5
upperLegTwist: 0.5
legTwist: 0.5
armStretch: 0.05
legStretch: 0.05
feetSpacing: 0
globalScale: 1
rootMotionBoneName:
hasTranslationDoF: 0
hasExtraRoot: 0
skeletonHasParents: 1
lastHumanDescriptionAvatarSource: {instanceID: 0}
autoGenerateAvatarMappingIfUnspecified: 1
animationType: 2
humanoidOversampling: 1
avatarSetup: 0
addHumanoidExtraRootOnlyWhenUsingAvatar: 1
additionalBone: 0
userData:
assetBundleName:
assetBundleVariant:

View File

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

View File

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

View File

@ -0,0 +1,500 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &1804238606659730438
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238606659730489}
- component: {fileID: 1804238606659730492}
- component: {fileID: 1804238606659730493}
- component: {fileID: 1804238606659730490}
- component: {fileID: 1804238606659730491}
- component: {fileID: 1804238606659730488}
m_Layer: 0
m_Name: Dice
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238606659730489
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606659730438}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -10.33, y: 1.1399994, z: -4.05}
m_LocalScale: {x: 0.28964496, y: 0.28964496, z: 0.28964496}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1804238608354165696}
- {fileID: 1804238607675548627}
- {fileID: 1804238606798486280}
- {fileID: 1804238608273546101}
- {fileID: 1804238608088587974}
- {fileID: 1804238606911964793}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!33 &1804238606659730492
MeshFilter:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606659730438}
m_Mesh: {fileID: -7906386799813675487, guid: 31fc8cbe82b70ba4ca86014d7df73c1d, type: 3}
--- !u!23 &1804238606659730493
MeshRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606659730438}
m_Enabled: 1
m_CastShadows: 1
m_ReceiveShadows: 1
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 2
m_RayTraceProcedural: 0
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: c808fc6cf4b97d5449ea878605dc5335, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 3
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_AdditionalVertexStreams: {fileID: 0}
--- !u!65 &1804238606659730490
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606659730438}
m_Material: {fileID: 13400000, guid: 293afd50062fb4522b881325912fdf45, type: 2}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 1.4000001, y: 1.4000001, z: 1.4000001}
m_Center: {x: 0, y: 0.00000023841858, z: 0.0000019073486}
--- !u!54 &1804238606659730491
Rigidbody:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606659730438}
serializedVersion: 2
m_Mass: 1
m_Drag: 0
m_AngularDrag: 0.05
m_UseGravity: 1
m_IsKinematic: 0
m_Interpolate: 0
m_Constraints: 0
m_CollisionDetection: 0
--- !u!114 &1804238606659730488
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606659730438}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e700eca2e67354017b67213c95bbee09, type: 3}
m_Name:
m_EditorClassIdentifier:
diceSides:
- {fileID: 1804238608354165699}
- {fileID: 1804238607675548626}
- {fileID: 1804238606798486283}
- {fileID: 1804238608273546100}
- {fileID: 1804238608088588025}
- {fileID: 1804238606911964792}
sideValueTime: 3
baseSpinForce: 900
sideForce: 0.18
liftForce: 0.1
--- !u!1 &1804238606798486281
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238606798486280}
- component: {fileID: 1804238606798486282}
- component: {fileID: 1804238606798486283}
m_Layer: 0
m_Name: Side 3
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238606798486280
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606798486281}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: -0.6776853}
m_LocalScale: {x: 1.3774108, y: 1.3774108, z: 1.3774108}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804238606659730489}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1804238606798486282
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606798486281}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.14
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1804238606798486283
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606798486281}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4672696a6127d453e8b9f17c34ab313f, type: 3}
m_Name:
m_EditorClassIdentifier:
sideValue: 1
--- !u!1 &1804238606911964742
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238606911964793}
- component: {fileID: 1804238606911964795}
- component: {fileID: 1804238606911964792}
m_Layer: 0
m_Name: Side 6
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238606911964793
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606911964742}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: -0.6597797, z: 0}
m_LocalScale: {x: 1.3774105, y: 1.3774105, z: 1.3774105}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804238606659730489}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1804238606911964795
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606911964742}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.14
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1804238606911964792
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238606911964742}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4672696a6127d453e8b9f17c34ab313f, type: 3}
m_Name:
m_EditorClassIdentifier:
sideValue: 2
--- !u!1 &1804238607675548624
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238607675548627}
- component: {fileID: 1804238607675548629}
- component: {fileID: 1804238607675548626}
m_Layer: 0
m_Name: Side 2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238607675548627
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238607675548624}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0.77961403, y: 0, z: 0}
m_LocalScale: {x: 1.3774108, y: 1.3774108, z: 1.3774108}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804238606659730489}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1804238607675548629
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238607675548624}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.14
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1804238607675548626
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238607675548624}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4672696a6127d453e8b9f17c34ab313f, type: 3}
m_Name:
m_EditorClassIdentifier:
sideValue: 3
--- !u!1 &1804238608088587975
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238608088587974}
- component: {fileID: 1804238608088588024}
- component: {fileID: 1804238608088588025}
m_Layer: 0
m_Name: Side 5
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238608088587974
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608088587975}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.65840244, y: 0, z: 0.17079844}
m_LocalScale: {x: 1.3774108, y: 1.3774108, z: 1.3774108}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804238606659730489}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1804238608088588024
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608088587975}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.14
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1804238608088588025
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608088587975}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4672696a6127d453e8b9f17c34ab313f, type: 3}
m_Name:
m_EditorClassIdentifier:
sideValue: 4
--- !u!1 &1804238608273546098
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238608273546101}
- component: {fileID: 1804238608273546103}
- component: {fileID: 1804238608273546100}
m_Layer: 0
m_Name: Side 4
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238608273546101
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608273546098}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0.76170826}
m_LocalScale: {x: 1.3774108, y: 1.3774108, z: 1.3774108}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804238606659730489}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1804238608273546103
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608273546098}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.14
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1804238608273546100
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608273546098}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4672696a6127d453e8b9f17c34ab313f, type: 3}
m_Name:
m_EditorClassIdentifier:
sideValue: 6
--- !u!1 &1804238608354165697
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1804238608354165696}
- component: {fileID: 1804238608354165698}
- component: {fileID: 1804238608354165699}
m_Layer: 0
m_Name: Side 1
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1804238608354165696
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608354165697}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0.7424241, z: 0}
m_LocalScale: {x: 1.3774108, y: 1.3774108, z: 1.3774108}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 1804238606659730489}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!135 &1804238608354165698
SphereCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608354165697}
m_Material: {fileID: 0}
m_IsTrigger: 1
m_Enabled: 1
serializedVersion: 2
m_Radius: 0.14
m_Center: {x: 0, y: 0, z: 0}
--- !u!114 &1804238608354165699
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1804238608354165697}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4672696a6127d453e8b9f17c34ab313f, type: 3}
m_Name:
m_EditorClassIdentifier:
sideValue: 5

View File

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

View File

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

View File

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

View File

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

View File

@ -0,0 +1,97 @@
using System.Collections;
using UnityEngine;
public class Dice : MonoBehaviour
{
private Rigidbody rb;
private bool rolling;
[SerializeField] private DiceSide[] diceSides;
[SerializeField] private float sideValueTime = 1.2f;
[Header("Physics Randomness")]
[SerializeField] private float baseSpinForce = 900f;
[SerializeField] private float sideForce = 0.18f;
[SerializeField] private float liftForce = 0.1f;
// private BoardController boardController;
// public void Init(BoardController boardController)
// {
// this.boardController = boardController;
// transform.localScale = Vector3.one * 0.05f;
// transform.rotation = Random.rotation;
// }
void Awake()
{
rb = GetComponent<Rigidbody>();
rb.useGravity = false;
}
public void Roll()
{
if (!rolling)
StartCoroutine(RollRoutine());
}
IEnumerator RollRoutine()
{
rolling = true;
// 🔥 MICRO DELAY → breaks physics sync between dice
yield return new WaitForSeconds(Random.Range(0.01f, 0.06f));
rb.useGravity = true;
// 🔥 PER-DICE FORCE MULTIPLIER
float spinMultiplier = Random.Range(0.8f, 1.25f);
// 🔹 RANDOM TORQUE
rb.AddTorque(
Random.Range(-baseSpinForce, baseSpinForce) * spinMultiplier,
Random.Range(-baseSpinForce, baseSpinForce) * spinMultiplier,
Random.Range(-baseSpinForce, baseSpinForce) * spinMultiplier,
ForceMode.Impulse
);
// 🔹 RANDOM SIDE FORCE
Vector3 sideDir = new Vector3(
Random.Range(-1f, 1f),
0f,
Random.Range(-1f, 1f)
).normalized;
rb.AddForce(sideDir * sideForce, ForceMode.Impulse);
// 🔹 SMALL UPWARD FORCE
rb.AddForce(Vector3.up * liftForce, ForceMode.Impulse);
yield return new WaitForSeconds(sideValueTime);
int value = GetDiceValue();
// if (boardController != null)
// boardController.OnDiceResult(value);
// else
// Debug.LogError("DiceSpawner NULL");
rolling = false;
}
int GetDiceValue()
{
foreach (DiceSide side in diceSides)
{
if (side.OnGround())
return side.sideValue;
}
return 1;
}
}

View File

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

View File

@ -0,0 +1,32 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DiceSide : MonoBehaviour
{
private bool onGround;
public int sideValue;
private void OnTriggerStay(Collider other)
{
if(other.tag == "Platform")
{
onGround = true;
}
}
private void OnTriggerExit(Collider other)
{
if(other.tag == "Platform")
{
onGround = false;
}
}
public bool OnGround()
{
return onGround;
}
}

View File

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

View File

@ -984,7 +984,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 102349499} m_GameObject: {fileID: 102349499}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 15.71, y: 2.29, z: -14.45} m_LocalPosition: {x: -10.82, y: 2.29, z: -14.45}
m_LocalScale: {x: 1, y: 1, z: 1} m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -9384,6 +9384,10 @@ PrefabInstance:
propertyPath: m_Name propertyPath: m_Name
value: Canvas (1) value: Canvas (1)
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481398316361, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_IsActive
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5608193481398316373, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481398316373, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_Pivot.x propertyPath: m_Pivot.x
value: 0 value: 0
@ -9474,107 +9478,107 @@ PrefabInstance:
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 487.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481653767712, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -150
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 0 value: 249
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 76
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 170.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193481756015688, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -62.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 0 value: 249
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 76
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 439.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482152499424, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -62.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_SizeDelta.x propertyPath: m_SizeDelta.x
value: 0 value: 249
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_SizeDelta.y propertyPath: m_SizeDelta.y
value: 0 value: 76
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 708.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193482463856113, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -62.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMax.y propertyPath: m_AnchorMax.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchorMin.y propertyPath: m_AnchorMin.y
value: 0 value: 1
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.x propertyPath: m_AnchoredPosition.x
value: 0 value: 162.5
objectReference: {fileID: 0} objectReference: {fileID: 0}
- target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3} - target: {fileID: 5608193483086908884, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
propertyPath: m_AnchoredPosition.y propertyPath: m_AnchoredPosition.y
value: 0 value: -150
objectReference: {fileID: 0} objectReference: {fileID: 0}
m_RemovedComponents: [] m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: a0f4457742bfd4c61bd436792af64064, type: 3} m_SourcePrefab: {fileID: 100100000, guid: a0f4457742bfd4c61bd436792af64064, type: 3}
@ -9787,7 +9791,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1013177410} m_GameObject: {fileID: 1013177410}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.61, y: 4.61, z: 0.63} m_LocalPosition: {x: 23.1, y: 4.61, z: 0.63}
m_LocalScale: {x: 2, y: 2, z: 2} m_LocalScale: {x: 2, y: 2, z: 2}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -11690,6 +11694,79 @@ Transform:
m_CorrespondingSourceObject: {fileID: 2960581183699728426, guid: bc986262997c641d9b5bcff22bd100c1, type: 3} m_CorrespondingSourceObject: {fileID: 2960581183699728426, guid: bc986262997c641d9b5bcff22bd100c1, type: 3}
m_PrefabInstance: {fileID: 1161887153} m_PrefabInstance: {fileID: 1161887153}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
--- !u!1001 &1171695604
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
m_TransformParent: {fileID: 0}
m_Modifications:
- target: {fileID: 1804238606659730438, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_Name
value: Dice (1)
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_RootOrder
value: 27
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalScale.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalScale.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalScale.z
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalPosition.x
value: 3.72
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalPosition.y
value: 4.78
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalPosition.z
value: -25.13
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1804238606659730489, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
propertyPath: m_ConstrainProportionsScale
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7a038d77e6ef54ce4b627bc5bf3ed17d, type: 3}
--- !u!1001 &1175256388 --- !u!1001 &1175256388
PrefabInstance: PrefabInstance:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View File

@ -20,6 +20,7 @@ public class PlayerGameData
public int endIndex; public int endIndex;
public Transform playersParent; public Transform playersParent;
public Dictionary<int, PlayerPawn> playerPawnsDict; public Dictionary<int, PlayerPawn> playerPawnsDict;
public int totalPawnsInHome = 0;
public int totalPawnsFinished = 0; public int totalPawnsFinished = 0;
} }
@ -41,6 +42,8 @@ public enum BotMove
public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
{ {
[SerializeField] private int diceValue = 0;
[SerializeField] private TextMeshProUGUI diceText; [SerializeField] private TextMeshProUGUI diceText;
[SerializeField] private Transform pointerDebug; [SerializeField] private Transform pointerDebug;
@ -86,8 +89,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
CanRollDice = true; CanRollDice = true;
// initialize the player list from UI. // initialize the player list from UI.
// InitPlayerTypesForLAN(null); // InitPlayerTypesForLAN(null);
InitPlayerTypesForBotMatch(PlayerType.Player1, 1); InitPlayerTypesForBotMatch(PlayerType.Player1, 3);
} }
// TODO :: Call when the UI selection is made and game starts // TODO :: Call when the UI selection is made and game starts
@ -200,6 +204,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
var pawn = playerPawnChild.GetComponent<PlayerPawn>(); var pawn = playerPawnChild.GetComponent<PlayerPawn>();
playerGameDatasDict[playerGameData.playerType].playerPawnsDict.Add(pawn.PlayerId, pawn); playerGameDatasDict[playerGameData.playerType].playerPawnsDict.Add(pawn.PlayerId, pawn);
} }
playerGameDatasDict[playerGameData.playerType].totalPawnsInHome = playerGameDatasDict[playerGameData.playerType].playerPawnsDict.Count;
} }
} }
@ -215,6 +221,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
public void RollDiceForPlayer(int rolledVal) public void RollDiceForPlayer(int rolledVal)
{ {
if (botTypesInGame.Contains(currentPlayerTypeTurn)) return;
OnDiceRolled(rolledVal); OnDiceRolled(rolledVal);
CheckForPlayerSwitching(); CheckForPlayerSwitching();
} }
@ -238,7 +246,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
{ {
Debug.Log($"CallTest: RollDiceForBot"); Debug.Log($"CallTest: RollDiceForBot");
OnDiceRolled(UnityEngine.Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1)); // OnDiceRolled(diceValue == 0 ? UnityEngine.Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1) : diceValue);
OnDiceRolled(diceValue == 0 ? UnityEngine.Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1) : diceValue);
SelectPawnFromBotBase(); SelectPawnFromBotBase();
@ -265,9 +274,15 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
Debug.Log($"SelectPawnFromBotBase: availPlayers.Count(): {availPlayers.Count()}, CanRollDiceAgain: {CanRollDiceAgain}"); Debug.Log($"SelectPawnFromBotBase: availPlayers.Count(): {availPlayers.Count()}, CanRollDiceAgain: {CanRollDiceAgain}");
if (playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInHome == 0)
{
InitActivePlayers();
}
if (availPlayers.Count() < 1 && CanRollDiceAgain) // got a 6 roll value if (availPlayers.Count() < 1 && CanRollDiceAgain) // got a 6 roll value
{ {
pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.FirstOrDefault(pawn => pawn.GetPlayerState() == PlayerState.InHome); pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.FirstOrDefault(pawn => pawn.GetPlayerState() == PlayerState.InHome);
Debug.Log($"SelectedPawn: {pawn.name}");
OnPawnSelected(pawn); OnPawnSelected(pawn);
return; return;
@ -290,6 +305,11 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
int lastIndex = tilesManager.GetGeneralTilesLength() - 1; int lastIndex = tilesManager.GetGeneralTilesLength() - 1;
int index = possibleLandingIndex > lastIndex ? (possibleLandingIndex - lastIndex) - 1 : possibleLandingIndex; int index = possibleLandingIndex > lastIndex ? (possibleLandingIndex - lastIndex) - 1 : possibleLandingIndex;
Tile possibleTileData = tilesManager.RetrieveTileBasedOnIndex(index); Tile possibleTileData = tilesManager.RetrieveTileBasedOnIndex(index);
Debug.Log($"AI playerPawn :: {playerPawn.name} :: state: {playerPawn.GetPlayerState()}, possibleLandingIndex: {possibleLandingIndex > playerGameDatasDict[currentPlayerTypeTurn].endIndex}");
Debug.Log($"AI playerPawn :: {playerPawn.name} :: possibleTileData.IsSafeZone: {possibleTileData.IsSafeZone}");
Debug.Log($"AI playerPawn :: {playerPawn.name} :: possibleTileData.PlayerPawn: {possibleTileData.PlayerPawn}");
if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath || possibleLandingIndex > playerGameDatasDict[currentPlayerTypeTurn].endIndex) if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath || possibleLandingIndex > playerGameDatasDict[currentPlayerTypeTurn].endIndex)
{ {
botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.FinishingPathMove; botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.FinishingPathMove;
@ -306,12 +326,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
} }
else else
{ {
Debug.Log($"AI playerPawn :: {playerPawn.name} :: normalMove");
botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.NormalMove; botPawnsDictForCurrentPlayer[playerPawn.PlayerId] = BotMove.NormalMove;
} }
} }
List<int> playerIds = new List<int>(); List<int> playerIds = new List<int>();
if (savedPlayerId != -1) if (savedPlayerId != -1 && playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict[savedPlayerId].CanSelectPlayerFromHome)
{ {
pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict[savedPlayerId]; // chances are when one of the character reaches towards the finishing point pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict[savedPlayerId]; // chances are when one of the character reaches towards the finishing point
} }
@ -323,25 +344,26 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
savedPlayerId = playerIds[UnityEngine.Random.Range(0, playerIds.Count)]; savedPlayerId = playerIds[UnityEngine.Random.Range(0, playerIds.Count)];
pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict[savedPlayerId]; pawn = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict[savedPlayerId];
Debug.Log($"Getting savedplayer id"); Debug.Log($"AI playerPawn :: {pawn.name} :: Getting savedplayer id");
} }
else if (botPawnsDictForCurrentPlayer.ContainsValue(BotMove.SafeMove)) else if (botPawnsDictForCurrentPlayer.ContainsValue(BotMove.SafeMove))
{ {
InitPawnBasedOnState(BotMove.SafeMove); InitPawnBasedOnState(BotMove.SafeMove);
Debug.Log($"Getting savedplayer id"); Debug.Log($"AI playerPawn :: {pawn.name} :: Getting savedplayer id");
} }
else if (botPawnsDictForCurrentPlayer.ContainsValue(BotMove.AttackMove)) else if (botPawnsDictForCurrentPlayer.ContainsValue(BotMove.AttackMove))
{ {
InitPawnBasedOnState(BotMove.AttackMove); InitPawnBasedOnState(BotMove.AttackMove);
Debug.Log($"Getting savedplayer id"); Debug.Log($"AI playerPawn :: {pawn.name} :: Getting savedplayer id");
} }
else if (botPawnsDictForCurrentPlayer.ContainsValue(BotMove.NormalMove)) else if (botPawnsDictForCurrentPlayer.ContainsValue(BotMove.NormalMove))
{ {
InitPawnBasedOnState(BotMove.NormalMove); InitPawnBasedOnState(BotMove.NormalMove);
Debug.Log($"Getting savedplayer id"); Debug.Log($"AI playerPawn :: {pawn.name} :: Getting savedplayer id");
} }
} }
Debug.Log($"AI playerPawn :: {pawn.name} :: SelectedPawn: {pawn.name}");
OnPawnSelected(pawn); OnPawnSelected(pawn);
void InitPawnBasedOnState(BotMove botMove) void InitPawnBasedOnState(BotMove botMove)
@ -383,6 +405,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
Debug.Log($"Tile Index :: LUDO :: rolledVal: {rolledVal} :: {currentPlayerTypeTurn}"); Debug.Log($"Tile Index :: LUDO :: rolledVal: {rolledVal} :: {currentPlayerTypeTurn}");
diceRolledValue = rolledVal; diceRolledValue = rolledVal;
diceText.text = $"{diceRolledValue}"; diceText.text = $"{diceRolledValue}";
availPlayers.Clear();
if (rolledVal == Ludo_3D_Constants.Max_Dice_Rolls) if (rolledVal == Ludo_3D_Constants.Max_Dice_Rolls)
{ {
@ -401,11 +424,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
else // if there are any other pawns that are in safe or moving state else // if there are any other pawns that are in safe or moving state
{ {
// for player's logic // for player's logic
availPlayers.Clear(); InitActivePlayers();
availPlayers = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.Select(pawn => pawn)
.Where(pawn => pawn.GetPlayerState() == PlayerState.InSafeZone ||
pawn.GetPlayerState() == PlayerState.Moving ||
pawn.GetPlayerState() == PlayerState.InFinishingPath).ToList();
Debug.Log($"availPlayers: {playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.Select(pawn => pawn).Where(pawn => pawn.GetPlayerState() == PlayerState.InHome).ToList().Count}"); Debug.Log($"availPlayers: {playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.Select(pawn => pawn).Where(pawn => pawn.GetPlayerState() == PlayerState.InHome).ToList().Count}");
int customAvailPlayers = availPlayers.Count(); int customAvailPlayers = availPlayers.Count();
@ -416,10 +435,11 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
Debug.Log($"## playerPawn.GetPlayerState(): {playerPawn.GetPlayerState()}"); Debug.Log($"## playerPawn.GetPlayerState(): {playerPawn.GetPlayerState()}");
if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath) if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath)
{ {
Debug.Log($"diceRolledValue: {diceRolledValue}, FinishingDataLen: {tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn)}, playerPawn.CurrentTileIndex: {playerPawn.CurrentTileIndex}");
if (diceRolledValue <= tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - (playerPawn.CurrentTileIndex + 1)) if (diceRolledValue <= tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - (playerPawn.CurrentTileIndex + 1))
{ {
playerPawn.SetPlayerSelectionState(true); playerPawn.SetPlayerSelectionState(true);
} }
else else
{ {
customAvailPlayers--; customAvailPlayers--;
@ -440,6 +460,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
Debug.Log($"CanRollDiceAgain: {CanRollDiceAgain}, canSwitchPlayer: {canSwitchPlayer}"); Debug.Log($"CanRollDiceAgain: {CanRollDiceAgain}, canSwitchPlayer: {canSwitchPlayer}");
} }
private void InitActivePlayers()
{
availPlayers = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.Select(pawn => pawn)
.Where(pawn => pawn.GetPlayerState() == PlayerState.InSafeZone ||
pawn.GetPlayerState() == PlayerState.Moving ||
pawn.GetPlayerState() == PlayerState.InFinishingPath).ToList();
}
private bool AreAllPawnsInFinishingPath() private bool AreAllPawnsInFinishingPath()
{ {
bool areAllPawnsInFinishingPath = false; bool areAllPawnsInFinishingPath = false;
@ -486,6 +514,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
GetAndInitPositionInsideSafeZone(playerPawn, targetTile), GetAndInitPositionInsideSafeZone(playerPawn, targetTile),
onComplete: () => onComplete: () =>
{ {
playerGameDatasDict[playerGameData.playerType].totalPawnsInHome--;
CanRollDice = true; CanRollDice = true;
UpdatePlayerState(playerPawn, PlayerState.InSafeZone); UpdatePlayerState(playerPawn, PlayerState.InSafeZone);
if (playerPawn.IsBotPlayer) if (playerPawn.IsBotPlayer)
@ -502,7 +532,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
int targetIdx = finishingPathIndex + diceRolledValue > tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ? int targetIdx = finishingPathIndex + diceRolledValue > tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ?
tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue; tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue;
Debug.Log($"TargetIdx: {targetIdx}"); Debug.Log($"TargetIdx: {targetIdx}, finishingPathIndex: {finishingPathIndex}");
MoveThroughFinishingPath(playerPawn, finishingPathIndex, targetIdx); MoveThroughFinishingPath(playerPawn, finishingPathIndex, targetIdx);
} }
else if (playerPawn.GetPlayerState() == PlayerState.InSafeZone || playerPawn.GetPlayerState() == PlayerState.Moving) else if (playerPawn.GetPlayerState() == PlayerState.InSafeZone || playerPawn.GetPlayerState() == PlayerState.Moving)
@ -647,7 +677,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
if (!nextTile.IsSafeZone) if (!nextTile.IsSafeZone)
{ {
Debug.Log($"nextTile.PlayerPawn: {nextTile.PlayerPawn}, {nextTile.transform.name}"); Debug.Log($"nextTile.PlayerPawn: {nextTile.PlayerPawn}, {nextTile.transform.name}");
if (nextTile.PlayerPawn != null) if (nextTile.PlayerPawn != null && playerPawn.PlayerType != nextTile.PlayerPawn.PlayerType)
{ {
// play animation for moving back to base. // play animation for moving back to base.
// TODO :: Send existing pawn back to base. // TODO :: Send existing pawn back to base.
@ -656,6 +686,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
.GetBasePlacementDataPosition(nextTile.PlayerPawn.PlayerId - 1).position; .GetBasePlacementDataPosition(nextTile.PlayerPawn.PlayerId - 1).position;
Debug.Log($"playerBasePos: {playerBasePos}"); Debug.Log($"playerBasePos: {playerBasePos}");
playerGameDatasDict[nextTile.PlayerPawn.PlayerType].totalPawnsInHome++;
nextTile.PlayerPawn.MoveBackToHome(playerBasePos); nextTile.PlayerPawn.MoveBackToHome(playerBasePos);
} }
@ -748,6 +779,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
} }
else else
{ {
Debug.Log($"CurrentTileIndex: {playerPawn.CurrentTileIndex} == lastIndex: {tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1}");
if (playerPawn.CurrentTileIndex == tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1) if (playerPawn.CurrentTileIndex == tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1)
{ {
UpdatePlayerState(playerPawn, PlayerState.HasFinished); UpdatePlayerState(playerPawn, PlayerState.HasFinished);
@ -766,6 +798,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
else else
{ {
CanRollDiceAgain = true; CanRollDiceAgain = true;
if (playerPawn.IsBotPlayer)
CheckDiceRollForBot(playerPawn);
} }
} }
else else

View File

@ -21,7 +21,10 @@ public class PlayerPawn : MonoBehaviour
{ {
[SerializeField] private PlayerState playerState; [SerializeField] private PlayerState playerState;
private bool canSelectPlayerFromHome; public bool CanSelectPlayerFromHome
{
get; private set;
}
private GameplayManager gameplayManager; private GameplayManager gameplayManager;
public int CurrentTileIndex public int CurrentTileIndex
@ -56,8 +59,8 @@ public class PlayerPawn : MonoBehaviour
public void SetPlayerSelectionState(bool state) public void SetPlayerSelectionState(bool state)
{ {
canSelectPlayerFromHome = state; CanSelectPlayerFromHome = state;
if (canSelectPlayerFromHome) if (CanSelectPlayerFromHome)
{ {
// TODO :: Play animation for selecting any of the players // TODO :: Play animation for selecting any of the players
} }
@ -93,7 +96,7 @@ public class PlayerPawn : MonoBehaviour
private void OnMouseDown() private void OnMouseDown()
{ {
if (IsBotPlayer || !canSelectPlayerFromHome) return; if (IsBotPlayer || !CanSelectPlayerFromHome) return;
SetGameplayManager(); SetGameplayManager();
gameplayManager.OnPawnSelected(this); gameplayManager.OnPawnSelected(this);

View File

@ -27,8 +27,8 @@ public class DiceRoller : MonoBehaviour
private void OnDiceRolled() private void OnDiceRolled()
{ {
int currentRolledVal = //Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1); int currentRolledVal = Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1);
diceTestValue != 0 ? diceTestValue : Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1); // diceTestValue != 0 ? diceTestValue : Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1);
inputManager.SetDiceRollValue(currentRolledVal); inputManager.SetDiceRollValue(currentRolledVal);
} }
} }

View File

@ -24,11 +24,13 @@ public class InputManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
public void Initialize() public void Initialize()
{ {
Debug.Log($"Initialize");
InterfaceManager.Instance?.RegisterInterface<InputManager>(this); InterfaceManager.Instance?.RegisterInterface<InputManager>(this);
} }
public void InitializeData() public void InitializeData()
{ {
Debug.Log($"InitializeData");
GameplayManager = InterfaceManager.Instance?.GetInterfaceInstance<GameplayManager>(); GameplayManager = InterfaceManager.Instance?.GetInterfaceInstance<GameplayManager>();
} }

View File

@ -9,6 +9,7 @@ public abstract class BootLoader : MonoBehaviour
protected virtual void Start() protected virtual void Start()
{ {
InterfaceManager.InitInstance(); InterfaceManager.InitInstance();
InitBootLoaders(); InitBootLoaders();

View File

@ -19,9 +19,9 @@ public class GameBootLoader : BootLoader
} }
} }
} }
protected override void InitializeData() protected override void InitializeData()
{ {
Debug.Log($"InitializeData: for loaders");
InitializeScriptablesData(); InitializeScriptablesData();
IDataLoader dataLoader = null; IDataLoader dataLoader = null;
@ -29,6 +29,7 @@ public class GameBootLoader : BootLoader
{ {
if (GetLoader<IDataLoader>(loader.transform, out dataLoader)) if (GetLoader<IDataLoader>(loader.transform, out dataLoader))
{ {
Debug.Log($"InitializeData: {loader.transform.name}");
dataLoader.InitializeData(); dataLoader.InitializeData();
} }
} }