Added roll dice button
This commit is contained in:
parent
d04624edfd
commit
dbef10d80a
10 changed files with 472 additions and 82 deletions
|
|
@ -271,6 +271,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: edf2cd8ae662a415898ed6567457f32d, type: 3}
|
m_Script: {fileID: 11500000, guid: edf2cd8ae662a415898ed6567457f32d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
color: 0
|
||||||
dieButton: {fileID: 5247104008048868212}
|
dieButton: {fileID: 5247104008048868212}
|
||||||
--- !u!114 &-7124398980878284295
|
--- !u!114 &-7124398980878284295
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -285,5 +286,5 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_EffectColor: {r: 0.04705883, g: 0.79215693, b: 0, a: 0.5}
|
m_EffectColor: {r: 0.04705883, g: 0.79215693, b: 0, a: 0.5}
|
||||||
m_EffectDistance: {x: 1, y: -1}
|
m_EffectDistance: {x: 2, y: 2}
|
||||||
m_UseGraphicAlpha: 1
|
m_UseGraphicAlpha: 1
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ GameObject:
|
||||||
- component: {fileID: 1770509300873928573}
|
- component: {fileID: 1770509300873928573}
|
||||||
- component: {fileID: 2727030095425591755}
|
- component: {fileID: 2727030095425591755}
|
||||||
- component: {fileID: 4019891345885281529}
|
- component: {fileID: 4019891345885281529}
|
||||||
|
- component: {fileID: -1465197196826248026}
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: Room
|
m_Name: Room
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -106,21 +107,6 @@ MonoBehaviour:
|
||||||
numberTextObject: {fileID: 8119019481281764985}
|
numberTextObject: {fileID: 8119019481281764985}
|
||||||
adjacentRooms: []
|
adjacentRooms: []
|
||||||
isEntrance: 0
|
isEntrance: 0
|
||||||
validRoomClickedEvent:
|
|
||||||
m_PersistentCalls:
|
|
||||||
m_Calls:
|
|
||||||
- m_Target: {fileID: 11500000, guid: 85fe57d438ef1ec4fa8b36b9c17c11a4, type: 3}
|
|
||||||
m_TargetAssemblyTypeName: UnityEngine.Object, UnityEngine
|
|
||||||
m_MethodName: set_name
|
|
||||||
m_Mode: 5
|
|
||||||
m_Arguments:
|
|
||||||
m_ObjectArgument: {fileID: 0}
|
|
||||||
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
|
|
||||||
m_IntArgument: 0
|
|
||||||
m_FloatArgument: 0
|
|
||||||
m_StringArgument: ValidRoomClicked
|
|
||||||
m_BoolArgument: 0
|
|
||||||
m_CallState: 2
|
|
||||||
--- !u!61 &4019891345885281529
|
--- !u!61 &4019891345885281529
|
||||||
BoxCollider2D:
|
BoxCollider2D:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -167,6 +153,21 @@ BoxCollider2D:
|
||||||
m_AutoTiling: 0
|
m_AutoTiling: 0
|
||||||
m_Size: {x: 1, y: 1}
|
m_Size: {x: 1, y: 1}
|
||||||
m_EdgeRadius: 0
|
m_EdgeRadius: 0
|
||||||
|
--- !u!114 &-1465197196826248026
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 2435349004046080434}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: e19747de3f5aca642ab2be37e372fb86, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_EffectColor: {r: 0, g: 1, b: 0.09941673, a: 0.5}
|
||||||
|
m_EffectDistance: {x: 10, y: 10}
|
||||||
|
m_UseGraphicAlpha: 1
|
||||||
--- !u!1 &7488793311042651820
|
--- !u!1 &7488793311042651820
|
||||||
GameObject:
|
GameObject:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
|
|
@ -258,19 +258,7 @@ MonoBehaviour:
|
||||||
m_TargetGraphic: {fileID: 6156510816236760012}
|
m_TargetGraphic: {fileID: 6156510816236760012}
|
||||||
m_OnClick:
|
m_OnClick:
|
||||||
m_PersistentCalls:
|
m_PersistentCalls:
|
||||||
m_Calls:
|
m_Calls: []
|
||||||
- m_Target: {fileID: 0}
|
|
||||||
m_TargetAssemblyTypeName:
|
|
||||||
m_MethodName:
|
|
||||||
m_Mode: 1
|
|
||||||
m_Arguments:
|
|
||||||
m_ObjectArgument: {fileID: 0}
|
|
||||||
m_ObjectArgumentAssemblyTypeName:
|
|
||||||
m_IntArgument: 0
|
|
||||||
m_FloatArgument: 0
|
|
||||||
m_StringArgument:
|
|
||||||
m_BoolArgument: 0
|
|
||||||
m_CallState: 2
|
|
||||||
--- !u!114 &6084228361150234175
|
--- !u!114 &6084228361150234175
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
@ -283,6 +271,7 @@ MonoBehaviour:
|
||||||
m_Script: {fileID: 11500000, guid: edf2cd8ae662a415898ed6567457f32d, type: 3}
|
m_Script: {fileID: 11500000, guid: edf2cd8ae662a415898ed6567457f32d, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
color: 1
|
||||||
dieButton: {fileID: 5247104008048868212}
|
dieButton: {fileID: 5247104008048868212}
|
||||||
--- !u!114 &6840580988586272823
|
--- !u!114 &6840580988586272823
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
|
|
@ -297,5 +286,5 @@ MonoBehaviour:
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_EffectColor: {r: 0.045367185, g: 0.7924528, b: 0, a: 0.5}
|
m_EffectColor: {r: 0.045367185, g: 0.7924528, b: 0, a: 0.5}
|
||||||
m_EffectDistance: {x: 1, y: -1}
|
m_EffectDistance: {x: 2, y: 2}
|
||||||
m_UseGraphicAlpha: 1
|
m_UseGraphicAlpha: 1
|
||||||
|
|
|
||||||
|
|
@ -339,7 +339,6 @@ GameObject:
|
||||||
m_Component:
|
m_Component:
|
||||||
- component: {fileID: 126339302}
|
- component: {fileID: 126339302}
|
||||||
- component: {fileID: 126339304}
|
- component: {fileID: 126339304}
|
||||||
- component: {fileID: 126339305}
|
|
||||||
m_Layer: 0
|
m_Layer: 0
|
||||||
m_Name: GameManager
|
m_Name: GameManager
|
||||||
m_TagString: Untagged
|
m_TagString: Untagged
|
||||||
|
|
@ -376,20 +375,142 @@ MonoBehaviour:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
state: 0
|
state: 0
|
||||||
rooms: {fileID: 1820284205}
|
rooms: {fileID: 1820284205}
|
||||||
dice: {fileID: 925126051}
|
diceRoller: {fileID: 150116548}
|
||||||
diceRoller: {fileID: 126339305}
|
--- !u!1 &150116543
|
||||||
--- !u!114 &126339305
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 150116544}
|
||||||
|
- component: {fileID: 150116547}
|
||||||
|
- component: {fileID: 150116546}
|
||||||
|
- component: {fileID: 150116545}
|
||||||
|
- component: {fileID: 150116548}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Button
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &150116544
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 150116543}
|
||||||
|
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:
|
||||||
|
- {fileID: 943630895}
|
||||||
|
m_Father: {fileID: 281326036}
|
||||||
|
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: 346.17993, y: -216.5268}
|
||||||
|
m_SizeDelta: {x: 150.14, y: 30}
|
||||||
|
m_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &150116545
|
||||||
MonoBehaviour:
|
MonoBehaviour:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
m_CorrespondingSourceObject: {fileID: 0}
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
m_PrefabInstance: {fileID: 0}
|
m_PrefabInstance: {fileID: 0}
|
||||||
m_PrefabAsset: {fileID: 0}
|
m_PrefabAsset: {fileID: 0}
|
||||||
m_GameObject: {fileID: 126339301}
|
m_GameObject: {fileID: 150116543}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Navigation:
|
||||||
|
m_Mode: 3
|
||||||
|
m_WrapAround: 0
|
||||||
|
m_SelectOnUp: {fileID: 0}
|
||||||
|
m_SelectOnDown: {fileID: 0}
|
||||||
|
m_SelectOnLeft: {fileID: 0}
|
||||||
|
m_SelectOnRight: {fileID: 0}
|
||||||
|
m_Transition: 1
|
||||||
|
m_Colors:
|
||||||
|
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
|
||||||
|
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
|
||||||
|
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
|
||||||
|
m_ColorMultiplier: 1
|
||||||
|
m_FadeDuration: 0.1
|
||||||
|
m_SpriteState:
|
||||||
|
m_HighlightedSprite: {fileID: 0}
|
||||||
|
m_PressedSprite: {fileID: 0}
|
||||||
|
m_SelectedSprite: {fileID: 0}
|
||||||
|
m_DisabledSprite: {fileID: 0}
|
||||||
|
m_AnimationTriggers:
|
||||||
|
m_NormalTrigger: Normal
|
||||||
|
m_HighlightedTrigger: Highlighted
|
||||||
|
m_PressedTrigger: Pressed
|
||||||
|
m_SelectedTrigger: Selected
|
||||||
|
m_DisabledTrigger: Disabled
|
||||||
|
m_Interactable: 1
|
||||||
|
m_TargetGraphic: {fileID: 150116546}
|
||||||
|
m_OnClick:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
--- !u!114 &150116546
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 150116543}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||||
|
m_Type: 1
|
||||||
|
m_PreserveAspect: 0
|
||||||
|
m_FillCenter: 1
|
||||||
|
m_FillMethod: 4
|
||||||
|
m_FillAmount: 1
|
||||||
|
m_FillClockwise: 1
|
||||||
|
m_FillOrigin: 0
|
||||||
|
m_UseSpriteMesh: 0
|
||||||
|
m_PixelsPerUnitMultiplier: 1
|
||||||
|
--- !u!222 &150116547
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 150116543}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
|
--- !u!114 &150116548
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 150116543}
|
||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: 6b493144d8ebc4dda85e2070fb9573e7, type: 3}
|
m_Script: {fileID: 11500000, guid: 6b493144d8ebc4dda85e2070fb9573e7, type: 3}
|
||||||
m_Name:
|
m_Name:
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
|
rollDiceButton: {fileID: 150116545}
|
||||||
dice: {fileID: 925126051}
|
dice: {fileID: 925126051}
|
||||||
--- !u!1001 &207688839
|
--- !u!1001 &207688839
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
|
|
@ -588,6 +709,7 @@ RectTransform:
|
||||||
m_ConstrainProportionsScale: 0
|
m_ConstrainProportionsScale: 0
|
||||||
m_Children:
|
m_Children:
|
||||||
- {fileID: 925126052}
|
- {fileID: 925126052}
|
||||||
|
- {fileID: 150116544}
|
||||||
m_Father: {fileID: 0}
|
m_Father: {fileID: 0}
|
||||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||||
m_AnchorMin: {x: 0, y: 0}
|
m_AnchorMin: {x: 0, y: 0}
|
||||||
|
|
@ -1026,6 +1148,10 @@ PrefabInstance:
|
||||||
serializedVersion: 3
|
serializedVersion: 3
|
||||||
m_TransformParent: {fileID: 1820284206}
|
m_TransformParent: {fileID: 1820284206}
|
||||||
m_Modifications:
|
m_Modifications:
|
||||||
|
- target: {fileID: -8164017665964585763, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
||||||
|
propertyPath: m_Enabled
|
||||||
|
value: 1
|
||||||
|
objectReference: {fileID: 0}
|
||||||
- target: {fileID: 2435349004046080434, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
- target: {fileID: 2435349004046080434, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
||||||
propertyPath: m_Name
|
propertyPath: m_Name
|
||||||
value: Room (2)
|
value: Room (2)
|
||||||
|
|
@ -1103,6 +1229,142 @@ PrefabInstance:
|
||||||
m_AddedGameObjects: []
|
m_AddedGameObjects: []
|
||||||
m_AddedComponents: []
|
m_AddedComponents: []
|
||||||
m_SourcePrefab: {fileID: 100100000, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
m_SourcePrefab: {fileID: 100100000, guid: 92d87e25cc40b3e448e62e8ba0328315, type: 3}
|
||||||
|
--- !u!1 &943630894
|
||||||
|
GameObject:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
serializedVersion: 6
|
||||||
|
m_Component:
|
||||||
|
- component: {fileID: 943630895}
|
||||||
|
- component: {fileID: 943630897}
|
||||||
|
- component: {fileID: 943630896}
|
||||||
|
m_Layer: 5
|
||||||
|
m_Name: Text (TMP)
|
||||||
|
m_TagString: Untagged
|
||||||
|
m_Icon: {fileID: 0}
|
||||||
|
m_NavMeshLayer: 0
|
||||||
|
m_StaticEditorFlags: 0
|
||||||
|
m_IsActive: 1
|
||||||
|
--- !u!224 &943630895
|
||||||
|
RectTransform:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 943630894}
|
||||||
|
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: 150116544}
|
||||||
|
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_Pivot: {x: 0.5, y: 0.5}
|
||||||
|
--- !u!114 &943630896
|
||||||
|
MonoBehaviour:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 943630894}
|
||||||
|
m_Enabled: 1
|
||||||
|
m_EditorHideFlags: 0
|
||||||
|
m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3}
|
||||||
|
m_Name:
|
||||||
|
m_EditorClassIdentifier:
|
||||||
|
m_Material: {fileID: 0}
|
||||||
|
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_RaycastTarget: 1
|
||||||
|
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_Maskable: 1
|
||||||
|
m_OnCullStateChanged:
|
||||||
|
m_PersistentCalls:
|
||||||
|
m_Calls: []
|
||||||
|
m_text: 'Roll '
|
||||||
|
m_isRightToLeft: 0
|
||||||
|
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||||
|
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||||
|
m_fontSharedMaterials: []
|
||||||
|
m_fontMaterial: {fileID: 0}
|
||||||
|
m_fontMaterials: []
|
||||||
|
m_fontColor32:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4281479730
|
||||||
|
m_fontColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
|
||||||
|
m_enableVertexGradient: 0
|
||||||
|
m_colorMode: 3
|
||||||
|
m_fontColorGradient:
|
||||||
|
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
bottomLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
bottomRight: {r: 1, g: 1, b: 1, a: 1}
|
||||||
|
m_fontColorGradientPreset: {fileID: 0}
|
||||||
|
m_spriteAsset: {fileID: 0}
|
||||||
|
m_tintAllSprites: 0
|
||||||
|
m_StyleSheet: {fileID: 0}
|
||||||
|
m_TextStyleHashCode: -1183493901
|
||||||
|
m_overrideHtmlColors: 0
|
||||||
|
m_faceColor:
|
||||||
|
serializedVersion: 2
|
||||||
|
rgba: 4294967295
|
||||||
|
m_fontSize: 24
|
||||||
|
m_fontSizeBase: 24
|
||||||
|
m_fontWeight: 400
|
||||||
|
m_enableAutoSizing: 0
|
||||||
|
m_fontSizeMin: 18
|
||||||
|
m_fontSizeMax: 72
|
||||||
|
m_fontStyle: 0
|
||||||
|
m_HorizontalAlignment: 2
|
||||||
|
m_VerticalAlignment: 512
|
||||||
|
m_textAlignment: 65535
|
||||||
|
m_characterSpacing: 0
|
||||||
|
m_wordSpacing: 0
|
||||||
|
m_lineSpacing: 0
|
||||||
|
m_lineSpacingMax: 0
|
||||||
|
m_paragraphSpacing: 0
|
||||||
|
m_charWidthMaxAdj: 0
|
||||||
|
m_TextWrappingMode: 1
|
||||||
|
m_wordWrappingRatios: 0.4
|
||||||
|
m_overflowMode: 0
|
||||||
|
m_linkedTextComponent: {fileID: 0}
|
||||||
|
parentLinkedComponent: {fileID: 0}
|
||||||
|
m_enableKerning: 0
|
||||||
|
m_ActiveFontFeatures: 6e72656b
|
||||||
|
m_enableExtraPadding: 0
|
||||||
|
checkPaddingRequired: 0
|
||||||
|
m_isRichText: 1
|
||||||
|
m_EmojiFallbackSupport: 1
|
||||||
|
m_parseCtrlCharacters: 1
|
||||||
|
m_isOrthographic: 1
|
||||||
|
m_isCullingEnabled: 0
|
||||||
|
m_horizontalMapping: 0
|
||||||
|
m_verticalMapping: 0
|
||||||
|
m_uvLineOffset: 0
|
||||||
|
m_geometrySortingOrder: 0
|
||||||
|
m_IsTextObjectScaleStatic: 0
|
||||||
|
m_VertexBufferAutoSizeReduction: 0
|
||||||
|
m_useMaxVisibleDescender: 1
|
||||||
|
m_pageToDisplay: 1
|
||||||
|
m_margin: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
m_isUsingLegacyAnimationComponent: 0
|
||||||
|
m_isVolumetricText: 0
|
||||||
|
m_hasFontAssetChanged: 0
|
||||||
|
m_baseMaterial: {fileID: 0}
|
||||||
|
m_maskOffset: {x: 0, y: 0, z: 0, w: 0}
|
||||||
|
--- !u!222 &943630897
|
||||||
|
CanvasRenderer:
|
||||||
|
m_ObjectHideFlags: 0
|
||||||
|
m_CorrespondingSourceObject: {fileID: 0}
|
||||||
|
m_PrefabInstance: {fileID: 0}
|
||||||
|
m_PrefabAsset: {fileID: 0}
|
||||||
|
m_GameObject: {fileID: 943630894}
|
||||||
|
m_CullTransparentMesh: 1
|
||||||
--- !u!1001 &944208634
|
--- !u!1001 &944208634
|
||||||
PrefabInstance:
|
PrefabInstance:
|
||||||
m_ObjectHideFlags: 0
|
m_ObjectHideFlags: 0
|
||||||
|
|
|
||||||
46
PuzzleGameProject/Assets/Scripts/DicePair.cs
Normal file
46
PuzzleGameProject/Assets/Scripts/DicePair.cs
Normal file
|
|
@ -0,0 +1,46 @@
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
public class DicePair
|
||||||
|
{
|
||||||
|
private (Die, Die) _pair = (null, null);
|
||||||
|
|
||||||
|
public void SelectDie(Die die)
|
||||||
|
{
|
||||||
|
if (_pair.Item1 == null && _pair.Item2 == null)
|
||||||
|
{
|
||||||
|
_pair.Item1 = die;
|
||||||
|
die.DieBeingUsed(true, false);
|
||||||
|
}
|
||||||
|
else if (_pair.Item2 == null)
|
||||||
|
{
|
||||||
|
_pair.Item2 = die;
|
||||||
|
_pair.Item1.DieBeingUsed(true, true);
|
||||||
|
die.DieBeingUsed(true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool IsDieInPair(Die die)
|
||||||
|
{
|
||||||
|
if (_pair.Item1 == die || _pair.Item2 == die)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public bool AreBothDiceSelected()
|
||||||
|
{
|
||||||
|
if (_pair.Item1 != null && _pair.Item2 != null)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int Sum()
|
||||||
|
{
|
||||||
|
return _pair.Item1.GetResult() + _pair.Item2.GetResult();
|
||||||
|
}
|
||||||
|
}
|
||||||
2
PuzzleGameProject/Assets/Scripts/DicePair.cs.meta
Normal file
2
PuzzleGameProject/Assets/Scripts/DicePair.cs.meta
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: df5fed04808fcf647aa3639c21e2bb2e
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.UI;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using static TagsAndLayers;
|
using static TagsAndLayers;
|
||||||
|
|
@ -13,10 +14,29 @@ public class DiceRoller: MonoBehaviour
|
||||||
private List<int> _rolledWhiteDice = new List<int>();
|
private List<int> _rolledWhiteDice = new List<int>();
|
||||||
private List<int> _rolledBlackDice = new List<int>();
|
private List<int> _rolledBlackDice = new List<int>();
|
||||||
private System.Random _randomGen = new System.Random();
|
private System.Random _randomGen = new System.Random();
|
||||||
|
[SerializeField] private Button rollDiceButton;
|
||||||
|
|
||||||
public GameObject dice;
|
public GameObject dice;
|
||||||
|
public event EventHandler diceRolled;
|
||||||
|
|
||||||
public void RollDice() {
|
private void Start()
|
||||||
|
{
|
||||||
|
rollDiceButton.onClick.AddListener(RollDice);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Enable()
|
||||||
|
{
|
||||||
|
rollDiceButton.interactable = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Disable()
|
||||||
|
{
|
||||||
|
rollDiceButton.interactable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void RollDice() {
|
||||||
|
_rolledWhiteDice.Clear();
|
||||||
|
_rolledBlackDice.Clear();
|
||||||
for (int i = 0; i < NUMBER_OF_WHITE_DICE; i++)
|
for (int i = 0; i < NUMBER_OF_WHITE_DICE; i++)
|
||||||
{
|
{
|
||||||
_rolledWhiteDice.Add(_randomGen.Next(1,6));
|
_rolledWhiteDice.Add(_randomGen.Next(1,6));
|
||||||
|
|
@ -25,9 +45,18 @@ public class DiceRoller: MonoBehaviour
|
||||||
{
|
{
|
||||||
_rolledBlackDice.Add(_randomGen.Next(1,6));
|
_rolledBlackDice.Add(_randomGen.Next(1,6));
|
||||||
}
|
}
|
||||||
|
diceRolled?.Invoke(this, EventArgs.Empty);
|
||||||
UpdateGUI();
|
UpdateGUI();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void ResetDice()
|
||||||
|
{
|
||||||
|
foreach (Transform dieTransform in dice.transform)
|
||||||
|
{
|
||||||
|
dieTransform.GetComponent<Die>().ResetDie();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateGUI() {
|
private void UpdateGUI() {
|
||||||
// Get dice object from the game objects with the right tag.
|
// Get dice object from the game objects with the right tag.
|
||||||
Die[] whiteDice = Helper.GetTaggedChildren(dice, WHITE_DIE_TAG).Select(die => die.GetComponent<Die>())
|
Die[] whiteDice = Helper.GetTaggedChildren(dice, WHITE_DIE_TAG).Select(die => die.GetComponent<Die>())
|
||||||
|
|
@ -45,4 +74,5 @@ public class DiceRoller: MonoBehaviour
|
||||||
blackDice[i].SetResult(_rolledBlackDice[i]);
|
blackDice[i].SetResult(_rolledBlackDice[i]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,25 @@ using TMPro;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.UI;
|
using UnityEngine.UI;
|
||||||
|
|
||||||
|
public enum DiceColor
|
||||||
|
{
|
||||||
|
Black,
|
||||||
|
White,
|
||||||
|
}
|
||||||
|
|
||||||
public class Die : MonoBehaviour
|
public class Die : MonoBehaviour
|
||||||
{
|
{
|
||||||
|
public DiceColor color;
|
||||||
private int _result = 0;
|
private int _result = 0;
|
||||||
[SerializeField] private Button dieButton = null; // assign in the editor
|
[SerializeField] private Button dieButton; // assign in the editor
|
||||||
|
private Color originalColor;
|
||||||
public event EventHandler<Die> DieClicked;
|
public event EventHandler<Die> DieClicked;
|
||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
dieButton.onClick.AddListener(() => { DiePressed();});
|
dieButton.onClick.AddListener(() => { DiePressed();});
|
||||||
|
|
||||||
|
originalColor = gameObject.GetComponent<Image>().color;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetResult(int result) {
|
public void SetResult(int result) {
|
||||||
|
|
@ -24,8 +34,9 @@ public class Die : MonoBehaviour
|
||||||
return _result;
|
return _result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ClearDie() {
|
public void ResetDie()
|
||||||
gameObject.GetComponent<TextMeshProUGUI>().text = String.Empty;
|
{
|
||||||
|
gameObject.GetComponent<Image>().color = originalColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void DieBeingUsed(bool isFirstPair, bool isPairComplete)
|
public void DieBeingUsed(bool isFirstPair, bool isPairComplete)
|
||||||
|
|
@ -54,6 +65,7 @@ public class Die : MonoBehaviour
|
||||||
|
|
||||||
private void DieSelectedAndPairComplete()
|
private void DieSelectedAndPairComplete()
|
||||||
{
|
{
|
||||||
|
gameObject.GetComponent<Outline>().enabled = false;
|
||||||
gameObject.GetComponent<Image>().color =
|
gameObject.GetComponent<Image>().color =
|
||||||
ColorHelper.AddColorTint(gameObject.GetComponent<Image>().color, ColorHelper.OkayGreen, 0.5f);
|
ColorHelper.AddColorTint(gameObject.GetComponent<Image>().color, ColorHelper.OkayGreen, 0.5f);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,11 @@ using System;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using Object = UnityEngine.Object;
|
using Object = UnityEngine.Object;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using TMPro;
|
||||||
|
|
||||||
public enum GameState
|
public enum GameState
|
||||||
{
|
{
|
||||||
|
RollDice,
|
||||||
PickRoomOne,
|
PickRoomOne,
|
||||||
PickRoomTwo,
|
PickRoomTwo,
|
||||||
PickDiceOne,
|
PickDiceOne,
|
||||||
|
|
@ -12,28 +14,35 @@ public enum GameState
|
||||||
}
|
}
|
||||||
public class GameManager : MonoBehaviour
|
public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
public GameState state;
|
[SerializeField] private GameState state;
|
||||||
public GameObject rooms;
|
[SerializeField] private GameObject rooms;
|
||||||
public GameObject dice;
|
[SerializeField] private DiceRoller diceRoller;
|
||||||
public DiceRoller diceRoller;
|
|
||||||
|
|
||||||
private (Die, Die) _dicePairOne = (null, null);
|
private DicePair _dicePairOne = new DicePair();
|
||||||
private (Die, Die) _dicePairTwo = (null, null);
|
private DicePair _dicePairTwo = new DicePair();
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
state = GameState.PickDiceOne;
|
diceRoller.diceRolled += DiceRolled;
|
||||||
foreach (Transform roomTransform in rooms.transform)
|
foreach (Transform roomTransform in rooms.transform)
|
||||||
{
|
{
|
||||||
roomTransform.gameObject.GetComponent<Room>().ValidRoomClicked += ValidRoomClicked;
|
roomTransform.gameObject.GetComponent<Room>().ValidRoomClicked += ValidRoomClicked;
|
||||||
}
|
}
|
||||||
|
foreach (Transform diceTransform in diceRoller.dice.transform)
|
||||||
foreach (Transform diceTransform in dice.transform)
|
|
||||||
{
|
{
|
||||||
diceTransform.gameObject.GetComponent<Die>().DieClicked += DieClicked;
|
diceTransform.gameObject.GetComponent<Die>().DieClicked += DieClicked;
|
||||||
}
|
}
|
||||||
diceRoller.RollDice();
|
StartNewTurn();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void StartNewTurn()
|
||||||
|
{
|
||||||
|
state = GameState.RollDice;
|
||||||
|
diceRoller.Enable();
|
||||||
|
diceRoller.ResetDice();
|
||||||
|
_dicePairOne = new DicePair();
|
||||||
|
_dicePairTwo = new DicePair();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ValidRoomClicked(object sender, Room room) {
|
void ValidRoomClicked(object sender, Room room) {
|
||||||
|
|
@ -41,6 +50,14 @@ public class GameManager : MonoBehaviour
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case GameState.PickRoomOne when room.number != _dicePairOne.Sum():
|
||||||
|
case GameState.PickRoomTwo when room.number != _dicePairTwo.Sum():
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
room.SetRoomExplored();
|
room.SetRoomExplored();
|
||||||
if (state == GameState.PickRoomOne)
|
if (state == GameState.PickRoomOne)
|
||||||
{
|
{
|
||||||
|
|
@ -48,7 +65,7 @@ public class GameManager : MonoBehaviour
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Not implemented
|
StartNewTurn();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -60,43 +77,59 @@ public class GameManager : MonoBehaviour
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state == GameState.PickDiceOne)
|
switch (state)
|
||||||
{
|
{
|
||||||
if (_dicePairOne.Item1 == null && _dicePairOne.Item2 == null)
|
case GameState.PickDiceOne:
|
||||||
{
|
{
|
||||||
_dicePairOne.Item1 = die;
|
if (!_dicePairOne.IsDieInPair(die))
|
||||||
die.DieBeingUsed(true, false);
|
|
||||||
}
|
|
||||||
else if (_dicePairOne.Item2 == null)
|
|
||||||
{
|
{
|
||||||
_dicePairOne.Item2 = die;
|
_dicePairOne.SelectDie(die);
|
||||||
_dicePairOne.Item1.DieBeingUsed(true, true);
|
|
||||||
die.DieBeingUsed(true, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_dicePairOne.Item1 != null && _dicePairOne.Item2 != null)
|
if (_dicePairOne.AreBothDiceSelected())
|
||||||
{
|
{
|
||||||
state = GameState.PickRoomOne;
|
state = GameState.PickRoomOne;
|
||||||
|
HighLightValidRoomsWithNumber(_dicePairOne.Sum());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(state == GameState.PickDiceTwo)
|
|
||||||
{
|
|
||||||
if (_dicePairTwo.Item1 == null && _dicePairTwo.Item2 == null)
|
|
||||||
{
|
|
||||||
_dicePairTwo.Item1 = die;
|
|
||||||
die.DieBeingUsed(false, false);
|
|
||||||
}
|
|
||||||
else if (_dicePairTwo.Item2 == null)
|
|
||||||
{
|
|
||||||
_dicePairTwo.Item2 = die;
|
|
||||||
_dicePairTwo.Item1.DieBeingUsed(false, true);
|
|
||||||
die.DieBeingUsed(false, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_dicePairTwo.Item1 != null && _dicePairTwo.Item2 != null)
|
break;
|
||||||
|
}
|
||||||
|
case GameState.PickDiceTwo:
|
||||||
|
{
|
||||||
|
if (!_dicePairTwo.IsDieInPair(die))
|
||||||
|
{
|
||||||
|
_dicePairTwo.SelectDie(die);
|
||||||
|
|
||||||
|
if (_dicePairTwo.AreBothDiceSelected())
|
||||||
{
|
{
|
||||||
state = GameState.PickRoomTwo;
|
state = GameState.PickRoomTwo;
|
||||||
|
HighLightValidRoomsWithNumber(_dicePairTwo.Sum());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void HighLightValidRoomsWithNumber(int number)
|
||||||
|
{
|
||||||
|
foreach (Transform roomTransform in rooms.transform)
|
||||||
|
{
|
||||||
|
Room room = roomTransform.gameObject.GetComponent<Room>();
|
||||||
|
if (room.number == number && room.IsValidRoomToExplore())
|
||||||
|
{
|
||||||
|
room.HighlightRoomAsOption();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DiceRolled(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
if (state == GameState.RollDice)
|
||||||
|
{
|
||||||
|
diceRoller.Disable();
|
||||||
|
state = GameState.PickDiceOne;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,8 @@ public class Room : MonoBehaviour
|
||||||
|
|
||||||
bool _isExplored = false;
|
bool _isExplored = false;
|
||||||
|
|
||||||
|
private Color _roomNumberOriginalColor;
|
||||||
|
|
||||||
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
// Start is called once before the first execution of Update after the MonoBehaviour is created
|
||||||
void Start() {
|
void Start() {
|
||||||
|
|
||||||
|
|
@ -28,10 +30,22 @@ public class Room : MonoBehaviour
|
||||||
|
|
||||||
public void SetRoomExplored() {
|
public void SetRoomExplored() {
|
||||||
_isExplored = true;
|
_isExplored = true;
|
||||||
|
UnhighlightRoomAsOption();
|
||||||
gameObject.GetComponent<SpriteRenderer>().color =
|
gameObject.GetComponent<SpriteRenderer>().color =
|
||||||
ColorHelper.AddColorTint(gameObject.GetComponent<SpriteRenderer>().color, Color.grey, 0.5f);
|
ColorHelper.AddColorTint(gameObject.GetComponent<SpriteRenderer>().color, Color.grey, 0.5f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void HighlightRoomAsOption()
|
||||||
|
{
|
||||||
|
_roomNumberOriginalColor = gameObject.GetComponentInChildren<TextMeshProUGUI>().color;
|
||||||
|
gameObject.GetComponentInChildren<TextMeshProUGUI>().color = Color.blue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void UnhighlightRoomAsOption()
|
||||||
|
{
|
||||||
|
gameObject.GetComponentInChildren<TextMeshProUGUI>().color = _roomNumberOriginalColor;
|
||||||
|
}
|
||||||
|
|
||||||
void SetPropertiesOfEntrance() {
|
void SetPropertiesOfEntrance() {
|
||||||
gameObject.GetComponent<SpriteRenderer>().color = Color.green;
|
gameObject.GetComponent<SpriteRenderer>().color = Color.green;
|
||||||
isEntrance = true;
|
isEntrance = true;
|
||||||
|
|
@ -50,7 +64,7 @@ public class Room : MonoBehaviour
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if the room is valid to be explored. If so trigger the event.
|
// Check if the room is valid to be explored. If so trigger the event.
|
||||||
bool IsValidRoomToExplore() {
|
public bool IsValidRoomToExplore() {
|
||||||
if (_isExplored) {
|
if (_isExplored) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue