diff --git a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset index 91e8b733..ab497e9d 100644 --- a/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset +++ b/Assets/AddressableAssetsData/AssetGroups/Default Local Group.asset @@ -97,6 +97,11 @@ MonoBehaviour: m_ReadOnly: 0 m_SerializedLabels: [] FlaggedDuringContentUpdateRestriction: 0 + - m_GUID: c2b7405bf50773e4f8aff58974382739 + m_Address: 2DRoomDatabase + m_ReadOnly: 0 + m_SerializedLabels: [] + FlaggedDuringContentUpdateRestriction: 0 m_ReadOnly: 0 m_Settings: {fileID: 11400000, guid: ff7884a8fcd03c24da0fe8943408fe28, type: 2} m_SchemaSet: diff --git a/Assets/RoomLayout3DSample.prefab b/Assets/RoomLayout3DSample.prefab deleted file mode 100644 index 4e3fe0dd..00000000 --- a/Assets/RoomLayout3DSample.prefab +++ /dev/null @@ -1,1016 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &1076302745426238510 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7777216906818483300} - - component: {fileID: 2110678005934912462} - - component: {fileID: 7889669602441741844} - - component: {fileID: 3756781135328604533} - m_Layer: 5 - m_Name: Generate Button - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &7777216906818483300 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1076302745426238510} - 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: 6322065713252779714} - m_Father: {fileID: 3596939867296720340} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -55, y: 20} - m_SizeDelta: {x: 100, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &2110678005934912462 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1076302745426238510} - m_CullTransparentMesh: 1 ---- !u!114 &7889669602441741844 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1076302745426238510} - 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!114 &3756781135328604533 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1076302745426238510} - 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: 7889669602441741844} - m_OnClick: - m_PersistentCalls: - m_Calls: [] ---- !u!1 &1099883563515123343 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4412752406268625309} - - component: {fileID: 8332923643602563592} - m_Layer: 0 - m_Name: Generation Pipeline - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4412752406268625309 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1099883563515123343} - 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: - - {fileID: 3036341273802328731} - - {fileID: 4888033908279181473} - m_Father: {fileID: 4050978783237717444} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8332923643602563592 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1099883563515123343} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 19db6a7ce4f4b674fbf1d0101cdd4192, type: 3} - m_Name: - m_EditorClassIdentifier: - _manualInputNames: [] ---- !u!1 &1888865753194386226 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7797675109194394742} - - component: {fileID: 4431158065352477186} - m_Layer: 0 - m_Name: Directional Light - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &7797675109194394742 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1888865753194386226} - 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: 4050978783237717444} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!108 &4431158065352477186 -Light: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1888865753194386226} - m_Enabled: 1 - serializedVersion: 10 - m_Type: 1 - m_Shape: 0 - m_Color: {r: 1, g: 1, b: 1, a: 1} - m_Intensity: 1 - m_Range: 10 - m_SpotAngle: 30 - m_InnerSpotAngle: 21.80208 - m_CookieSize: 10 - m_Shadows: - m_Type: 0 - m_Resolution: -1 - m_CustomResolution: -1 - m_Strength: 1 - m_Bias: 0.05 - m_NormalBias: 0.4 - m_NearPlane: 0.2 - m_CullingMatrixOverride: - e00: 1 - e01: 0 - e02: 0 - e03: 0 - e10: 0 - e11: 1 - e12: 0 - e13: 0 - e20: 0 - e21: 0 - e22: 1 - e23: 0 - e30: 0 - e31: 0 - e32: 0 - e33: 1 - m_UseCullingMatrixOverride: 0 - m_Cookie: {fileID: 0} - m_DrawHalo: 0 - m_Flare: {fileID: 0} - m_RenderMode: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingLayerMask: 1 - m_Lightmapping: 4 - m_LightShadowCasterMode: 0 - m_AreaSize: {x: 1, y: 1} - m_BounceIntensity: 1 - m_ColorTemperature: 6570 - m_UseColorTemperature: 0 - m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} - m_UseBoundingSphereOverride: 0 - m_UseViewFrustumForShadowCasterCull: 1 - m_ShadowRadius: 0 - m_ShadowAngle: 0 ---- !u!1 &2119546626425103458 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6322065713252779714} - - component: {fileID: 4104036609472376100} - - component: {fileID: 6999151602467033962} - m_Layer: 5 - m_Name: Text (Legacy) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6322065713252779714 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2119546626425103458} - 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: 7777216906818483300} - 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!222 &4104036609472376100 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2119546626425103458} - m_CullTransparentMesh: 1 ---- !u!114 &6999151602467033962 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2119546626425103458} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Material: {fileID: 0} - m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Generate ---- !u!1 &2256363436741931137 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6501157024016777563} - - component: {fileID: 280778200424763550} - - component: {fileID: 882363242474255823} - m_Layer: 5 - m_Name: Message Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &6501157024016777563 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2256363436741931137} - 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: 3596939867296720340} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 1, y: 0} - m_AnchorMax: {x: 1, y: 0} - m_AnchoredPosition: {x: -364, y: 20} - m_SizeDelta: {x: 500, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &280778200424763550 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2256363436741931137} - m_CullTransparentMesh: 1 ---- !u!114 &882363242474255823 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2256363436741931137} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 5 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: ---- !u!1 &2417338265586182070 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4888033908279181473} - - component: {fileID: 8134747245679379001} - - component: {fileID: 5073614169441141135} - - component: {fileID: 6914307704039066579} - - component: {fileID: 765354034001689843} - m_Layer: 0 - m_Name: Steps - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4888033908279181473 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2417338265586182070} - 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: 4412752406268625309} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8134747245679379001 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2417338265586182070} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 84fbeaf6e591aeb4580ff66f2f58f56b, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &5073614169441141135 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2417338265586182070} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f760f06c26c6e349bc75c5b47517ca3, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &6914307704039066579 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2417338265586182070} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 74bfe5d9a1b55754b94deb8d47f6e1a5, type: 3} - m_Name: - m_EditorClassIdentifier: - _maxRebases: 100 - _rebaseDecayRate: 0.25 - _maxBranchLength: -1 ---- !u!114 &765354034001689843 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2417338265586182070} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6161d5de00c0bda489c314061bcfa906, type: 3} - m_Name: - m_EditorClassIdentifier: - _doorPower: 2 - _neighborPower: 1 - _initialNeighborWeight: 1000 ---- !u!1 &2770929418188478944 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 4050978783237717444} - - component: {fileID: 6206200399520195382} - m_Layer: 0 - m_Name: RoomLayout3DSample - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &4050978783237717444 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2770929418188478944} - 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: - - {fileID: 7797675109194394742} - - {fileID: 4412752406268625309} - - {fileID: 3596939867296720340} - - {fileID: 7482709730123672468} - - {fileID: 6819689380132494692} - m_Father: {fileID: 0} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &6206200399520195382 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 2770929418188478944} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ad9e55f99588b6b4abd613d419f01ef2, type: 3} - m_Name: - m_EditorClassIdentifier: - _pipeline: {fileID: 8332923643602563592} - _roomTemplateDatabase: {fileID: 11400000, guid: 588982ebd3c34454f99188d6b1045d34, type: 2} - _generateButton: {fileID: 3756781135328604533} - _messageLabel: {fileID: 882363242474255823} - _camera: {fileID: 3912125800419363074} - _cellSize: {x: 6, y: 6} ---- !u!1 &3251324666430026848 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 681408972012493748} - - component: {fileID: 6848211310171117157} - - component: {fileID: 5755433137216447432} - m_Layer: 5 - m_Name: Instructions Text - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &681408972012493748 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3251324666430026848} - 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: 3596939867296720340} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 155, y: 55} - m_SizeDelta: {x: 300, y: 100} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &6848211310171117157 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3251324666430026848} - m_CullTransparentMesh: 1 ---- !u!114 &5755433137216447432 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3251324666430026848} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, 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_FontData: - m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 6 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: 'Pan = Right Click & Drag - - Zoom = Middle Mouse Wheel' ---- !u!1 &4568332546805205863 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 7482709730123672468} - - component: {fileID: 950863399857710347} - - component: {fileID: 916279882127636907} - m_Layer: 0 - m_Name: EventSystem - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &7482709730123672468 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4568332546805205863} - 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: 4050978783237717444} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &950863399857710347 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4568332546805205863} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 76c392e42b5098c458856cdf6ecaaaa1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FirstSelected: {fileID: 0} - m_sendNavigationEvents: 1 - m_DragThreshold: 10 ---- !u!114 &916279882127636907 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 4568332546805205863} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4f231c4fb786f3946a6b90b886c48677, type: 3} - m_Name: - m_EditorClassIdentifier: - m_SendPointerHoverToParent: 1 - m_HorizontalAxis: Horizontal - m_VerticalAxis: Vertical - m_SubmitButton: Submit - m_CancelButton: Cancel - m_InputActionsPerSecond: 10 - m_RepeatDelay: 0.5 - m_ForceModuleActive: 0 ---- !u!1 &7718724787770266755 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3036341273802328731} - - component: {fileID: 4526092917022738538} - - component: {fileID: 5658977181872490055} - - component: {fileID: 9064858091588797620} - - component: {fileID: 458368701357693900} - m_Layer: 0 - m_Name: Inputs - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3036341273802328731 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7718724787770266755} - 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: 4412752406268625309} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &4526092917022738538 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7718724787770266755} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 31d1fd0cb91749a48b403453b167eb5d, type: 3} - m_Name: - m_EditorClassIdentifier: - _name: LayoutId - _value: 351750789 ---- !u!114 &5658977181872490055 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7718724787770266755} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4653d953a5d007748a8f96f4d29ca48a, type: 3} - m_Name: - m_EditorClassIdentifier: - _seed: -1 ---- !u!114 &9064858091588797620 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7718724787770266755} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6a565e8a4c1316844ace164c046a3c0a, type: 3} - m_Name: - m_EditorClassIdentifier: - _layoutGraphs: - - {fileID: 11400000, guid: 74894a9cdfc1648499c4e1d1556e1355, type: 2} ---- !u!114 &458368701357693900 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7718724787770266755} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 46ad8e251b029a94795353da0d2e7db5, type: 3} - m_Name: - m_EditorClassIdentifier: - _collectableGroups: - - {fileID: 11400000, guid: d7900d501eb58704a847d572707e09ff, type: 2} ---- !u!1 &7810883168613105152 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3596939867296720340} - - component: {fileID: 5636152828337834929} - - component: {fileID: 6349493844285927520} - - component: {fileID: 1417990268655460031} - m_Layer: 5 - m_Name: Canvas - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &3596939867296720340 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7810883168613105152} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 0, y: 0, z: 0} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 7777216906818483300} - - {fileID: 6501157024016777563} - - {fileID: 681408972012493748} - m_Father: {fileID: 4050978783237717444} - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 0} - m_AnchorMax: {x: 0, y: 0} - m_AnchoredPosition: {x: 0, y: 0} - m_SizeDelta: {x: 0, y: 0} - m_Pivot: {x: 0, y: 0} ---- !u!223 &5636152828337834929 -Canvas: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7810883168613105152} - m_Enabled: 1 - serializedVersion: 3 - m_RenderMode: 0 - m_Camera: {fileID: 0} - m_PlaneDistance: 100 - m_PixelPerfect: 0 - m_ReceivesEvents: 1 - m_OverrideSorting: 0 - m_OverridePixelPerfect: 0 - m_SortingBucketNormalizedSize: 0 - m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 0 - m_UpdateRectTransformForStandalone: 0 - m_SortingLayerID: 0 - m_SortingOrder: 0 - m_TargetDisplay: 0 ---- !u!114 &6349493844285927520 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7810883168613105152} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UiScaleMode: 1 - m_ReferencePixelsPerUnit: 100 - m_ScaleFactor: 1 - m_ReferenceResolution: {x: 800, y: 600} - m_ScreenMatchMode: 0 - m_MatchWidthOrHeight: 0 - m_PhysicalUnit: 3 - m_FallbackScreenDPI: 96 - m_DefaultSpriteDPI: 96 - m_DynamicPixelsPerUnit: 1 - m_PresetInfoIsWorld: 0 ---- !u!114 &1417990268655460031 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 7810883168613105152} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} - m_Name: - m_EditorClassIdentifier: - m_IgnoreReversedGraphics: 1 - m_BlockingObjects: 0 - m_BlockingMask: - serializedVersion: 2 - m_Bits: 4294967295 ---- !u!1 &9086458052175545701 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 6819689380132494692} - - component: {fileID: 8416207117466607270} - - component: {fileID: 6230690620503564531} - - component: {fileID: 3912125800419363074} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &6819689380132494692 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 9086458052175545701} - serializedVersion: 2 - m_LocalRotation: {x: 0.35355338, y: 0.35355338, z: -0.1464466, w: 0.8535535} - m_LocalPosition: {x: 10, y: 10, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 4050978783237717444} - m_LocalEulerAnglesHint: {x: 45, y: 45, z: 0} ---- !u!20 &8416207117466607270 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 9086458052175545701} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.14509805, g: 0.07450981, b: 0.101960786, 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: -1000 - far clip plane: 1000 - field of view: 60 - orthographic: 1 - orthographic size: 40 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!81 &6230690620503564531 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 9086458052175545701} - m_Enabled: 1 ---- !u!114 &3912125800419363074 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 9086458052175545701} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: be877b29fd65ae449bfe01af8e05d5b3, type: 3} - m_Name: - m_EditorClassIdentifier: - _scrollSpeed: 1 - _zoomSpeed: 1 diff --git a/Assets/RoomLayout3DSample.prefab.meta b/Assets/RoomLayout3DSample.prefab.meta deleted file mode 100644 index b27b4d12..00000000 --- a/Assets/RoomLayout3DSample.prefab.meta +++ /dev/null @@ -1,7 +0,0 @@ -fileFormatVersion: 2 -guid: a1ebe248d13dab748b85aa7bb5597fb3 -PrefabImporter: - externalObjects: {} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/Tests/EditMode/MPewsey.ManiaMap.Unity.Tests.EditMode.asmdef b/Assets/Scripts/Tests/EditMode/MPewsey.ManiaMap.Unity.Tests.EditMode.asmdef index c8c88b98..3826f421 100644 --- a/Assets/Scripts/Tests/EditMode/MPewsey.ManiaMap.Unity.Tests.EditMode.asmdef +++ b/Assets/Scripts/Tests/EditMode/MPewsey.ManiaMap.Unity.Tests.EditMode.asmdef @@ -4,7 +4,8 @@ "references": [ "UnityEngine.TestRunner", "UnityEditor.TestRunner", - "MPewsey.ManiaMapUnity" + "MPewsey.ManiaMapUnity", + "MPewsey.ManiaMapUnity.Editor" ], "includePlatforms": [ "Editor" diff --git a/Assets/Scripts/Tests/EditMode/TestBatchUpdaterTool.cs b/Assets/Scripts/Tests/EditMode/TestBatchUpdaterTool.cs new file mode 100644 index 00000000..86f328a9 --- /dev/null +++ b/Assets/Scripts/Tests/EditMode/TestBatchUpdaterTool.cs @@ -0,0 +1,14 @@ +using MPewsey.ManiaMapUnity.Editor; +using NUnit.Framework; + +namespace MPewsey.ManiaMapUnity.Tests.EditMode +{ + public class TestBatchUpdaterTool + { + [Test] + public void TestRunBatchUpdateRoomTemplates() + { + BatchUpdaterTool.RunBatchUpdateRoomTemplates(); + } + } +} \ No newline at end of file diff --git a/Packages/ManiaMap.Unity/Scripts/Runtime/Exceptions/RoomNotInitializedException.cs.meta b/Assets/Scripts/Tests/EditMode/TestBatchUpdaterTool.cs.meta similarity index 83% rename from Packages/ManiaMap.Unity/Scripts/Runtime/Exceptions/RoomNotInitializedException.cs.meta rename to Assets/Scripts/Tests/EditMode/TestBatchUpdaterTool.cs.meta index 2db3dc8c..95a45924 100644 --- a/Packages/ManiaMap.Unity/Scripts/Runtime/Exceptions/RoomNotInitializedException.cs.meta +++ b/Assets/Scripts/Tests/EditMode/TestBatchUpdaterTool.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9d1d5e7a504013841a91c75ed529834f +guid: 19698040d1f379841a566c531576fb91 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Scripts/Tests/EditMode/TestRoomComponent2D.cs b/Assets/Scripts/Tests/EditMode/TestRoomComponent2D.cs index f404761e..4606861e 100644 --- a/Assets/Scripts/Tests/EditMode/TestRoomComponent2D.cs +++ b/Assets/Scripts/Tests/EditMode/TestRoomComponent2D.cs @@ -1,3 +1,4 @@ +using MPewsey.ManiaMap; using MPewsey.ManiaMap.Exceptions; using NUnit.Framework; using UnityEngine; @@ -28,15 +29,39 @@ public void TearDown() [Test] public void TestAutoAssign() { - var flag = new GameObject("Flag 1").AddComponent(); + var flag = new GameObject("Room Flag").AddComponent(); flag.transform.SetParent(Room.transform); flag.transform.position = new Vector3(250, -150, 0); + var collectableSpot = new GameObject("Collectable Spot").AddComponent(); + collectableSpot.transform.SetParent(Room.transform); + collectableSpot.transform.position = new Vector3(250, -150, 0); + + var feature = new GameObject("Feature").AddComponent(); + feature.transform.SetParent(Room.transform); + feature.transform.position = new Vector3(250, -150, 0); + + var door = new GameObject("Door").AddComponent(); + door.transform.SetParent(Room.transform); + door.transform.position = new Vector3(0, -50, 0); + Room.AutoAssign(); Assert.AreEqual(Room, flag.Room); Assert.Greater(flag.Id, 0); Assert.AreEqual(1, flag.Row); Assert.AreEqual(2, flag.Column); + + Assert.AreEqual(Room, collectableSpot.Room); + Assert.Greater(collectableSpot.Id, 0); + Assert.AreEqual(1, collectableSpot.Row); + Assert.AreEqual(2, collectableSpot.Column); + + Assert.AreEqual(Room, feature.Room); + Assert.AreEqual(1, feature.Row); + Assert.AreEqual(2, feature.Column); + + Assert.AreEqual(Room, door.Room); + Assert.AreEqual(DoorDirection.West, door.Direction); } [Test] diff --git a/Assets/Scripts/Tests/PlayMode/Examples/TestLayoutMapBookSample.cs b/Assets/Scripts/Tests/PlayMode/Examples/TestLayoutMapBookSample.cs index 9649b383..912b7259 100644 --- a/Assets/Scripts/Tests/PlayMode/Examples/TestLayoutMapBookSample.cs +++ b/Assets/Scripts/Tests/PlayMode/Examples/TestLayoutMapBookSample.cs @@ -1,6 +1,8 @@ +using MPewsey.ManiaMapUnity.Drawing; using NUnit.Framework; using System.Collections; using System.Diagnostics; +using System.IO; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.TestTools; @@ -9,9 +11,19 @@ namespace MPewsey.ManiaMapUnity.Examples.Tests { public class TestLayoutMapBookSample { + private const string ArtifactPath = "Tests/LayoutMapBook"; private const string TestScene = "LayoutMapBookSample"; private LayoutMapBookSample Sample { get; set; } + [OneTimeSetUp] + public void OneTimeSetUp() + { + if (Directory.Exists(ArtifactPath)) + Directory.Delete(ArtifactPath, true); + + Directory.CreateDirectory(ArtifactPath); + } + [UnitySetUp] public IEnumerator SetUp() { @@ -39,5 +51,47 @@ public IEnumerator TestPressGenerateButton() Assert.IsTrue(Sample.GenerateButton.interactable); Assert.IsTrue(stopwatch.Elapsed.TotalSeconds <= timeout); } + + [UnityTest] + public IEnumerator TestSetOnionskinColor() + { + var timeout = 20; + var stopwatch = new Stopwatch(); + stopwatch.Start(); + Assert.IsTrue(Sample.GenerateButton.interactable); + Sample.GenerateButton.onClick.Invoke(); + Assert.IsFalse(Sample.GenerateButton.interactable); + yield return new WaitUntil(() => Sample.GenerateButton.interactable || stopwatch.Elapsed.TotalSeconds > timeout); + Assert.IsTrue(Sample.GenerateButton.interactable); + Assert.IsTrue(stopwatch.Elapsed.TotalSeconds <= timeout); + + var map = Sample.GetComponent(); + Assert.IsTrue(map != null); + + Assert.AreEqual(0, map.SetOnionskinColors(0, Gradients.RedWhiteBlueGradient())); + } + + [UnityTest] + public IEnumerator TestSaveImages() + { + var timeout = 20; + var stopwatch = new Stopwatch(); + stopwatch.Start(); + Assert.IsTrue(Sample.GenerateButton.interactable); + Sample.GenerateButton.onClick.Invoke(); + Assert.IsFalse(Sample.GenerateButton.interactable); + yield return new WaitUntil(() => Sample.GenerateButton.interactable || stopwatch.Elapsed.TotalSeconds > timeout); + Assert.IsTrue(Sample.GenerateButton.interactable); + Assert.IsTrue(stopwatch.Elapsed.TotalSeconds <= timeout); + + var map = Sample.GetComponent(); + Assert.IsTrue(map != null); + + var pngPaths = map.SaveImages(Path.Combine(ArtifactPath, "png_map.png")); + Assert.Greater(pngPaths.Count, 0); + + var jpegPaths = map.SaveImages(Path.Combine(ArtifactPath, "jpeg_map.jpeg")); + Assert.Greater(jpegPaths.Count, 0); + } } } diff --git a/Assets/Scripts/Tests/PlayMode/TestCollectableSpotComponent.cs b/Assets/Scripts/Tests/PlayMode/TestCollectableSpotComponent.cs new file mode 100644 index 00000000..c05029b4 --- /dev/null +++ b/Assets/Scripts/Tests/PlayMode/TestCollectableSpotComponent.cs @@ -0,0 +1,77 @@ +using MPewsey.ManiaMap; +using MPewsey.ManiaMapUnity.Generators; +using NUnit.Framework; +using System.Collections; +using UnityEngine; +using UnityEngine.AddressableAssets; +using UnityEngine.TestTools; + +namespace MPewsey.ManiaMapUnity.Tests +{ + public class TestCollectableSpotComponent + { + private const string TestScene = "TestRoomComponent2D"; + private CollectableSpotComponent CollectableSpot { get; set; } + private LayoutPack LayoutPack { get; set; } + + [UnitySetUp] + public IEnumerator SetUp() + { + yield return Addressables.LoadSceneAsync(TestScene); + var handle = Addressables.LoadAssetAsync("2DRoomTemplateDatabase"); + yield return handle; + var database = handle.Result; + Assert.IsTrue(database != null); + var pipeline = Object.FindAnyObjectByType(); + Assert.IsTrue(pipeline != null); + var results = pipeline.Run(); + Assert.IsTrue(results.Success); + var layout = results.GetOutput("Layout"); + Assert.IsNotNull(layout); + LayoutPack = new LayoutPack(layout, new LayoutState(layout)); + var rooms = database.InstantiateAllRooms(LayoutPack); + Assert.Greater(rooms.Count, 0); + yield return null; + CollectableSpot = Object.FindAnyObjectByType(); + Assert.IsTrue(CollectableSpot != null); + } + + [UnityTearDown] + public IEnumerator TearDown() + { + yield return Addressables.LoadSceneAsync("EmptyScene"); + } + + [Test] + public void TestCollectableId() + { + Assert.Greater(CollectableSpot.CollectableId(), 0); + } + + [Test] + public void TestCollectableExists() + { + Assert.IsTrue(CollectableSpot.CollectableExists()); + } + + [Test] + public void TestIsAcquired() + { + Assert.IsFalse(CollectableSpot.IsAcquired()); + } + + [Test] + public void TestCanAcquire() + { + Assert.IsTrue(CollectableSpot.CanAcquire()); + } + + [Test] + public void TestAcquire() + { + Assert.IsTrue(CollectableSpot.Acquire()); + Assert.IsFalse(CollectableSpot.Acquire()); + Assert.IsTrue(CollectableSpot.IsAcquired()); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tests/PlayMode/TestCollectableSpotComponent.cs.meta b/Assets/Scripts/Tests/PlayMode/TestCollectableSpotComponent.cs.meta new file mode 100644 index 00000000..36ca6504 --- /dev/null +++ b/Assets/Scripts/Tests/PlayMode/TestCollectableSpotComponent.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 859b643ba1bb544428968610285f80bc +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tests/PlayMode/TestRoomComponent2D.cs b/Assets/Scripts/Tests/PlayMode/TestRoomComponent2D.cs index 0fef7b8b..0761bb71 100644 --- a/Assets/Scripts/Tests/PlayMode/TestRoomComponent2D.cs +++ b/Assets/Scripts/Tests/PlayMode/TestRoomComponent2D.cs @@ -293,5 +293,45 @@ public void TestLocalPositionToCellIndexFromCellCenterLocalPosition() } } } + + [Test] + public void TestGetCellViewDirection() + { + Room.CellSize = new Vector3(100, 100, 100); + Assert.AreEqual(Quaternion.Euler(0, 0, 0), Room.GetCellViewDirection()); + } + + [Test] + public void TestCenterGlobalPosition() + { + Room.CellSize = new Vector3(100, 100, 100); + Assert.AreEqual(new Vector3(150, -150, -50), Room.CenterGlobalPosition()); + } + + [Test] + public void TestLocalCellSize() + { + Assert.AreEqual(Room.CellSize, Room.LocalCellSize()); + } + + [Test] + public void TestFindDoor() + { + var doors = Object.FindObjectsOfType(); + var count = 0; + + foreach (var door in doors) + { + if (door.DoorExists()) + { + var foundDoor = DoorComponent.FindDoor(door.Room.RoomLayout.Id, door.Connection); + Assert.IsTrue(foundDoor != null); + Assert.AreEqual(door, foundDoor); + count++; + } + } + + Assert.Greater(count, 0); + } } } \ No newline at end of file diff --git a/Assets/Scripts/Tests/PlayMode/TestRoomComponent3D.cs b/Assets/Scripts/Tests/PlayMode/TestRoomComponent3D.cs index 8913dfb7..57fe6b16 100644 --- a/Assets/Scripts/Tests/PlayMode/TestRoomComponent3D.cs +++ b/Assets/Scripts/Tests/PlayMode/TestRoomComponent3D.cs @@ -295,5 +295,18 @@ public void TestLocalPositionToCellIndexFromCellCenterLocalPosition() } } } + + [Test] + public void TestGetCellViewDirection() + { + Assert.AreEqual(Quaternion.Euler(90, 0, 0), Room.GetCellViewDirection()); + } + + [Test] + public void TestCenterGlobalPosition() + { + Room.CellSize = new Vector3(100, 100, 100); + Assert.AreEqual(new Vector3(150, 50, -150), Room.CenterGlobalPosition()); + } } } \ No newline at end of file diff --git a/Assets/Scripts/Tests/PlayMode/TestRoomDatabase.cs b/Assets/Scripts/Tests/PlayMode/TestRoomDatabase.cs new file mode 100644 index 00000000..f84d3c49 --- /dev/null +++ b/Assets/Scripts/Tests/PlayMode/TestRoomDatabase.cs @@ -0,0 +1,74 @@ +using MPewsey.ManiaMap; +using MPewsey.ManiaMapUnity.Generators; +using NUnit.Framework; +using System.Collections; +using System.Linq; +using UnityEngine; +using UnityEngine.AddressableAssets; +using UnityEngine.TestTools; + +namespace MPewsey.ManiaMapUnity.Tests +{ + public class TestRoomDatabase + { + private const string TestScene = "TestRoomComponent2D"; + private RoomDatabase RoomDatabase { get; set; } + private LayoutPack LayoutPack { get; set; } + + [UnitySetUp] + public IEnumerator SetUp() + { + yield return Addressables.LoadSceneAsync(TestScene); + var handle = Addressables.LoadAssetAsync("2DRoomDatabase"); + yield return handle; + RoomDatabase = handle.Result; + Assert.IsTrue(RoomDatabase != null); + var pipeline = Object.FindAnyObjectByType(); + Assert.IsTrue(pipeline != null); + var results = pipeline.Run(); + Assert.IsTrue(results.Success); + var layout = results.GetOutput("Layout"); + Assert.IsNotNull(layout); + LayoutPack = new LayoutPack(layout, new LayoutState(layout)); + } + + [UnityTearDown] + public IEnumerator TearDown() + { + yield return Addressables.LoadSceneAsync("EmptyScene"); + } + + [Test] + public void TestInstantiateAllRooms() + { + var rooms = RoomDatabase.InstantiateAllRooms(LayoutPack); + Assert.Greater(rooms.Count, 0); + + foreach (var room in rooms) + { + Assert.IsTrue(room.IsInitialized); + } + } + + [Test] + public void TestInstantiateRooms() + { + var rooms = RoomDatabase.InstantiateRooms(LayoutPack); + Assert.Greater(rooms.Count, 0); + + foreach (var room in rooms) + { + Assert.IsTrue(room.IsInitialized); + } + } + + [Test] + public void TestInstantiateRoom() + { + var roomId = LayoutPack.Layout.Rooms.Keys.First(); + var room = RoomDatabase.InstantiateRoom(roomId, LayoutPack); + Assert.IsTrue(room != null); + Assert.IsTrue(room.IsInitialized); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tests/PlayMode/TestRoomDatabase.cs.meta b/Assets/Scripts/Tests/PlayMode/TestRoomDatabase.cs.meta new file mode 100644 index 00000000..de3e0a67 --- /dev/null +++ b/Assets/Scripts/Tests/PlayMode/TestRoomDatabase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 31a9546c737ea614491a80de3d831d59 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Tests/PlayMode/TestRoomTemplateDatabase.cs b/Assets/Scripts/Tests/PlayMode/TestRoomTemplateDatabase.cs new file mode 100644 index 00000000..73dced26 --- /dev/null +++ b/Assets/Scripts/Tests/PlayMode/TestRoomTemplateDatabase.cs @@ -0,0 +1,115 @@ +using MPewsey.ManiaMap; +using MPewsey.ManiaMapUnity.Generators; +using NUnit.Framework; +using System.Collections; +using System.Linq; +using UnityEngine; +using UnityEngine.AddressableAssets; +using UnityEngine.TestTools; + +namespace MPewsey.ManiaMapUnity.Tests +{ + public class TestRoomTemplateDatabase + { + private const string TestScene = "TestRoomComponent2D"; + private LayoutPack LayoutPack { get; set; } + private RoomTemplateDatabase RoomTemplateDatabase { get; set; } + + [UnitySetUp] + public IEnumerator SetUp() + { + yield return Addressables.LoadSceneAsync(TestScene); + var handle = Addressables.LoadAssetAsync("2DRoomTemplateDatabase"); + yield return handle; + RoomTemplateDatabase = handle.Result; + Assert.IsTrue(RoomTemplateDatabase != null); + var pipeline = Object.FindAnyObjectByType(); + Assert.IsTrue(pipeline != null); + var results = pipeline.Run(); + Assert.IsTrue(results.Success); + var layout = results.GetOutput("Layout"); + Assert.IsNotNull(layout); + LayoutPack = new LayoutPack(layout, new LayoutState(layout)); + } + + [UnityTearDown] + public IEnumerator TearDown() + { + yield return Addressables.LoadSceneAsync("EmptyScene"); + } + + [Test] + public void TestInstantiateAllRooms() + { + var rooms = RoomTemplateDatabase.InstantiateAllRooms(LayoutPack); + Assert.Greater(rooms.Count, 0); + + foreach (var room in rooms) + { + Assert.IsTrue(room.IsInitialized); + } + } + + [UnityTest] + public IEnumerator TestInstantiateAllRoomsAsync() + { + var task = RoomTemplateDatabase.InstantiateAllRoomsAsync(LayoutPack); + yield return new WaitUntil(() => task.IsCompleted); + Assert.IsTrue(task.IsCompletedSuccessfully); + var rooms = task.Result; + Assert.Greater(rooms.Count, 0); + + foreach (var room in rooms) + { + Assert.IsTrue(room.IsInitialized); + } + } + + [Test] + public void TestInstantiateRooms() + { + var rooms = RoomTemplateDatabase.InstantiateRooms(LayoutPack); + Assert.Greater(rooms.Count, 0); + + foreach (var room in rooms) + { + Assert.IsTrue(room.IsInitialized); + } + } + + [UnityTest] + public IEnumerator TestInstantiateRoomsAsync() + { + var task = RoomTemplateDatabase.InstantiateRoomsAsync(LayoutPack); + yield return new WaitUntil(() => task.IsCompleted); + Assert.IsTrue(task.IsCompletedSuccessfully); + var rooms = task.Result; + Assert.Greater(rooms.Count, 0); + + foreach (var room in rooms) + { + Assert.IsTrue(room.IsInitialized); + } + } + + [Test] + public void TestInstantiateRoom() + { + var roomId = LayoutPack.Layout.Rooms.Keys.First(); + var room = RoomTemplateDatabase.InstantiateRoom(roomId, LayoutPack); + Assert.IsTrue(room != null); + Assert.IsTrue(room.IsInitialized); + } + + [UnityTest] + public IEnumerator TestInstantiateRoomAsync() + { + var roomId = LayoutPack.Layout.Rooms.Keys.First(); + var handle = RoomTemplateDatabase.InstantiateRoomAsync(roomId, LayoutPack); + yield return handle; + var room = handle.Result.GetComponent(); + Assert.IsTrue(room != null); + Assert.IsTrue(room.IsInitialized); + } + } +} \ No newline at end of file diff --git a/Assets/Scripts/Tests/PlayMode/TestRoomTemplateDatabase.cs.meta b/Assets/Scripts/Tests/PlayMode/TestRoomTemplateDatabase.cs.meta new file mode 100644 index 00000000..287722b7 --- /dev/null +++ b/Assets/Scripts/Tests/PlayMode/TestRoomTemplateDatabase.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 48171d821b9b4a24e93f5fd3aabb3fb9 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Packages/ManiaMap.Unity/Scripts/Runtime/CollectableSpotComponent.cs b/Packages/ManiaMap.Unity/Scripts/Runtime/CollectableSpotComponent.cs index 2973bd3d..d48c4c1e 100644 --- a/Packages/ManiaMap.Unity/Scripts/Runtime/CollectableSpotComponent.cs +++ b/Packages/ManiaMap.Unity/Scripts/Runtime/CollectableSpotComponent.cs @@ -43,14 +43,14 @@ private void OnValidate() } /// - /// The assigned collectable ID. + /// The collectable ID. If the collectable spot does not exist in the layout, returns -1. /// public int CollectableId() { if (Room.RoomLayout.Collectables.TryGetValue(Id, out int value)) return value; - return int.MinValue; + return -1; } /// diff --git a/Packages/ManiaMap.Unity/Scripts/Runtime/Exceptions/RoomNotInitializedException.cs b/Packages/ManiaMap.Unity/Scripts/Runtime/Exceptions/RoomNotInitializedException.cs deleted file mode 100644 index 73d4ba03..00000000 --- a/Packages/ManiaMap.Unity/Scripts/Runtime/Exceptions/RoomNotInitializedException.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace MPewsey.ManiaMapUnity.Exceptions -{ - /// - /// Raised when a room has not been initialized. - /// - public class RoomNotInitializedException : Exception - { - /// - public RoomNotInitializedException(string message) : base(message) - { - - } - } -} \ No newline at end of file diff --git a/Packages/ManiaMap.Unity/Scripts/Runtime/RoomComponent.cs b/Packages/ManiaMap.Unity/Scripts/Runtime/RoomComponent.cs index 00f6eb64..42756253 100644 --- a/Packages/ManiaMap.Unity/Scripts/Runtime/RoomComponent.cs +++ b/Packages/ManiaMap.Unity/Scripts/Runtime/RoomComponent.cs @@ -1,7 +1,6 @@ using MPewsey.Common.Collections; using MPewsey.ManiaMap; using MPewsey.ManiaMap.Exceptions; -using MPewsey.ManiaMapUnity.Exceptions; using System.Collections.Generic; using UnityEngine; using UnityEngine.AddressableAssets; @@ -130,12 +129,6 @@ private void SetSizeField(ref Vector2Int field, Vector2Int value) SizeActiveCells(); } - private void Start() - { - if (!IsInitialized) - throw new RoomNotInitializedException($"Room not initialized: {this}."); - } - private void OnValidate() { Size = Size;