finalizado ajedez clasico

This commit is contained in:
2025-07-29 15:27:32 -03:00
parent 779a4d8c1e
commit d1ff57293d
8 changed files with 972 additions and 12 deletions
+606
View File
@@ -0,0 +1,606 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 10
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 3
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 13
m_BakeOnSceneLoad: 0
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 0
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &429894530
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 429894531}
m_Layer: 0
m_Name: BoardParent
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &429894531
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 429894530}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -0.2777273, y: 0.29061925, z: -0.05641011}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &519420028
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 519420032}
- component: {fileID: 519420031}
- component: {fileID: 519420029}
- component: {fileID: 519420030}
m_Layer: 0
m_Name: Main Camera
m_TagString: MainCamera
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!81 &519420029
AudioListener:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
--- !u!114 &519420030
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3}
m_Name:
m_EditorClassIdentifier:
m_RenderShadows: 1
m_RequiresDepthTextureOption: 2
m_RequiresOpaqueTextureOption: 2
m_CameraType: 0
m_Cameras: []
m_RendererIndex: -1
m_VolumeLayerMask:
serializedVersion: 2
m_Bits: 1
m_VolumeTrigger: {fileID: 0}
m_VolumeFrameworkUpdateModeOption: 2
m_RenderPostProcessing: 0
m_Antialiasing: 0
m_AntialiasingQuality: 2
m_StopNaN: 0
m_Dithering: 0
m_ClearDepth: 1
m_AllowXRRendering: 1
m_AllowHDROutput: 1
m_UseScreenCoordOverride: 0
m_ScreenSizeOverride: {x: 0, y: 0, z: 0, w: 0}
m_ScreenCoordScaleBias: {x: 0, y: 0, z: 0, w: 0}
m_RequiresDepthTexture: 0
m_RequiresColorTexture: 0
m_Version: 2
m_TaaSettings:
m_Quality: 3
m_FrameInfluence: 0.1
m_JitterScale: 1
m_MipBias: 0
m_VarianceClampScale: 0.9
m_ContrastAdaptiveSharpening: 0
--- !u!20 &519420031
Camera:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
m_Enabled: 1
serializedVersion: 2
m_ClearFlags: 2
m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0}
m_projectionMatrixMode: 1
m_GateFitMode: 2
m_FOVAxisMode: 0
m_Iso: 200
m_ShutterSpeed: 0.005
m_Aperture: 16
m_FocusDistance: 10
m_FocalLength: 50
m_BladeCount: 5
m_Curvature: {x: 2, y: 11}
m_BarrelClipping: 0.25
m_Anamorphism: 0
m_SensorSize: {x: 36, y: 24}
m_LensShift: {x: 0, y: 0}
m_NormalizedViewPortRect:
serializedVersion: 2
x: 0
y: 0
width: 1
height: 1
near clip plane: 0.3
far clip plane: 1000
field of view: 34
orthographic: 1
orthographic size: 45
m_Depth: -1
m_CullingMask:
serializedVersion: 2
m_Bits: 4294967295
m_RenderingPath: -1
m_TargetTexture: {fileID: 0}
m_TargetDisplay: 0
m_TargetEye: 0
m_HDR: 1
m_AllowMSAA: 0
m_AllowDynamicResolution: 0
m_ForceIntoRT: 0
m_OcclusionCulling: 0
m_StereoConvergence: 10
m_StereoSeparation: 0.022
--- !u!4 &519420032
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 519420028}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 35, y: 36, z: -214}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &619394800
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 619394802}
- component: {fileID: 619394801}
m_Layer: 0
m_Name: Global Light 2D
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &619394801
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 619394800}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 073797afb82c5a1438f328866b10b3f0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ComponentVersion: 2
m_LightType: 4
m_BlendStyleIndex: 0
m_FalloffIntensity: 0.5
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_Intensity: 1
m_LightVolumeIntensity: 1
m_LightVolumeEnabled: 0
m_ApplyToSortingLayers: 00000000
m_LightCookieSprite: {fileID: 0}
m_DeprecatedPointLightCookieSprite: {fileID: 0}
m_LightOrder: 0
m_AlphaBlendOnOverlap: 0
m_OverlapOperation: 0
m_NormalMapDistance: 3
m_NormalMapQuality: 2
m_UseNormalMap: 0
m_ShadowsEnabled: 0
m_ShadowIntensity: 0.75
m_ShadowSoftness: 0
m_ShadowSoftnessFalloffIntensity: 0.5
m_ShadowVolumeIntensityEnabled: 0
m_ShadowVolumeIntensity: 0.75
m_LocalBounds:
m_Center: {x: 0, y: -0.00000011920929, z: 0}
m_Extent: {x: 0.9985302, y: 0.99853027, z: 0}
m_PointLightInnerAngle: 360
m_PointLightOuterAngle: 360
m_PointLightInnerRadius: 0
m_PointLightOuterRadius: 1
m_ShapeLightParametricSides: 5
m_ShapeLightParametricAngleOffset: 0
m_ShapeLightParametricRadius: 1
m_ShapeLightFalloffSize: 0.5
m_ShapeLightFalloffOffset: {x: 0, y: 0}
m_ShapePath:
- {x: -0.5, y: -0.5, z: 0}
- {x: 0.5, y: -0.5, z: 0}
- {x: 0.5, y: 0.5, z: 0}
- {x: -0.5, y: 0.5, z: 0}
--- !u!4 &619394802
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 619394800}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1229223783
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1229223785}
- component: {fileID: 1229223784}
- component: {fileID: 1229223786}
- component: {fileID: 1229223787}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!61 &1229223784
BoxCollider2D:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1229223783}
m_Enabled: 1
serializedVersion: 3
m_Density: 1
m_Material: {fileID: 0}
m_IncludeLayers:
serializedVersion: 2
m_Bits: 0
m_ExcludeLayers:
serializedVersion: 2
m_Bits: 0
m_LayerOverridePriority: 0
m_ForceSendLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ForceReceiveLayers:
serializedVersion: 2
m_Bits: 4294967295
m_ContactCaptureLayers:
serializedVersion: 2
m_Bits: 4294967295
m_CallbackLayers:
serializedVersion: 2
m_Bits: 4294967295
m_IsTrigger: 0
m_UsedByEffector: 0
m_CompositeOperation: 0
m_CompositeOrder: 0
m_Offset: {x: 0, y: 0}
m_SpriteTilingProperty:
border: {x: 0, y: 0, z: 0, w: 0}
pivot: {x: 0.5, y: 0.5}
oldSize: {x: 10.24, y: 10.24}
newSize: {x: 10.24, y: 10.24}
adaptiveTilingThreshold: 0.5
drawMode: 0
adaptiveTiling: 0
m_AutoTiling: 0
m_Size: {x: 1, y: 1}
m_EdgeRadius: 0
--- !u!4 &1229223785
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1229223783}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: -43.98, y: -0.72, z: -0.05641011}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!212 &1229223786
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1229223783}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_StaticShadowCaster: 0
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RayTracingMode: 0
m_RayTraceProcedural: 0
m_RayTracingAccelStructBuildFlagsOverride: 0
m_RayTracingAccelStructBuildFlags: 1
m_SmallMeshCulling: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 2100000, guid: a97c105638bdf8b4a8650670310a4cd3, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_ReceiveGI: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 1
m_SelectedEditorRenderState: 0
m_MinimumChartSize: 4
m_AutoUVMaxDistance: 0.5
m_AutoUVMaxAngle: 89
m_LightmapParameters: {fileID: 0}
m_SortingLayerID: 0
m_SortingLayer: 0
m_SortingOrder: 0
m_Sprite: {fileID: -2519740732571446246, guid: 20d10ea83d757e447aa38c5e77db9d5f, type: 3}
m_Color: {r: 0.21568628, g: 0.21568628, b: 0.21568628, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 10.24, y: 10.24}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!114 &1229223787
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1229223783}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c23a6c3771ca740beae200d91c2db263, type: 3}
m_Name:
m_EditorClassIdentifier:
position: {x: 0, y: 0}
--- !u!1 &1598401521
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1598401523}
- component: {fileID: 1598401522}
- component: {fileID: 1598401524}
m_Layer: 0
m_Name: board
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1598401522
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598401521}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 9e64f4618b0cb684d9ebdd01870e8089, type: 3}
m_Name:
m_EditorClassIdentifier:
whitePawnPrefab: {fileID: 4839719450102453836, guid: 314b98ad6af87f04b995a2963b6dece0, type: 3}
whiteRookPrefab: {fileID: 421683061016990142, guid: 7c0bcf43f072e0949b44e22faf6d89c7, type: 3}
whiteKnightPrefab: {fileID: 1041219497319770869, guid: d75b52b436d24604fbe519a4e811a9ad, type: 3}
whiteBishopPrefab: {fileID: 3436116337310627786, guid: f0cb0664b407c2b46b30cc3f7e77813a, type: 3}
whiteQueenPrefab: {fileID: 5862557536314685207, guid: 44e879c6ba4a30348bddad5621f4f788, type: 3}
whiteKingPrefab: {fileID: 728854981946252224, guid: d3abccdd8834a8d488bb64e85f1a07f3, type: 3}
blackPawnPrefab: {fileID: 3690398965028752334, guid: bf26022af485ebf4894d871ee2eaacff, type: 3}
blackRookPrefab: {fileID: 606859959840155736, guid: a4670a5a19525954a83d15ffa8e8c092, type: 3}
blackKnightPrefab: {fileID: 6303868409224350045, guid: 40216cc139956394c9c48c6ce43e5660, type: 3}
blackBishopPrefab: {fileID: 2192278787647510673, guid: eea577693c378de469fe920332dd8cdf, type: 3}
blackQueenPrefab: {fileID: 3123405151575453274, guid: ba3412a2f32dd264682017f86d25136f, type: 3}
blackKingPrefab: {fileID: 1673858317397921791, guid: 16e05df0bc66c724cbf583767c77e85c, type: 3}
brownPrefab: {fileID: 7499455593434025941, guid: 39ed7c0e02bdc9848a4a460964541f0b, type: 3}
grayPrefab: {fileID: 4764571787950824796, guid: 8b7e3d08bfcaf1841b88a178e4fdf776, type: 3}
moveIndicatorPrefab: {fileID: 3432395634358156766, guid: 56d9528e8b72645bcaafd6d809e82d64, type: 3}
boardParent: {fileID: 1598401523}
tileSize: 10.24
--- !u!4 &1598401523
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598401521}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 5.6320767, y: 5.220207, z: -0.05108271}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1598401524
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1598401521}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1203a8c50abf9ee4a8e6a24cf93b3b89, type: 3}
m_Name:
m_EditorClassIdentifier:
whiteTurn: 1
selectedPiece: {fileID: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 519420032}
- {fileID: 619394802}
- {fileID: 1598401523}
- {fileID: 1229223785}
- {fileID: 429894531}
+7
View File
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: c41004652ecf24fe7ae0955cda681d87
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+3
View File
@@ -17,6 +17,9 @@ public class BoardManager : MonoBehaviour
public GameObject blackQueenPrefab;
public GameObject blackKingPrefab;
public GameObject kingPrefab; // Prefab del Rey usado como "jefe" en el purgatorio
[Header("Prefabs de Casillas")]
public GameObject brownPrefab;
public GameObject grayPrefab;
+16
View File
@@ -0,0 +1,16 @@
using UnityEngine;
public class DadoSystem : MonoBehaviour
{
// Start is called once before the first execution of Update after the MonoBehaviour is created
void Start()
{
}
// Update is called once per frame
void Update()
{
}
}
@@ -0,0 +1,2 @@
fileFormatVersion: 2
guid: a1180e41d60ca4380b1e79cbd6c16c8b
+283 -6
View File
@@ -1,23 +1,107 @@
using UnityEngine;
using System.Linq;
public class GameManager : MonoBehaviour
{
public static GameManager Instance;
public bool modoIA = true; // Activá o desactivá IA según la escena
public Piece[,] board = new Piece[8, 8];
public bool whiteTurn = true;
public Piece selectedPiece = null;
private bool waitingForAIMove = false;
void Awake()
{
if (Instance == null) Instance = this;
else Destroy(gameObject);
}
private void Update()
{
if (modoIA && !whiteTurn && !waitingForAIMove)
{
waitingForAIMove = true;
Invoke("MakeAIMove", 0.5f);
}
}
void MakeAIMove()
{
waitingForAIMove = false;
// Obtener todas las piezas negras
var pieces = new System.Collections.Generic.List<Piece>();
foreach (var p in board)
{
if (p != null && !p.isWhite)
pieces.Add(p);
}
System.Random rand = new System.Random();
foreach (var piece in pieces.OrderBy(x => rand.Next()))
{
var moves = piece.GetAvailableMoves(board);
bool IsLegalMove(Piece piece, Vector2Int move)
{
Vector2Int oldPos = piece.currentPos;
Piece target = board[move.x, move.y];
board[oldPos.x, oldPos.y] = null;
board[move.x, move.y] = piece;
piece.currentPos = move;
bool legal = !IsInCheck(false);
piece.currentPos = oldPos;
board[oldPos.x, oldPos.y] = piece;
board[move.x, move.y] = target;
return legal;
}
// 1. Intentar capturas
foreach (var move in moves)
{
if (board[move.x, move.y] != null && board[move.x, move.y].isWhite)
{
if (IsLegalMove(piece, move))
{
MovePiece(piece, move);
return;
}
}
}
// 2. Si no hay capturas, moverse normal
foreach (var move in moves)
{
if (IsLegalMove(piece, move))
{
MovePiece(piece, move);
return;
}
}
}
Debug.Log("La IA no tiene movimientos legales.");
}
public void SelectPiece(Piece piece)
{
if (selectedPiece == piece)
{
selectedPiece.HideMoves();
selectedPiece = null;
return;
}
if (piece != null && piece.isWhite == whiteTurn)
{
if (selectedPiece != null)
selectedPiece.HideMoves();
selectedPiece = piece;
selectedPiece.ShowMoves();
}
@@ -28,22 +112,215 @@ public class GameManager : MonoBehaviour
if (selectedPiece == null) return;
var availableMoves = selectedPiece.GetAvailableMoves(board);
if (availableMoves.Contains(targetPos))
if (!availableMoves.Contains(targetPos)) return;
// Guardar estado anterior
Vector2Int oldPos = selectedPiece.currentPos;
Piece captured = board[targetPos.x, targetPos.y];
// Simular movimiento
board[oldPos.x, oldPos.y] = null;
board[targetPos.x, targetPos.y] = selectedPiece;
selectedPiece.currentPos = targetPos;
bool leavesKingInCheck = IsInCheck(selectedPiece.isWhite);
// Restaurar
selectedPiece.currentPos = oldPos;
board[oldPos.x, oldPos.y] = selectedPiece;
board[targetPos.x, targetPos.y] = captured;
if (leavesKingInCheck)
{
MovePiece(selectedPiece, targetPos);
selectedPiece.HideMoves();
selectedPiece = null;
Debug.Log("Movimiento no permitido: dejaría en jaque al rey.");
return;
}
// Ejecutar movimiento real
MovePiece(selectedPiece, targetPos);
selectedPiece.HideMoves();
selectedPiece = null;
}
public void MovePiece(Piece piece, Vector2Int newPos)
{
board[piece.currentPos.x, piece.currentPos.y] = null;
Vector2Int oldPos = piece.currentPos;
// Enroque (verificamos ANTES de mover al rey)
bool isKing = piece is King;
bool isCastling = isKing && Mathf.Abs(newPos.x - oldPos.x) == 2;
// Captura si hay una pieza enemiga
Piece captured = board[newPos.x, newPos.y];
if (captured != null)
{
Destroy(captured.gameObject);
}
// Mover pieza
board[oldPos.x, oldPos.y] = null;
board[newPos.x, newPos.y] = piece;
piece.transform.position = new Vector3(newPos.x * BoardManager.Instance.tileSize, newPos.y * BoardManager.Instance.tileSize, -1f);
piece.currentPos = newPos;
piece.hasMoved = true;
// Ejecutar enroque (mover torre)
if (isCastling)
{
int y = newPos.y;
if (newPos.x == 6) // Enroque corto
{
Piece rook = board[7, y];
board[7, y] = null;
board[5, y] = rook;
rook.transform.position = new Vector3(5 * BoardManager.Instance.tileSize, y * BoardManager.Instance.tileSize, -1f);
rook.currentPos = new Vector2Int(5, y);
rook.hasMoved = true;
}
else if (newPos.x == 2) // Enroque largo
{
Piece rook = board[0, y];
board[0, y] = null;
board[3, y] = rook;
rook.transform.position = new Vector3(3 * BoardManager.Instance.tileSize, y * BoardManager.Instance.tileSize, -1f);
rook.currentPos = new Vector2Int(3, y);
rook.hasMoved = true;
}
}
// Alternar turno
whiteTurn = !whiteTurn;
// Verificar jaque o jaque mate
bool isNextPlayerWhite = whiteTurn;
if (IsCheckmate(isNextPlayerWhite))
{
Debug.LogWarning($"¡Jaque mate! {(isNextPlayerWhite ? "Negras" : "Blancas")} pierden.");
}
else if (IsInCheck(isNextPlayerWhite))
{
Debug.LogWarning($"¡Jaque a {(isNextPlayerWhite ? "las blancas" : "las negras")}!");
}
// ✅ PROMOCIÓN DE PEÓN
if (piece is Pawn)
{
int finalRow = piece.isWhite ? 7 : 0;
if (piece.currentPos.y == finalRow)
{
PromotePawn(piece);
return; // Fin del turno luego de promoción
}
}
}
}
public void PromotePawn(Piece pawn)
{
Vector2Int pos = pawn.currentPos;
// Eliminar el peón
Destroy(pawn.gameObject);
// Crear nueva reina del mismo color
GameObject prefab = pawn.isWhite ? BoardManager.Instance.whiteQueenPrefab : BoardManager.Instance.blackQueenPrefab;
GameObject newPieceObj = Instantiate(prefab, new Vector3(pos.x * BoardManager.Instance.tileSize, pos.y * BoardManager.Instance.tileSize, -1f), Quaternion.identity);
Piece newPiece = newPieceObj.GetComponent<Piece>();
newPiece.currentPos = pos;
newPiece.isWhite = pawn.isWhite;
// Reemplazar en el tablero
board[pos.x, pos.y] = newPiece;
Debug.Log($"♟️ Peón promovido a Reina en {pos}");
}
public bool IsInCheck(bool forWhite)
{
Piece king = null;
foreach (var p in board)
{
if (p != null && p is King && p.isWhite == forWhite)
{
king = p;
break;
}
}
if (king == null) return false;
foreach (var p in board)
{
if (p != null && p.isWhite != forWhite)
{
var moves = p.GetAvailableMoves(board);
if (moves.Contains(king.currentPos))
return true;
}
}
return false;
}
public bool IsCheckmate(bool forWhite)
{
if (!IsInCheck(forWhite)) return false;
foreach (var piece in board)
{
if (piece != null && piece.isWhite == forWhite)
{
var moves = piece.GetAvailableMoves(board);
foreach (var move in moves)
{
Vector2Int oldPos = piece.currentPos;
Piece target = board[move.x, move.y];
board[oldPos.x, oldPos.y] = null;
board[move.x, move.y] = piece;
piece.currentPos = move;
bool leavesKingInCheck = IsInCheck(forWhite);
// Restaurar
piece.currentPos = oldPos;
board[oldPos.x, oldPos.y] = piece;
board[move.x, move.y] = target;
if (!leavesKingInCheck)
return false;
}
}
}
return true;
}
public bool IsInCheckSimulated(Piece[,] simBoard, bool forWhite)
{
Piece king = null;
foreach (var p in simBoard)
{
if (p != null && p is King && p.isWhite == forWhite)
{
king = p;
break;
}
}
if (king == null) return false;
foreach (var p in simBoard)
{
if (p != null && p.isWhite != forWhite)
{
var moves = p.GetAvailableMoves(simBoard);
if (moves.Contains(king.currentPos))
return true;
}
}
return false;
}
}
+54 -6
View File
@@ -6,20 +6,68 @@ public class King : Piece
public override List<Vector2Int> GetAvailableMoves(Piece[,] board)
{
List<Vector2Int> moves = new List<Vector2Int>();
// Movimientos normales (1 casilla alrededor)
Vector2Int[] directions = {
Vector2Int.up, Vector2Int.down, Vector2Int.left, Vector2Int.right,
new Vector2Int(1, 1), new Vector2Int(1, -1), new Vector2Int(-1, -1), new Vector2Int(-1, 1)
new Vector2Int(1, 1), new Vector2Int(-1, 1), new Vector2Int(1, -1), new Vector2Int(-1, -1)
};
foreach (var dir in directions)
{
Vector2Int pos = currentPos + dir;
if (IsInsideBoard(pos) && (board[pos.x, pos.y] == null || board[pos.x, pos.y].isWhite != isWhite))
moves.Add(pos);
if (IsInsideBoard(pos))
{
var target = board[pos.x, pos.y];
if (target == null || target.isWhite != isWhite)
moves.Add(pos);
}
}
bool IsInsideBoard(Vector2Int pos) {
return pos.x >= 0 && pos.x < 8 && pos.y >= 0 && pos.y < 8;
}
// Enroque (si el rey no se ha movido)
if (!hasMoved)
{
int y = currentPos.y;
// Enroque corto (torre derecha)
if (IsClearAndSafeForCastling(board, currentPos, new Vector2Int(7, y)))
moves.Add(new Vector2Int(6, y)); // El rey va a x=6
// Enroque largo (torre izquierda)
if (IsClearAndSafeForCastling(board, currentPos, new Vector2Int(0, y)))
moves.Add(new Vector2Int(2, y)); // El rey va a x=2
}
return moves;
}
private bool IsClearAndSafeForCastling(Piece[,] board, Vector2Int kingPos, Vector2Int rookPos)
{
Piece rook = board[rookPos.x, rookPos.y];
if (rook == null || !(rook is Rook) || rook.hasMoved || rook.isWhite != isWhite)
return false;
int direction = (rookPos.x - kingPos.x) > 0 ? 1 : -1;
for (int i = 1; i < Mathf.Abs(rookPos.x - kingPos.x); i++)
{
int x = kingPos.x + direction * i;
Vector2Int checkPos = new Vector2Int(x, kingPos.y);
if (board[x, kingPos.y] != null)
return false;
// Simula movimiento y verifica si el rey estaría en jaque en el trayecto
if (i <= 2)
{
Vector2Int simPos = new Vector2Int(x, kingPos.y);
Piece[,] simBoard = (Piece[,])board.Clone();
simBoard[kingPos.x, kingPos.y] = null;
simBoard[simPos.x, simPos.y] = this;
if (GameManager.Instance.IsInCheckSimulated(simBoard, isWhite))
return false;
}
}
return true;
}
}
+1
View File
@@ -5,6 +5,7 @@ public class Piece : MonoBehaviour
{
public bool isWhite;
public Vector2Int currentPos;
public bool hasMoved = false;
public virtual List<Vector2Int> GetAvailableMoves(Piece[,] board)
{