Compare commits
13 Commits
0d1db5152e
...
d465293ad7
| Author | SHA1 | Date | |
|---|---|---|---|
| d465293ad7 | |||
| f26dd14108 | |||
| 565ec07c65 | |||
| 6291eaa46e | |||
| 29a97a53f6 | |||
| 10a6f27a2a | |||
| 8132704374 | |||
| 5afd8972fc | |||
| f93ba98ef3 | |||
| 828fecad57 | |||
| f9618cce71 | |||
| 2dfd5ac1c0 | |||
| 1269d7e6aa |
BIN
Assets/Artifacts/Sprites/Panel/freepik__talk__90404.png
Normal file
BIN
Assets/Artifacts/Sprites/Panel/freepik__talk__90404.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.4 MiB |
147
Assets/Artifacts/Sprites/Panel/freepik__talk__90404.png.meta
Normal file
147
Assets/Artifacts/Sprites/Panel/freepik__talk__90404.png.meta
Normal file
@ -0,0 +1,147 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2e91ac215ecbd49a083f05cb08fa714a
|
||||
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: 0
|
||||
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: iPhone
|
||||
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: WebGL
|
||||
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: Android
|
||||
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:
|
||||
@ -9,6 +9,7 @@ public class DiceView : MonoBehaviour, IBase
|
||||
|
||||
[SerializeField] private DiceSide[] diceSides;
|
||||
[SerializeField] private float sideValueTime = 1.2f;
|
||||
[SerializeField] private Vector3 startPos = new Vector3(0, 20, 0);
|
||||
|
||||
[Header("Physics Randomness")]
|
||||
[SerializeField] private float baseSpinForce = 900f;
|
||||
@ -22,7 +23,7 @@ public class DiceView : MonoBehaviour, IBase
|
||||
{
|
||||
rb = GetComponent<Rigidbody>();
|
||||
rb.useGravity = false;
|
||||
transform.localPosition = new Vector3(0, 20, 0);
|
||||
transform.localPosition = startPos;
|
||||
}
|
||||
|
||||
public void Roll(Action<int> onComplete, bool isBot)
|
||||
@ -96,7 +97,7 @@ public class DiceView : MonoBehaviour, IBase
|
||||
rb.useGravity = false;
|
||||
rb.velocity = Vector3.zero;
|
||||
rb.angularVelocity = Vector3.zero;
|
||||
transform.localPosition = new Vector3(0, 20, 0);
|
||||
transform.localPosition = startPos;
|
||||
rolling = false;
|
||||
|
||||
// Invoke(nameof(ResetEvent), 0.1f);
|
||||
|
||||
@ -870,7 +870,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -180}
|
||||
m_SizeDelta: {x: 250, y: 40}
|
||||
m_SizeDelta: {x: 250, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &4851974413369432202
|
||||
MonoBehaviour:
|
||||
@ -936,7 +936,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 250, y: 40}
|
||||
m_SizeDelta: {x: 250, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4851974413496445146
|
||||
CanvasRenderer:
|
||||
@ -1109,8 +1109,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4851974413524974102
|
||||
CanvasRenderer:
|
||||
@ -1142,8 +1142,8 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_text: "\u200B"
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontAsset: {fileID: 11400000, guid: 0482bbb9a4bbf48bdbd050f3c6b94af0, type: 2}
|
||||
m_sharedMaterial: {fileID: 5260989334135036006, guid: 0482bbb9a4bbf48bdbd050f3c6b94af0, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
@ -1245,8 +1245,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: -5.457, y: -4}
|
||||
m_SizeDelta: {x: -55.863, y: -13}
|
||||
m_AnchoredPosition: {x: -7.3499, y: -6.271304}
|
||||
m_SizeDelta: {x: -62.677, y: -29.6562}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &4851974413693272400
|
||||
MonoBehaviour:
|
||||
@ -1419,8 +1419,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4851974414219947399
|
||||
CanvasRenderer:
|
||||
@ -1452,8 +1452,8 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_text: Player 1
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontAsset: {fileID: 11400000, guid: 0482bbb9a4bbf48bdbd050f3c6b94af0, type: 2}
|
||||
m_sharedMaterial: {fileID: 5260989334135036006, guid: 0482bbb9a4bbf48bdbd050f3c6b94af0, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
@ -1948,7 +1948,7 @@ RectTransform:
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4851974414659941538}
|
||||
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
|
||||
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
|
||||
@ -1996,6 +1996,8 @@ MonoBehaviour:
|
||||
popupScalerType: 1
|
||||
canvasGroup: {fileID: 0}
|
||||
fadeDuration: 0
|
||||
playerBtnNormalColor: {r: 1, g: 1, b: 1, a: 0.78431374}
|
||||
playerBtnSelectedColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
twoPlayerBtn: {fileID: 4851974412826801781}
|
||||
threePlayerBtn: {fileID: 4851974413821998362}
|
||||
fourPlayerBtn: {fileID: 4851974412818057105}
|
||||
|
||||
@ -154,10 +154,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952317557671492}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316381639394
|
||||
CanvasRenderer:
|
||||
@ -222,7 +222,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -290,10 +290,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952318230211716}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316393416988
|
||||
CanvasRenderer:
|
||||
@ -358,7 +358,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -448,8 +448,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0.5}
|
||||
m_AnchorMax: {x: 0.5, y: 0.5}
|
||||
m_AnchoredPosition: {x: 0, y: -152}
|
||||
m_SizeDelta: {x: 560, y: 90.7286}
|
||||
m_AnchoredPosition: {x: 0, y: -136.96222}
|
||||
m_SizeDelta: {x: 560, y: 120.8041}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952316424197285
|
||||
MonoBehaviour:
|
||||
@ -566,11 +566,11 @@ MonoBehaviour:
|
||||
playerTwoPlaceholder: {fileID: 8065952316393416991}
|
||||
playerThreePlaceholder: {fileID: 8065952317200164017}
|
||||
playerFourPlaceholder: {fileID: 8065952318180437444}
|
||||
rows:
|
||||
- {fileID: 8065952316585861709}
|
||||
- {fileID: 8065952316852223932}
|
||||
- {fileID: 8065952317184179899}
|
||||
- {fileID: 8065952318019617086}
|
||||
inputFields:
|
||||
- {fileID: 8065952316677608095}
|
||||
- {fileID: 8065952316882128052}
|
||||
- {fileID: 8065952317181319405}
|
||||
- {fileID: 8065952316906327149}
|
||||
--- !u!1 &8065952316512053289
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -684,8 +684,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_AnchoredPosition: {x: -6.435402, y: -5.587503}
|
||||
m_SizeDelta: {x: -52.5552, y: -29.2317}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952316553408492
|
||||
MonoBehaviour:
|
||||
@ -738,7 +738,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 250, y: 30}
|
||||
m_SizeDelta: {x: 250, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952316585861699
|
||||
MonoBehaviour:
|
||||
@ -925,7 +925,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 210, y: 40}
|
||||
m_SizeDelta: {x: 210, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316677608093
|
||||
CanvasRenderer:
|
||||
@ -1099,7 +1099,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 30, y: 30}
|
||||
m_SizeDelta: {x: 40, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316688146259
|
||||
CanvasRenderer:
|
||||
@ -1175,7 +1175,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 30, y: 30}
|
||||
m_SizeDelta: {x: 40, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316742462309
|
||||
CanvasRenderer:
|
||||
@ -1373,7 +1373,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 250, y: 30}
|
||||
m_SizeDelta: {x: 250, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952316852223922
|
||||
MonoBehaviour:
|
||||
@ -1439,7 +1439,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 210, y: 40}
|
||||
m_SizeDelta: {x: 210, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316882128042
|
||||
CanvasRenderer:
|
||||
@ -1615,7 +1615,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 210, y: 40}
|
||||
m_SizeDelta: {x: 210, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952316906327139
|
||||
CanvasRenderer:
|
||||
@ -1934,7 +1934,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 210, y: 40}
|
||||
m_SizeDelta: {x: 210, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952317181319395
|
||||
CanvasRenderer:
|
||||
@ -2109,7 +2109,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 250, y: 30}
|
||||
m_SizeDelta: {x: 250, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952317184179897
|
||||
MonoBehaviour:
|
||||
@ -2248,10 +2248,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952317367001092}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952317200164022
|
||||
CanvasRenderer:
|
||||
@ -2316,7 +2316,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -2543,8 +2543,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_AnchoredPosition: {x: -5.2997, y: -5.6334}
|
||||
m_SizeDelta: {x: -50.2838, y: -28.4746}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952317367001093
|
||||
MonoBehaviour:
|
||||
@ -2790,10 +2790,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952318230211716}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952317479054003
|
||||
CanvasRenderer:
|
||||
@ -2858,7 +2858,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -2929,7 +2929,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 560, y: 30}
|
||||
m_SizeDelta: {x: 560, y: 50.40205}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952317550618935
|
||||
MonoBehaviour:
|
||||
@ -2993,8 +2993,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_AnchoredPosition: {x: -7.1925, y: -6.390499}
|
||||
m_SizeDelta: {x: -51.041, y: -26.9604}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952317557671493
|
||||
MonoBehaviour:
|
||||
@ -3046,7 +3046,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 30, y: 30}
|
||||
m_SizeDelta: {x: 40, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952317611268384
|
||||
CanvasRenderer:
|
||||
@ -3257,7 +3257,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 30, y: 30}
|
||||
m_SizeDelta: {x: 40, y: 40}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952317875960123
|
||||
CanvasRenderer:
|
||||
@ -3590,7 +3590,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 250, y: 30}
|
||||
m_SizeDelta: {x: 250, y: 60}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952318019617084
|
||||
MonoBehaviour:
|
||||
@ -3651,10 +3651,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952316553408495}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952318084561725
|
||||
CanvasRenderer:
|
||||
@ -3719,7 +3719,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -3786,10 +3786,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952317367001092}
|
||||
m_RootOrder: 1
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952318100279455
|
||||
CanvasRenderer:
|
||||
@ -3854,7 +3854,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -3922,10 +3922,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952316553408495}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952318180437445
|
||||
CanvasRenderer:
|
||||
@ -3990,7 +3990,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
@ -4080,8 +4080,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -0.5}
|
||||
m_SizeDelta: {x: -20, y: -13}
|
||||
m_AnchoredPosition: {x: -6.814, y: -6.3446016}
|
||||
m_SizeDelta: {x: -53.3123, y: -27.7175}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952318230211717
|
||||
MonoBehaviour:
|
||||
@ -4134,7 +4134,7 @@ RectTransform:
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 560, y: 30}
|
||||
m_SizeDelta: {x: 560, y: 70.402054}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &8065952318264672222
|
||||
MonoBehaviour:
|
||||
@ -4196,10 +4196,10 @@ RectTransform:
|
||||
m_Father: {fileID: 8065952317557671492}
|
||||
m_RootOrder: 0
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.075, y: 0}
|
||||
m_AnchorMax: {x: 0.8895791, y: 0.74074084}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 1}
|
||||
m_AnchoredPosition: {x: 7.5, y: 0}
|
||||
m_SizeDelta: {x: -15, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &8065952318280379820
|
||||
CanvasRenderer:
|
||||
@ -4264,7 +4264,7 @@ MonoBehaviour:
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 0
|
||||
m_HorizontalAlignment: 1
|
||||
m_VerticalAlignment: 256
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 10
|
||||
m_wordSpacing: 5
|
||||
|
||||
@ -1756,7 +1756,7 @@ GameObject:
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
m_IsActive: 0
|
||||
--- !u!136 &102349500
|
||||
CapsuleCollider:
|
||||
m_ObjectHideFlags: 0
|
||||
@ -8460,7 +8460,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 0483b263e22fc433caab31141efbe319, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
isDebugTest: 1
|
||||
isDebugTest: 0
|
||||
diceRollHandler: {fileID: 1013177415}
|
||||
diceValue: 0
|
||||
maxDiceSixRollCounter: 2
|
||||
@ -15149,6 +15149,7 @@ MonoBehaviour:
|
||||
- {fileID: 5608193482197189505}
|
||||
- {fileID: 5608193481571390227}
|
||||
baseObjects:
|
||||
- {fileID: 1949792867}
|
||||
- {fileID: 2095159703}
|
||||
- {fileID: 247469677}
|
||||
- {fileID: 875086323}
|
||||
@ -15157,7 +15158,6 @@ MonoBehaviour:
|
||||
- {fileID: 1954289399}
|
||||
- {fileID: 1107252688}
|
||||
- {fileID: 1406544794}
|
||||
- {fileID: 1949792867}
|
||||
- {fileID: 884011400}
|
||||
--- !u!4 &1335794571
|
||||
Transform:
|
||||
@ -20274,7 +20274,7 @@ AudioSource:
|
||||
m_PlayOnAwake: 0
|
||||
m_Volume: 1
|
||||
m_Pitch: 1
|
||||
Loop: 0
|
||||
Loop: 1
|
||||
Mute: 0
|
||||
Spatialize: 0
|
||||
SpatializePostEffects: 0
|
||||
@ -24609,8 +24609,6 @@ MonoBehaviour:
|
||||
m_EditorClassIdentifier:
|
||||
screenType: 6
|
||||
shouldFade: 0
|
||||
playBtn: {fileID: 0}
|
||||
closeBtn: {fileID: 0}
|
||||
--- !u!224 &5608193481924487018
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
|
||||
@ -60,6 +60,9 @@ public class MusicManager : MonoBehaviour, IBootLoader, IBase, IDataLoader
|
||||
|
||||
audioSource.priority = musicData.priority;
|
||||
audioSource.clip = musicData.musicClip;
|
||||
|
||||
if (audioSource.isPlaying) audioSource.Stop();
|
||||
|
||||
audioSource.Play();
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,8 @@ public class GameModeHandler : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
public void OnGameRestarted()
|
||||
{
|
||||
GameManager.OnGameStateChanged(GameState.InGame);
|
||||
gameplayManager.ResetGameRestartData();
|
||||
GameManager.ResetGameDatas();
|
||||
|
||||
switch (CurrentGameModeType)
|
||||
{
|
||||
case GameModeType.PVP:
|
||||
|
||||
@ -16,28 +16,35 @@ public enum BotMove
|
||||
|
||||
public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
[SerializeField] private bool isDebugTest = false;
|
||||
[SerializeField] private bool isDebugAITest = false;
|
||||
[SerializeField] private bool isDebugPlayerTest = false;
|
||||
|
||||
public bool IsDebugTest => isDebugTest;
|
||||
public bool IsDebugAITest => isDebugAITest;
|
||||
public bool IsDebugPlayerTest => isDebugPlayerTest;
|
||||
|
||||
[SerializeField] DiceRollHandler diceRollHandler;
|
||||
|
||||
[SerializeField] private int diceValue = 0;
|
||||
[SerializeField] private float botDiceRollDelay = 0.25f;
|
||||
[SerializeField] private int maxDiceSixRollCounter = 2;
|
||||
[SerializeField] private int totalStepsForCharacter = 57;
|
||||
|
||||
[SerializeField] private TextMeshProUGUI diceText;
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[SerializeField] private Transform pointerDebug;
|
||||
[SerializeField] private MeshRenderer pointerMeshRend;
|
||||
[SerializeField] private Material turnMat;
|
||||
[SerializeField] private Material selectMat;
|
||||
#endif
|
||||
|
||||
[SerializeField] private PlayerGameData[] playerGameDatas;
|
||||
[SerializeField] private PlayerBaseHandler playerBaseHandler;
|
||||
|
||||
private PlayerType currentPlayerTypeTurn;
|
||||
public PlayerType CurrentPlayerTypeTurn => currentPlayerTypeTurn;
|
||||
public PlayerBaseHandler PlayerBaseHandler => playerBaseHandler;
|
||||
|
||||
private PlayerType currentPlayerTypeTurn;
|
||||
private int currentPlayerTurnIndex = 0;
|
||||
|
||||
private List<PlayerType> allPlayerTypes = new List<PlayerType>();
|
||||
@ -49,7 +56,10 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
private Dictionary<PlayerType, PlayerGameData> playerGameDatasDict = new Dictionary<PlayerType, PlayerGameData>();
|
||||
private Dictionary<PlayerType, Dictionary<int, BotMove>> botRuntimeMovementData = new Dictionary<PlayerType, Dictionary<int, BotMove>>();
|
||||
|
||||
private TilesManager tilesManager;
|
||||
public TilesManager TilesManager
|
||||
{
|
||||
get; private set;
|
||||
}
|
||||
private UIManager uIManager;
|
||||
private GameManager gameManager;
|
||||
private GameModeHandler gameModeHandler;
|
||||
@ -83,7 +93,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
public void InitializeData()
|
||||
{
|
||||
tilesManager = InterfaceManager.Instance.GetInterfaceInstance<TilesManager>();
|
||||
TilesManager = InterfaceManager.Instance.GetInterfaceInstance<TilesManager>();
|
||||
uIManager = InterfaceManager.Instance.GetInterfaceInstance<UIManager>();
|
||||
gameManager = InterfaceManager.Instance.GetInterfaceInstance<GameManager>();
|
||||
gameModeHandler = InterfaceManager.Instance.GetInterfaceInstance<GameModeHandler>();
|
||||
@ -105,7 +115,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
});
|
||||
}
|
||||
|
||||
tilesManager.InitTilesData();
|
||||
TilesManager.InitTilesData();
|
||||
|
||||
playerBaseHandler.InitPlayerTypes(allPlayerTypes);
|
||||
InitCurrentGamePlayerInfo();
|
||||
@ -136,7 +146,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
}
|
||||
|
||||
tilesManager.InitTilesData();
|
||||
TilesManager.InitTilesData();
|
||||
playerBaseHandler.InitPlayerTypes(allPlayerTypes);
|
||||
InitCurrentGamePlayerInfo();
|
||||
InitBotRuntimeData();
|
||||
@ -144,7 +154,12 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
SetCanRollDiceForUser(!botTypesInGame.Contains(allPlayerTypes[0]));
|
||||
if (botTypesInGame.Contains(allPlayerTypes[0]))
|
||||
Invoke(nameof(HandleDiceRoll), 1f);
|
||||
HandleDiceRollWithDelay();
|
||||
}
|
||||
|
||||
private void HandleDiceRollWithDelay()
|
||||
{
|
||||
Invoke(nameof(HandleDiceRoll), botDiceRollDelay);
|
||||
}
|
||||
|
||||
private void InitBotRuntimeData()
|
||||
@ -215,7 +230,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
currentPlayerTypeTurn = allPlayerTypes[currentPlayerTurnIndex];
|
||||
Debug.Log($"currentPlayerTypeTurn: {currentPlayerTypeTurn}");
|
||||
|
||||
#if UNITY_EDITOR
|
||||
SetCurrentSelectedPointer();
|
||||
#endif
|
||||
|
||||
// initialize the board based on the player types
|
||||
playerGameDatasDict = new Dictionary<PlayerType, PlayerGameData>();
|
||||
@ -227,8 +244,18 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
Debug.Log($"playerGameData.playerType: {playerGameData.playerType}");
|
||||
|
||||
playerGameDatasDict.Add(playerGameData.playerType, playerGameData);
|
||||
playerGameDatasDict[playerGameData.playerType].playerPawnsDict = new Dictionary<int, PlayerPawn>();
|
||||
playerGameDatasDict.Add(
|
||||
playerGameData.playerType,
|
||||
new PlayerGameData
|
||||
{
|
||||
playerType = playerGameData.playerType,
|
||||
startIndex = playerGameData.startIndex,
|
||||
endIndex = playerGameData.endIndex,
|
||||
playersParent = playerGameData.playersParent,
|
||||
playerPawnsDict = new Dictionary<int, PlayerPawn>(),
|
||||
totalPawnsInHome = playerGameData.totalPawnsInHome,
|
||||
totalPawnsFinished = playerGameData.totalPawnsFinished
|
||||
});
|
||||
|
||||
foreach (Transform playerPawnChild in playerGameData.playersParent)
|
||||
{
|
||||
@ -317,7 +344,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
if (playerGameDatasDict[currentPlayerTypeTurn].totalPawnsInHome == 0)
|
||||
{
|
||||
UpdateActivePlayersAndSetDisplay();
|
||||
UpdateActivePlayersAndSetDisplay(true);
|
||||
}
|
||||
|
||||
if (availPlayers.Count() < 1 && CanRollDiceAgain) // got a 6 roll value
|
||||
@ -460,10 +487,10 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void FindPossibleTileData(PlayerPawn playerPawn, out int possibleSteps, out Tile possibleTileData)
|
||||
{
|
||||
int lastStepGenTile = totalStepsForCharacter - tilesManager.GetFinishingTileDataLength(playerPawn.PlayerType);//playerGameDatasDict[playerPawn.PlayerType].endIndex;
|
||||
int lastStepGenTile = totalStepsForCharacter - TilesManager.GetFinishingTileDataLength(playerPawn.PlayerType);//playerGameDatasDict[playerPawn.PlayerType].endIndex;
|
||||
int possibleTileIndex = playerPawn.CurrentTileIndex + diceRolledValue;
|
||||
|
||||
int lastTileIndex = tilesManager.GetGeneralTilesLength() - 1;
|
||||
int lastTileIndex = TilesManager.GetGeneralTilesLength() - 1;
|
||||
bool canGoingInsideFinishingPath = IsGoingInsideFinishingPath(playerPawn, out possibleSteps);
|
||||
|
||||
int index = canGoingInsideFinishingPath ? possibleSteps - lastStepGenTile - 1
|
||||
@ -471,13 +498,13 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
Debug.Log($"possibleTileIndex: {possibleTileIndex}, lastStepGenTileIdx: {lastStepGenTile}");
|
||||
Debug.Log($"index: {index}");
|
||||
possibleTileData = canGoingInsideFinishingPath ? tilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, index) : tilesManager.RetrieveTileBasedOnIndex(index);
|
||||
possibleTileData = canGoingInsideFinishingPath ? TilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, index) : TilesManager.RetrieveTileBasedOnIndex(index);
|
||||
}
|
||||
|
||||
public bool IsGoingInsideFinishingPath(PlayerPawn playerPawn, out int possibleSteps)
|
||||
{
|
||||
possibleSteps = playerGameDatasDict[playerPawn.PlayerType].playerPawnsDict[playerPawn.PlayerId].StepsTaken + diceRolledValue;
|
||||
return possibleSteps > tilesManager.GetGeneralTilesLength() - 1;
|
||||
return possibleSteps > TilesManager.GetGeneralTilesLength() - 1;
|
||||
}
|
||||
|
||||
public void OnDiceRolled(int rolledVal)
|
||||
@ -490,6 +517,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
diceText.text = $"{diceRolledValue}";
|
||||
availPlayers = new List<PlayerPawn>();
|
||||
|
||||
if (!CanRollDiceAgain)
|
||||
UpdateActivePlayersAndSetDisplay(true);
|
||||
|
||||
if (rolledVal == Ludo_3D_Constants.Max_Dice_Rolls)
|
||||
{
|
||||
canSwitchPlayer = false;
|
||||
@ -497,8 +527,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
// also play a simple animation before selecting
|
||||
CanRollDiceAgain = true;
|
||||
diceSixRollCounter++;
|
||||
#if UNITY_EDITOR
|
||||
pointerMeshRend.material = selectMat;
|
||||
|
||||
#endif
|
||||
foreach (var playerPawn in playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict)
|
||||
if (playerPawn.Value.GetPlayerState() == PlayerState.InFinishingPath)
|
||||
playerPawn.Value.SetPlayerSelectionState(false);
|
||||
@ -520,7 +551,6 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
else // if there are any other pawns that are in safe or moving state
|
||||
{
|
||||
// for player's logic
|
||||
UpdateActivePlayersAndSetDisplay();
|
||||
|
||||
int customAvailPlayers = availPlayers.Count();
|
||||
Debug.Log($"before CustomAvailablePlayers: {customAvailPlayers}");
|
||||
@ -532,8 +562,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
if (availPlayers[i].GetPlayerState() == PlayerState.InFinishingPath)
|
||||
{
|
||||
Debug.Log($"diceRolledValue: {diceRolledValue}, FinishingDataLen: {tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn)}, playerPawn.CurrentTileIndex: {availPlayers[i].CurrentTileIndex}");
|
||||
if (diceRolledValue <= tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - (availPlayers[i].CurrentTileIndex + 1))
|
||||
Debug.Log($"diceRolledValue: {diceRolledValue}, FinishingDataLen: {TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn)}, playerPawn.CurrentTileIndex: {availPlayers[i].CurrentTileIndex}");
|
||||
if (diceRolledValue <= TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - (availPlayers[i].CurrentTileIndex + 1))
|
||||
{
|
||||
availPlayers[i].SetPlayerSelectionState(true);
|
||||
}
|
||||
@ -562,14 +592,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"CanRollDiceAgain: {CanRollDiceAgain}, canSwitchPlayer: {canSwitchPlayer}");
|
||||
}
|
||||
|
||||
private void UpdateActivePlayersAndSetDisplay()
|
||||
private void UpdateActivePlayersAndSetDisplay(bool state)
|
||||
{
|
||||
availPlayers = playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Values.Select(pawn => pawn)
|
||||
.Where(pawn => pawn.GetPlayerState() == PlayerState.InSafeZone ||
|
||||
pawn.GetPlayerState() == PlayerState.Moving ||
|
||||
pawn.GetPlayerState() == PlayerState.InFinishingPath).ToList();
|
||||
|
||||
SetDisplayCountForAllAvailPlayers(true);
|
||||
SetDisplayCountForAllAvailPlayers(state);
|
||||
}
|
||||
|
||||
private bool AreAllPawnsInFinishingPath()
|
||||
@ -610,7 +640,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void HandleDiceRoll()
|
||||
{
|
||||
if (isDebugTest)
|
||||
if (isDebugAITest)
|
||||
diceRollHandler.HandleDiceViewForBot((rollVal) => RollDiceForBot(rollVal), diceValue == 0 ? UnityEngine.Random.Range(1, Ludo_3D_Constants.Max_Dice_Rolls + 1) : diceValue);
|
||||
else
|
||||
diceRollHandler.HandleDiceViewForBot((rollVal) => RollDiceForBot(rollVal));
|
||||
@ -626,11 +656,11 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
if (selectedPawn.GetPlayerState() == PlayerState.InHome)
|
||||
{
|
||||
Tile targetTile = tilesManager.RetrieveTileBasedOnIndex(playerGameData.startIndex);
|
||||
Tile targetTile = TilesManager.RetrieveTileBasedOnIndex(playerGameData.startIndex);
|
||||
|
||||
selectedPawn.ShowPlayerCountCanvas(false);
|
||||
selectedPawn.MoveToTile(
|
||||
GetAndInitPositionInsideSafeZone(selectedPawn, targetTile),
|
||||
TilesManager.GetAndInitPositionInsideSafeZone(selectedPawn, targetTile, currentPlayerTypeTurn),
|
||||
onComplete: () =>
|
||||
{
|
||||
playerGameDatasDict[playerGameData.playerType].totalPawnsInHome--;
|
||||
@ -652,7 +682,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
else if (selectedPawn.GetPlayerState() == PlayerState.InFinishingPath)
|
||||
{
|
||||
Tile currentSittingTile = tilesManager.RetrieveFinishingTileBasedOnIndex(selectedPawn.PlayerType, selectedPawn.CurrentTileIndex);
|
||||
Tile currentSittingTile = TilesManager.RetrieveFinishingTileBasedOnIndex(selectedPawn.PlayerType, selectedPawn.CurrentTileIndex);
|
||||
currentSittingTile.ResetPlayerPawn(selectedPawn);
|
||||
|
||||
if (currentSittingTile.HasPawnsAvailable)
|
||||
@ -666,41 +696,30 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
else if (selectedPawn.CurrentTileIndex == playerGameDatasDict[currentPlayerTypeTurn].endIndex)
|
||||
{
|
||||
tilesManager.RetrieveTileBasedOnIndex(selectedPawn.CurrentTileIndex).ResetPlayerPawn(selectedPawn);
|
||||
TilesManager.RetrieveTileBasedOnIndex(selectedPawn.CurrentTileIndex).ResetPlayerPawn(selectedPawn);
|
||||
ApplyFinishingPathLogic(selectedPawn);
|
||||
}
|
||||
else if (selectedPawn.GetPlayerState() == PlayerState.InSafeZone || selectedPawn.GetPlayerState() == PlayerState.Moving)
|
||||
{
|
||||
// move based on the dice value
|
||||
Debug.Log($"Tile Index :: currentTileIndex: {selectedPawn.CurrentTileIndex}");
|
||||
int nextTileIdx = GetNextGeneralTileIndex(selectedPawn);
|
||||
int nextTileIdx = TilesManager.GetNextGeneralTileIndex(selectedPawn.CurrentTileIndex);
|
||||
int targetIdx = selectedPawn.CurrentTileIndex + diceRolledValue;
|
||||
|
||||
if (nextTileIdx == 0)
|
||||
targetIdx = (targetIdx - selectedPawn.CurrentTileIndex) - 1;
|
||||
|
||||
Tile currentSittingTile = tilesManager.RetrieveTileBasedOnIndex(selectedPawn.CurrentTileIndex);
|
||||
Tile currentSittingTile = TilesManager.RetrieveTileBasedOnIndex(selectedPawn.CurrentTileIndex);
|
||||
if (currentSittingTile.IsSafeZone)
|
||||
{
|
||||
SafeTile safeTile = (SafeTile)currentSittingTile;
|
||||
safeTile.UpdateSafeZonePlayerData(currentPlayerTypeTurn, selectedPawn);
|
||||
if (safeTile.ContainsPlayerType(selectedPawn.PlayerType))
|
||||
{
|
||||
var playerPawns = safeTile.GetPlayerPawns(selectedPawn.PlayerType);
|
||||
SafeTile currentSittingSafeTile = (SafeTile)currentSittingTile;
|
||||
currentSittingSafeTile.UpdateSafeZonePlayerData(currentPlayerTypeTurn, selectedPawn);
|
||||
|
||||
if (safeTile.PlayerTypesCount == 1)
|
||||
if (currentSittingSafeTile.PlayerTypesCount == 1) // && currentSittingSafeTile.ContainsPlayerType(selectedPawn.PlayerType))
|
||||
{
|
||||
PlayerType playerType = safeTile.GetFirstPlayerType();
|
||||
|
||||
foreach (var pawn in playerPawns)
|
||||
pawn.MoveToCustomTilePosition(safeTile.CenterPlacementPosition);
|
||||
}
|
||||
|
||||
if (safeTile.ContainsPlayerType(selectedPawn.PlayerType))
|
||||
{
|
||||
foreach (var pawn in playerPawns)
|
||||
ShowUpdatedPlayerCountOnTile(pawn);
|
||||
}
|
||||
var playerPawnsTest = currentSittingSafeTile.GetFirstPlayerPawns();
|
||||
foreach (var pawn in playerPawnsTest)
|
||||
pawn.MoveToCustomTilePosition(currentSittingSafeTile.CenterPlacementPosition);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -720,9 +739,9 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void ApplyFinishingPathLogic(PlayerPawn playerPawn)
|
||||
{
|
||||
int finishingPathIndex = GetNextFinishingTileIndex(playerPawn);
|
||||
int targetIdx = finishingPathIndex + diceRolledValue > tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ?
|
||||
tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue;
|
||||
int finishingPathIndex = TilesManager.GetNextFinishingTileIndex(playerPawn.CurrentTileIndex, playerPawn.PlayerType);
|
||||
int targetIdx = finishingPathIndex + diceRolledValue > TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ?
|
||||
TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 : finishingPathIndex + diceRolledValue;
|
||||
|
||||
Debug.Log($"TargetIdx: {targetIdx}, finishingPathIndex: {finishingPathIndex}");
|
||||
|
||||
@ -730,22 +749,14 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
MoveThroughFinishingPath(playerPawn, finishingPathIndex, targetIdx);
|
||||
}
|
||||
|
||||
// TODO :: move to tiles manager
|
||||
|
||||
public int GetNextGeneralTileIndex(PlayerPawn playerPawn)
|
||||
{
|
||||
return playerPawn.CurrentTileIndex == tilesManager.GetGeneralTilesLength() - 1 ? 0 : playerPawn.CurrentTileIndex + 1;
|
||||
}
|
||||
|
||||
private int GetNextFinishingTileIndex(PlayerPawn playerPawn)
|
||||
{
|
||||
return playerPawn.CurrentTileIndex > tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ? 0 : playerPawn.CurrentTileIndex + 1;
|
||||
}
|
||||
|
||||
private void SwitchPlayer(PlayerPawn playerPawn = null)
|
||||
{
|
||||
Debug.Log($"CallTest: SwitchPlayer");
|
||||
if (playerPawn)
|
||||
UpdatePlayerState(playerPawn, tilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex).IsSafeZone ? PlayerState.InSafeZone : PlayerState.Moving);
|
||||
UpdatePlayerState(playerPawn, TilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex).IsSafeZone ? PlayerState.InSafeZone : PlayerState.Moving);
|
||||
|
||||
if (!CanRollDiceAgain)
|
||||
{
|
||||
@ -754,11 +765,11 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
Debug.Log($"before SwitchPlayer availPlayers: {availPlayers.Count}, playerPawn: {playerPawn}");
|
||||
|
||||
UpdateActivePlayersAndSetDisplay();
|
||||
UpdateActivePlayersAndSetDisplay(false);
|
||||
Debug.Log($"after SwitchPlayer availPlayers: {availPlayers.Count}, playerPawn: {playerPawn}");
|
||||
SetDisplayCountForAllAvailPlayers(false);
|
||||
Debug.Log($"after allPlayerTypes.Count: {allPlayerTypes.Count}");
|
||||
|
||||
if (allPlayerTypes.Count == 1)
|
||||
if (allPlayerTypes.Count == 0)
|
||||
{
|
||||
Debug.LogError($"GAME IS OVER");
|
||||
return;
|
||||
@ -781,31 +792,34 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
diceSixRollCounter = 0;
|
||||
diceText.text = $"{0}";
|
||||
|
||||
UpdateActivePlayersAndSetDisplay();
|
||||
}
|
||||
|
||||
Debug.Log($"currentPlayerTurnIndex: {currentPlayerTurnIndex}");
|
||||
Debug.Log($"CurrentPlayerTurn: {currentPlayerTypeTurn}");
|
||||
SetCanRollDiceForUser(gameModeHandler.CurrentGameModeType != GameModeType.Bot || !botTypesInGame.Contains(currentPlayerTypeTurn));
|
||||
SetCurrentSelectedPointer();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
SetCurrentSelectedPointer();
|
||||
pointerMeshRend.material = turnMat;
|
||||
// pointerMeshRend.materials[0] = turnMat;
|
||||
#endif
|
||||
|
||||
// Debug.Log($"botTypesInGame.Contains(currentPlayerTypeTurn): {botTypesInGame.Contains(currentPlayerTypeTurn)}");
|
||||
|
||||
if (gameModeHandler.CurrentGameModeType == GameModeType.Bot && botTypesInGame.Contains(currentPlayerTypeTurn)) // TODO :: Double check calling of the function
|
||||
{
|
||||
Debug.Log($"Invoking RollDiceForBot");
|
||||
Invoke(nameof(HandleDiceRoll), 1f);
|
||||
HandleDiceRollWithDelay();
|
||||
}
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private void SetCurrentSelectedPointer()
|
||||
{
|
||||
var tempPos = playerBaseHandler.GetPlayerBase(currentPlayerTypeTurn).transform.position;
|
||||
pointerDebug.position = new Vector3(tempPos.x, 3f, tempPos.z);
|
||||
}
|
||||
#endif
|
||||
|
||||
public void SetDisplayCountForAllAvailPlayers(bool state)
|
||||
{
|
||||
@ -821,17 +835,17 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
|
||||
private void MoveThroughTiles(PlayerPawn playerPawn, int index, int targetIndex)
|
||||
{
|
||||
Tile nextTile = tilesManager.RetrieveTileBasedOnIndex(index);
|
||||
Tile nextTile = TilesManager.RetrieveTileBasedOnIndex(index);
|
||||
Vector3 targetPosition = nextTile.CenterPlacementPosition;
|
||||
|
||||
Debug.Log($"Tile Index :: nextIndex: {index}, targetIndex: {targetIndex}, nextTileName: {nextTile.name}");
|
||||
|
||||
if (index == targetIndex) // if the target index is the safe zone only then apply the logic for rearranging pawns
|
||||
{
|
||||
Tile targetTile = tilesManager.RetrieveTileBasedOnIndex(targetIndex);
|
||||
Tile targetTile = TilesManager.RetrieveTileBasedOnIndex(targetIndex);
|
||||
if (targetTile.IsSafeZone)
|
||||
{
|
||||
targetPosition = GetAndInitPositionInsideSafeZone(playerPawn, targetTile);
|
||||
targetPosition = TilesManager.GetAndInitPositionInsideSafeZone(playerPawn, targetTile, currentPlayerTypeTurn);
|
||||
}
|
||||
}
|
||||
|
||||
@ -846,7 +860,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"DiceRolledValue: {diceRolledValue}");
|
||||
if (diceRolledValue > 0)
|
||||
{
|
||||
int nextTileIndex = GetNextGeneralTileIndex(playerPawn);
|
||||
int nextTileIndex = TilesManager.GetNextGeneralTileIndex(playerPawn.CurrentTileIndex);
|
||||
Debug.Log($"currentTileIndex: {playerPawn.CurrentTileIndex}, nextTileIndex: {nextTileIndex}, targetIndex: {targetIndex}");
|
||||
|
||||
if (playerPawn.GetPlayerState() == PlayerState.InFinishingPath || index == playerGameDatasDict[currentPlayerTypeTurn].endIndex)
|
||||
@ -885,14 +899,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
for (int i = counter; i > 0; i--)
|
||||
{
|
||||
var pawn = nextTile.GetPlayerPawn();
|
||||
Debug.Log($"pawn: {pawn}");
|
||||
Debug.Log($"playerBase: {playerBaseHandler}");
|
||||
|
||||
var playerBasePos = playerBaseHandler.GetPlayerBase(pawn.PlayerType).GetBasePlacementDataPosition(pawn.PlayerId - 1);
|
||||
Debug.Log($"playerBasePos: {playerBasePos}");
|
||||
|
||||
playerGameDatasDict[pawn.PlayerType].totalPawnsInHome++;
|
||||
pawn.MoveBackToHome(playerBasePos);
|
||||
playerBaseHandler.SendPlayerToHome(pawn);
|
||||
}
|
||||
|
||||
if (CheckForMaxDiceRollAttempt())
|
||||
@ -930,69 +938,12 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
index);
|
||||
}
|
||||
|
||||
private Vector3 GetAndInitPositionInsideSafeZone(PlayerPawn playerPawn, Tile targetTile)
|
||||
{
|
||||
Vector3 targetPosition;
|
||||
SafeTile targetSafeTile = (SafeTile)targetTile;
|
||||
Debug.Log($"targetSafeTile.PlayerTypesCount: {targetSafeTile.PlayerTypesCount}");
|
||||
if (targetSafeTile.PlayerTypesCount == 1)
|
||||
{
|
||||
Debug.Log($"targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn): {targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn)}");
|
||||
if (!targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn)) // means it is a new player type, the second one
|
||||
{
|
||||
PlayerType initialPlayerType = targetSafeTile.GetFirstPlayerType();
|
||||
|
||||
// rearrange already existing player from center position to it's saved transform
|
||||
var playerPawns = targetSafeTile.GetPlayerPawns(initialPlayerType);
|
||||
foreach (var pawn in playerPawns)
|
||||
{
|
||||
var placementPoint = targetSafeTile.GetPlacementPoint(initialPlayerType);
|
||||
pawn.MoveToCustomTilePosition(placementPoint.position);
|
||||
}
|
||||
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetSafeTile.GetPlacementPoint(currentPlayerTypeTurn).position;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetTile.CenterPlacementPosition;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO :: Check the data if it's consistent
|
||||
Debug.Log($"targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn): {targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn)}");
|
||||
if (!targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn))
|
||||
{
|
||||
Debug.Log($"targetSafeTile.PlayerTypesCount: {targetSafeTile.PlayerTypesCount}");
|
||||
if (targetSafeTile.PlayerTypesCount < 1) // he is the only player that is being added to the safe zone
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetTile.CenterPlacementPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetSafeTile.GetPlacementPoint(currentPlayerTypeTurn).position;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetSafeTile.GetPlacementPoint(currentPlayerTypeTurn).position;
|
||||
}
|
||||
}
|
||||
|
||||
return targetPosition;
|
||||
}
|
||||
|
||||
private void MoveThroughFinishingPath(PlayerPawn playerPawn, int index, int targetIndex)
|
||||
{
|
||||
UpdatePlayerState(playerPawn, PlayerState.InFinishingPath);
|
||||
|
||||
playerPawn.MoveToTile(
|
||||
tilesManager.RetrieveFinishingTileBasedOnIndex(currentPlayerTypeTurn, index).transform.position,
|
||||
TilesManager.RetrieveFinishingTileBasedOnIndex(currentPlayerTypeTurn, index).transform.position,
|
||||
onComplete: () =>
|
||||
{
|
||||
diceRolledValue--;
|
||||
@ -1000,7 +951,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
Debug.Log($"DiceRolledValue: {diceRolledValue}");
|
||||
if (diceRolledValue > 0)
|
||||
{
|
||||
int tileIndex = GetNextFinishingTileIndex(playerPawn);
|
||||
int tileIndex = TilesManager.GetNextFinishingTileIndex(playerPawn.CurrentTileIndex, playerPawn.PlayerType);
|
||||
Debug.Log($"tileIndex: {tileIndex}, targetIndex: {targetIndex}");
|
||||
if (tileIndex <= targetIndex)
|
||||
{
|
||||
@ -1010,18 +961,25 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
}
|
||||
else
|
||||
{
|
||||
if (playerPawn.CurrentTileIndex == tilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1)
|
||||
if (playerPawn.CurrentTileIndex == TilesManager.GetFinishingTileDataLength(currentPlayerTypeTurn) - 1)
|
||||
{
|
||||
playerPawn.ShowPlayerCountCanvas(false);
|
||||
Tile tile = TilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, playerPawn.CurrentTileIndex);
|
||||
tile.InitPlayerPawn(playerPawn, playerPawn.PlayerType);
|
||||
// ShowUpdatedPlayerCountOnTile(playerPawn);
|
||||
|
||||
UpdatePlayerState(playerPawn, PlayerState.HasFinished);
|
||||
playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished++;
|
||||
|
||||
Debug.Log($"playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished: {playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished}");
|
||||
Debug.Log($"playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Count: {playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Count}");
|
||||
if (playerGameDatasDict[currentPlayerTypeTurn].totalPawnsFinished == playerGameDatasDict[currentPlayerTypeTurn].playerPawnsDict.Count)
|
||||
{
|
||||
CanRollDiceAgain = false;
|
||||
|
||||
var playerTypeToRemove = currentPlayerTypeTurn;
|
||||
allPlayerTypes.ForEach(type => Debug.Log($"before allPlayerTypes: {type}"));
|
||||
SwitchPlayer();
|
||||
allPlayerTypes.ForEach(type => Debug.Log($"after allPlayerTypes: {type}"));
|
||||
|
||||
if (allPlayerTypes.Contains(playerTypeToRemove))
|
||||
{
|
||||
@ -1054,7 +1012,7 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
else
|
||||
{
|
||||
// activate here
|
||||
tilesManager.RetrieveFinishingTileBasedOnIndex(currentPlayerTypeTurn, playerPawn.CurrentTileIndex).InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
TilesManager.RetrieveFinishingTileBasedOnIndex(currentPlayerTypeTurn, playerPawn.CurrentTileIndex).InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
|
||||
if (CheckForMaxDiceRollAttempt())
|
||||
{
|
||||
@ -1080,8 +1038,8 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
private void ShowUpdatedPlayerCountOnTile(PlayerPawn playerPawn)
|
||||
{
|
||||
Tile tile = playerPawn.GetPlayerState() == PlayerState.InFinishingPath ?
|
||||
tilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, playerPawn.CurrentTileIndex)
|
||||
: tilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex);
|
||||
TilesManager.RetrieveFinishingTileBasedOnIndex(playerPawn.PlayerType, playerPawn.CurrentTileIndex)
|
||||
: TilesManager.RetrieveTileBasedOnIndex(playerPawn.CurrentTileIndex);
|
||||
|
||||
playerPawn.ShowPlayerCountCanvas(true);
|
||||
|
||||
@ -1100,6 +1058,21 @@ public class GameplayManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
playerPawn.PlayerCountCanvas.SetPlayerCount(count);
|
||||
}
|
||||
|
||||
public void ResetTileDatasForPlayers()
|
||||
{
|
||||
foreach (PlayerData data in playerDatas)
|
||||
{
|
||||
var pawns = playerGameDatasDict[data.playerType].playerPawnsDict.Values;
|
||||
|
||||
foreach (var pawn in pawns)
|
||||
{
|
||||
if (pawn.GetPlayerState() == PlayerState.InHome) continue;
|
||||
|
||||
TilesManager.ResetTileData(pawn.PlayerType, pawn.CurrentTileIndex, pawn.GetPlayerState());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetData()
|
||||
{
|
||||
ResetGameRestartData();
|
||||
|
||||
@ -42,4 +42,12 @@ public class PlayerBase : MonoBehaviour
|
||||
Debug.Log($"Index: {idx}, basePlacementDatas[idx]: {basePlacementDatas[idx]}");
|
||||
return basePlacementDatas[idx].placementTransform;
|
||||
}
|
||||
|
||||
public void ResetPlayerDatas()
|
||||
{
|
||||
for (int idx = 0; idx < playerPawns.Length; idx++)
|
||||
{
|
||||
playerPawns[idx].ResetData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,4 +40,18 @@ public class PlayerBaseHandler : MonoBehaviour
|
||||
{
|
||||
return playerBasesDict[playerType];
|
||||
}
|
||||
|
||||
public void ResetPlayerBaseData()
|
||||
{
|
||||
foreach (var playerBasePair in playerBasesDict)
|
||||
{
|
||||
playerBasePair.Value.ResetPlayerDatas();
|
||||
}
|
||||
}
|
||||
|
||||
public void SendPlayerToHome(PlayerPawn pawn)
|
||||
{
|
||||
var playerBasePos = GetPlayerBase(pawn.PlayerType).GetBasePlacementDataPosition(pawn.PlayerId - 1);
|
||||
pawn.MoveBackToHome(playerBasePos);
|
||||
}
|
||||
}
|
||||
|
||||
@ -65,10 +65,6 @@ public class PlayerPawn : MonoBehaviour
|
||||
public void SetPlayerSelectionState(bool state)
|
||||
{
|
||||
CanSelectPlayer = state;
|
||||
if (CanSelectPlayer)
|
||||
{
|
||||
// TODO :: Play animation for selecting any of the players
|
||||
}
|
||||
}
|
||||
|
||||
public void MoveToTile(Vector3 startingPoint, Action onComplete, int tileIndex)
|
||||
@ -91,6 +87,7 @@ public class PlayerPawn : MonoBehaviour
|
||||
|
||||
Vector3 lookDirection = Vector3.zero;
|
||||
|
||||
Debug.Log($"nextIndex :: playerState: {playerState}");
|
||||
if (playerState == PlayerState.InFinishingPath)
|
||||
{
|
||||
int nextIndex = CurrentTileIndex + 1;
|
||||
@ -105,18 +102,22 @@ public class PlayerPawn : MonoBehaviour
|
||||
{
|
||||
if (gameplayManager.IsGoingInsideFinishingPath(this, out int possibleSteps))
|
||||
{
|
||||
lookDirection =tilesManager.RetrieveFinishingTileBasedOnIndex(PlayerType, 0).transform.position - transform.position;
|
||||
lookDirection = tilesManager.RetrieveFinishingTileBasedOnIndex(PlayerType, 0).transform.position - transform.position;
|
||||
}
|
||||
else
|
||||
{
|
||||
int nextIndex = gameplayManager.GetNextGeneralTileIndex(this);
|
||||
int nextIndex = gameplayManager.TilesManager.GetNextGeneralTileIndex(CurrentTileIndex);
|
||||
Debug.Log($"nextIndex :: {nextIndex}, currentIndex: {CurrentTileIndex}");
|
||||
lookDirection = tilesManager.RetrieveTileBasedOnIndex(nextIndex).transform.position - transform.position;
|
||||
}
|
||||
}
|
||||
|
||||
lookDirection = lookDirection.normalized;
|
||||
lookDirection.y = 0;
|
||||
|
||||
if (lookDirection != Vector3.zero)
|
||||
{
|
||||
// transform.LookAt(transform.position + lookDirection);
|
||||
transform.DOLookAt(transform.position + lookDirection, 0.2f);
|
||||
}
|
||||
|
||||
@ -171,4 +172,14 @@ public class PlayerPawn : MonoBehaviour
|
||||
{
|
||||
playerCountCanvas.gameObject.SetActive(show);
|
||||
}
|
||||
|
||||
public void ResetData()
|
||||
{
|
||||
SetPlayerState(PlayerState.InHome);
|
||||
StepsTaken = 0;
|
||||
PlayerId = 0;
|
||||
if (playerCountCanvas.gameObject.activeInHierarchy)
|
||||
ShowPlayerCountCanvas(false);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@ -34,7 +34,7 @@ public class DiceRollHandler : MonoBehaviour
|
||||
SoundManager soundManager = InterfaceManager.Instance?.GetInterfaceInstance<SoundManager>();
|
||||
soundManager?.PlayGameSoundClip(SoundType.Dice);
|
||||
|
||||
if (inputManager.GameplayManager.IsDebugTest)
|
||||
if (inputManager.GameplayManager.IsDebugPlayerTest)
|
||||
OnUserDiceRollComplete(GetDiceTestVal());
|
||||
else
|
||||
diceView.Roll(onComplete: (rolledVal) => OnUserDiceRollComplete(rolledVal), false);
|
||||
|
||||
@ -3,7 +3,7 @@ using UnityEngine;
|
||||
public class GameBootLoader : BootLoader
|
||||
{
|
||||
[SerializeField] private GameObject[] baseObjects;
|
||||
// [SerializeField] private BaseSO[] scriptables;
|
||||
[SerializeField] private bool enableLogs = false;
|
||||
|
||||
private bool hasInitializedScriptables = false;
|
||||
|
||||
@ -21,6 +21,7 @@ public class GameBootLoader : BootLoader
|
||||
}
|
||||
protected override void InitializeData()
|
||||
{
|
||||
Debug.unityLogger.logEnabled = enableLogs;
|
||||
Debug.Log($"InitializeData: for loaders");
|
||||
InitializeScriptablesData();
|
||||
|
||||
|
||||
@ -11,6 +11,7 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
{
|
||||
private UIManager uiManager;
|
||||
private TilesManager tilesManager;
|
||||
private MusicManager musicManager;
|
||||
private GameplayManager gameplayManager;
|
||||
|
||||
public GameState GameState
|
||||
@ -18,6 +19,8 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
get; private set;
|
||||
}
|
||||
|
||||
private GameState PrevGameState;
|
||||
|
||||
public void Initialize()
|
||||
{
|
||||
InterfaceManager.Instance.RegisterInterface<GameManager>(this);
|
||||
@ -28,27 +31,47 @@ public class GameManager : MonoBehaviour, IBase, IBootLoader, IDataLoader
|
||||
uiManager = InterfaceManager.Instance.GetInterfaceInstance<UIManager>();
|
||||
tilesManager = InterfaceManager.Instance.GetInterfaceInstance<TilesManager>();
|
||||
gameplayManager = InterfaceManager.Instance.GetInterfaceInstance<GameplayManager>();
|
||||
musicManager = InterfaceManager.Instance.GetInterfaceInstance<MusicManager>();
|
||||
|
||||
OnGameStateChanged(GameState.InMenu);
|
||||
}
|
||||
|
||||
public void OnGameStateChanged(GameState gameState)
|
||||
{
|
||||
PrevGameState = GameState;
|
||||
GameState = gameState;
|
||||
Debug.Log($"OnGameStateChanged: {gameState}");
|
||||
switch (gameState)
|
||||
{
|
||||
case GameState.InMenu:
|
||||
gameplayManager.ResetData();
|
||||
tilesManager.ResetData();
|
||||
musicManager.PlayMusicClip(MusicType.HomeMusic);
|
||||
CheckPrevGameState();
|
||||
uiManager.OnInMenuScreen();
|
||||
break;
|
||||
case GameState.InGame:
|
||||
musicManager.PlayMusicClip(MusicType.GameMusic);
|
||||
uiManager.OnInGameScreen();
|
||||
break;
|
||||
case GameState.GameOver:
|
||||
musicManager.PlayMusicClip(MusicType.GameOverMusic);
|
||||
uiManager.OnGameOver();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void CheckPrevGameState()
|
||||
{
|
||||
if (PrevGameState == GameState.InGame) // returning to menu from in-game
|
||||
{
|
||||
ResetGameDatas();
|
||||
}
|
||||
}
|
||||
|
||||
public void ResetGameDatas()
|
||||
{
|
||||
gameplayManager.ResetTileDatasForPlayers();
|
||||
gameplayManager.ResetData();
|
||||
tilesManager.ResetData();
|
||||
gameplayManager.PlayerBaseHandler.ResetPlayerBaseData();
|
||||
}
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ public class SafeTile : Tile
|
||||
public int PlayerTypesCount => playerTypesDict.Count;
|
||||
public bool HasMoreThanOnePlayerType => playerTypesDict.Count > 1;
|
||||
public List<PlayerPawn> GetPlayerPawns(PlayerType playerType) => playerTypesDict[playerType].playerPawns.Values.ToList();
|
||||
public List<PlayerPawn> GetFirstPlayerPawns() => playerTypesDict.FirstOrDefault().Value.playerPawns.Values.ToList();
|
||||
|
||||
public bool ContainsPlayerType(PlayerType playerType) => playerTypesDict.ContainsKey(playerType);
|
||||
|
||||
@ -86,4 +87,12 @@ public class SafeTile : Tile
|
||||
{
|
||||
return playerTypesDict[playerType].commonPlacementTransform;
|
||||
}
|
||||
|
||||
public override void ResetTileData()
|
||||
{
|
||||
if (playerTypesDict != null && playerTypesDict.Count > 0)
|
||||
{
|
||||
playerTypesDict.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -53,4 +53,10 @@ public class Tile : MonoBehaviour
|
||||
Debug.Log($"Resetting new PlayerPawn {movingPawn.name} {name}");
|
||||
Debug.Log($"Resetting new PlayerPawn {PlayerPawns.Count} {name}");
|
||||
}
|
||||
|
||||
public virtual void ResetTileData()
|
||||
{
|
||||
if (HasPawnsAvailable)
|
||||
PlayerPawns.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
@ -62,8 +62,103 @@ public class TilesManager : MonoBehaviour, IBootLoader, IDataLoader, IBase
|
||||
return finishingTileDataPairs[playerType][index];
|
||||
}
|
||||
|
||||
public int GetNextGeneralTileIndex(int currentTileIndex)
|
||||
{
|
||||
return currentTileIndex == GetGeneralTilesLength() - 1 ? 0 : currentTileIndex + 1;
|
||||
}
|
||||
|
||||
public int GetNextFinishingTileIndex(int currentTileIndex, PlayerType currentPlayerTypeTurn)
|
||||
{
|
||||
return currentTileIndex > GetFinishingTileDataLength(currentPlayerTypeTurn) - 1 ? 0 : currentTileIndex + 1;
|
||||
}
|
||||
|
||||
public void ResetData()
|
||||
{
|
||||
finishingTileDataPairs.Clear();
|
||||
}
|
||||
|
||||
public void ResetTileData(PlayerType playerType, int currentTileIndex, PlayerState playerState)
|
||||
{
|
||||
if (playerState == PlayerState.InFinishingPath || playerState == PlayerState.HasFinished)
|
||||
{
|
||||
Tile tile = RetrieveFinishingTileBasedOnIndex(playerType, currentTileIndex);
|
||||
tile.ResetTileData();
|
||||
}
|
||||
else if (playerState == PlayerState.Moving)
|
||||
{
|
||||
Tile tile = RetrieveTileBasedOnIndex(currentTileIndex);
|
||||
tile.ResetTileData();
|
||||
}
|
||||
else if (playerState == PlayerState.InSafeZone)
|
||||
{
|
||||
SafeTile tile = (SafeTile)RetrieveTileBasedOnIndex(currentTileIndex);
|
||||
tile.ResetTileData();
|
||||
}
|
||||
}
|
||||
|
||||
public Vector3 GetAndInitPositionInsideSafeZone(PlayerPawn playerPawn, Tile targetTile, PlayerType currentPlayerTypeTurn)
|
||||
{
|
||||
Vector3 targetPosition;
|
||||
SafeTile targetSafeTile = (SafeTile)targetTile;
|
||||
Debug.Log($"targetSafeTile.PlayerTypesCount: {targetSafeTile.PlayerTypesCount}");
|
||||
if (targetSafeTile.PlayerTypesCount == 1)
|
||||
{
|
||||
Debug.Log($"targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn): {targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn)}");
|
||||
if (!targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn)) // means it is a new player type, the second one
|
||||
{
|
||||
PlayerType initialPlayerType = targetSafeTile.GetFirstPlayerType();
|
||||
|
||||
// rearrange already existing player from center position to it's saved transform
|
||||
Debug.Log($"### GetAndInitPositionInsideSafeZone initialPlayerType: {initialPlayerType}");
|
||||
var playerPawns = targetSafeTile.GetPlayerPawns(initialPlayerType);
|
||||
Debug.Log($"### GetAndInitPositionInsideSafeZone playerPawns: {playerPawns.Count}");
|
||||
|
||||
foreach (var pawn in playerPawns)
|
||||
{
|
||||
var placementPoint = targetSafeTile.GetPlacementPoint(initialPlayerType);
|
||||
Debug.Log($"### GetAndInitPositionInsideSafeZone placementPoint: {placementPoint.position}");
|
||||
pawn.MoveToCustomTilePosition(placementPoint.position);
|
||||
}
|
||||
|
||||
Debug.Log($"### GetAndInitPositionInsideSafeZone playerPawn: {playerPawn.name}, {playerPawn.PlayerType}");
|
||||
Debug.Log($"### GetAndInitPositionInsideSafeZone currentPlayerTypeTurn: {currentPlayerTypeTurn}");
|
||||
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetSafeTile.GetPlacementPoint(currentPlayerTypeTurn).position;
|
||||
|
||||
Debug.Log($"### GetAndInitPositionInsideSafeZone targetPosition: {targetPosition}");
|
||||
}
|
||||
else
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetTile.CenterPlacementPosition;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO :: Check the data if it's consistent
|
||||
Debug.Log($"targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn): {targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn)}");
|
||||
if (!targetSafeTile.ContainsPlayerType(currentPlayerTypeTurn))
|
||||
{
|
||||
Debug.Log($"targetSafeTile.PlayerTypesCount: {targetSafeTile.PlayerTypesCount}");
|
||||
if (targetSafeTile.PlayerTypesCount < 1) // he is the only player that is being added to the safe zone
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetTile.CenterPlacementPosition;
|
||||
}
|
||||
else
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetSafeTile.GetPlacementPoint(currentPlayerTypeTurn).position;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
targetSafeTile.InitPlayerPawn(playerPawn, currentPlayerTypeTurn);
|
||||
targetPosition = targetSafeTile.GetPlacementPoint(currentPlayerTypeTurn).position;
|
||||
}
|
||||
}
|
||||
|
||||
return targetPosition;
|
||||
}
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ PlayerSettings:
|
||||
defaultScreenWidthWeb: 960
|
||||
defaultScreenHeightWeb: 600
|
||||
m_StereoRenderingPath: 0
|
||||
m_ActiveColorSpace: 1
|
||||
m_ActiveColorSpace: 0
|
||||
unsupportedMSAAFallback: 0
|
||||
m_MTRendering: 1
|
||||
mipStripping: 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user