Commit dba4f6af authored by 18손재민's avatar 18손재민

이제 벽을 좌표만으로 생성할 수 있음. 플레이어 발사 모드 WIP

parent 36a5a80b
......@@ -79,85 +79,6 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: 'Mode : '
--- !u!1 &250553721
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 250553723}
- component: {fileID: 250553722}
m_Layer: 0
m_Name: ClickSign
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &250553723
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 250553721}
m_LocalRotation: {x: 0.7071068, y: -0, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 2}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 1444571408780882984}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!212 &250553722
SpriteRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 250553721}
m_Enabled: 1
m_CastShadows: 0
m_ReceiveShadows: 0
m_DynamicOccludee: 1
m_MotionVectors: 1
m_LightProbeUsage: 1
m_ReflectionProbeUsage: 1
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
m_StaticBatchRoot: {fileID: 0}
m_ProbeAnchor: {fileID: 0}
m_LightProbeVolumeOverride: {fileID: 0}
m_ScaleInLightmap: 1
m_PreserveUVs: 0
m_IgnoreNormalsForChartDetection: 0
m_ImportantGI: 0
m_StitchLightmapSeams: 0
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: 21300000, guid: b489da500f22d7a4b8c478cae46976ad, type: 3}
m_Color: {r: 1, g: 0.9238702, b: 0, a: 1}
m_FlipX: 0
m_FlipY: 0
m_DrawMode: 0
m_Size: {x: 0.16, y: 0.16}
m_AdaptiveModeThreshold: 0.5
m_SpriteTileMode: 0
m_WasSpriteAssigned: 1
m_MaskInteraction: 0
m_SpriteSortPoint: 0
--- !u!1 &369540418
GameObject:
m_ObjectHideFlags: 0
......@@ -2063,7 +1984,6 @@ Transform:
m_Children:
- {fileID: 1444571407667829093}
- {fileID: 1549724122}
- {fileID: 250553723}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -2086,7 +2006,7 @@ MonoBehaviour:
- {fileID: 630498074781569474, guid: 759f352c81f1b5a40b2d8d241cdf273b, type: 3}
tile: {fileID: 7449840556337937162, guid: 90d0ab9f40a0ddc4c871130319d86cd5, type: 3}
modeSign: {fileID: 153720729}
clickSign: {fileID: 250553721}
clickSign: {fileID: 0}
startSign: {fileID: 1215997560627761150, guid: 106914c4661964b47ad09efcc4bfba69,
type: 3}
mapSizeSetter: {fileID: 8774990006778924709}
......
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &707974221534118747
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 6473104044473429548}
- component: {fileID: 5525733942384982372}
m_Layer: 0
m_Name: wallSign1
m_TagString: wallSign
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &6473104044473429548
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 707974221534118747}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0.5, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8597978733200416946}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &5525733942384982372
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 707974221534118747}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.05, y: 1, z: 0.99}
m_Center: {x: -0.03, y: 0, z: 0}
--- !u!1 &1603774191137020571
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7958231114469327783}
- component: {fileID: 2503821083023157068}
m_Layer: 0
m_Name: wallSign4
m_TagString: wallSign
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &7958231114469327783
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1603774191137020571}
m_LocalRotation: {x: -0, y: 0.7071068, z: -0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: -0.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8597978733200416946}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!65 &2503821083023157068
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1603774191137020571}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.05, y: 1, z: 0.99}
m_Center: {x: -0.03, y: 0, z: 0}
--- !u!1 &3962965389788265926
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 4128185853572849183}
- component: {fileID: 2698593240535325732}
m_Layer: 0
m_Name: wallSign2
m_TagString: wallSign
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &4128185853572849183
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962965389788265926}
m_LocalRotation: {x: 0, y: 0.7071068, z: 0, w: 0.7071068}
m_LocalPosition: {x: 0, y: 0, z: 0.5}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8597978733200416946}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 90, z: 0}
--- !u!65 &2698593240535325732
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3962965389788265926}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.05, y: 1, z: 0.99}
m_Center: {x: 0.03, y: 0, z: 0}
--- !u!1 &6573959937559765462
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1678364396640042833}
- component: {fileID: 4716056590295674130}
m_Layer: 0
m_Name: wallSign3
m_TagString: wallSign
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &1678364396640042833
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6573959937559765462}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -0.5, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 8597978733200416946}
m_RootOrder: 2
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!65 &4716056590295674130
BoxCollider:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6573959937559765462}
m_Material: {fileID: 0}
m_IsTrigger: 0
m_Enabled: 1
serializedVersion: 2
m_Size: {x: 0.05, y: 1, z: 0.99}
m_Center: {x: 0.03, y: 0, z: 0}
--- !u!1 &8597978733200129170
GameObject:
m_ObjectHideFlags: 0
......@@ -30,7 +206,11 @@ Transform:
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_Children: []
m_Children:
- {fileID: 6473104044473429548}
- {fileID: 4128185853572849183}
- {fileID: 1678364396640042833}
- {fileID: 7958231114469327783}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......
......@@ -51,4 +51,4 @@ MonoBehaviour:
currentMap: {fileID: 0}
surface: {fileID: 0}
stage:
- {fileID: 6311566525947587311, guid: 49597164dd7e7454ca5a790c491a214e, type: 3}
- {fileID: 2597539376576235671, guid: bec0ce48aa2c7d14abcf504346360066, type: 3}
......@@ -321,164 +321,6 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: add wall
--- !u!1 &618327548645605698
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 215259819598894143}
- component: {fileID: 8417107962951785170}
- component: {fileID: 6003065285487534312}
m_Layer: 5
m_Name: Placeholder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &215259819598894143
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 618327548645605698}
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_Children: []
m_Father: {fileID: 203137767687738723}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &8417107962951785170
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 618327548645605698}
m_CullTransparentMesh: 0
--- !u!114 &6003065285487534312
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 618327548645605698}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 2
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: floor2y
--- !u!1 &756879870396725551
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7337613730099951892}
- component: {fileID: 2629714301194039320}
- component: {fileID: 1872126569392046400}
m_Layer: 5
m_Name: Placeholder
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7337613730099951892
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 756879870396725551}
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_Children: []
m_Father: {fileID: 7316920853675499895}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &2629714301194039320
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 756879870396725551}
m_CullTransparentMesh: 0
--- !u!114 &1872126569392046400
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 756879870396725551}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 0.5}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 2
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 0
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: floor2x
--- !u!1 &829231570822800186
GameObject:
m_ObjectHideFlags: 0
......@@ -1403,10 +1245,8 @@ MonoBehaviour:
m_EditorClassIdentifier:
floorXInput: {fileID: 1444571407224148016}
floorYInput: {fileID: 1444571408487427165}
wall1XInput: {fileID: 957700767519685388}
wall1YInput: {fileID: 7205224669021287041}
wall2XInput: {fileID: 6281056414404235102}
wall2YInput: {fileID: 6786913464128610803}
wallXInput: {fileID: 957700767519685388}
wallYInput: {fileID: 7205224669021287041}
--- !u!1 &1444571408874085630
GameObject:
m_ObjectHideFlags: 0
......@@ -1614,7 +1454,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: x
m_Text: floorX
--- !u!1 &1444571409017468571
GameObject:
m_ObjectHideFlags: 0
......@@ -1851,148 +1691,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: y
--- !u!1 &1753524115849114935
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7316920853675499895}
- component: {fileID: 6538499780689875269}
- component: {fileID: 4981161582520240027}
- component: {fileID: 6281056414404235102}
m_Layer: 5
m_Name: x2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7316920853675499895
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1753524115849114935}
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_Children:
- {fileID: 7337613730099951892}
- {fileID: 1369601684702755672}
m_Father: {fileID: 3620727262082854988}
m_RootOrder: 4
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: -840, y: 168}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6538499780689875269
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1753524115849114935}
m_CullTransparentMesh: 0
--- !u!114 &4981161582520240027
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1753524115849114935}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10911, 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
--- !u!114 &6281056414404235102
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1753524115849114935}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 575553740, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
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_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_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 4981161582520240027}
m_TextComponent: {fileID: 3401128656473531387}
m_Placeholder: {fileID: 1872126569392046400}
m_ContentType: 0
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_LineType: 0
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
m_Text: floorY
--- !u!1 &1755588930399495647
GameObject:
m_ObjectHideFlags: 0
......@@ -2006,7 +1705,7 @@ GameObject:
- component: {fileID: 5351517868030614540}
- component: {fileID: 7205224669021287041}
m_Layer: 5
m_Name: y1
m_Name: y
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -2134,147 +1833,6 @@ MonoBehaviour:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
--- !u!1 &2650867334385220253
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 203137767687738723}
- component: {fileID: 6481569756592280491}
- component: {fileID: 6864107576382371519}
- component: {fileID: 6786913464128610803}
m_Layer: 5
m_Name: y2
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &203137767687738723
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2650867334385220253}
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_Children:
- {fileID: 215259819598894143}
- {fileID: 1677018730519983174}
m_Father: {fileID: 3620727262082854988}
m_RootOrder: 5
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: -838, y: 131}
m_SizeDelta: {x: 160, y: 30}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6481569756592280491
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2650867334385220253}
m_CullTransparentMesh: 0
--- !u!114 &6864107576382371519
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2650867334385220253}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: -765806418, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
m_Sprite: {fileID: 10911, 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
--- !u!114 &6786913464128610803
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2650867334385220253}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 575553740, guid: f70555f144d8491a825f0804e09c671c, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
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_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_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 6864107576382371519}
m_TextComponent: {fileID: 7006305903338409404}
m_Placeholder: {fileID: 6003065285487534312}
m_ContentType: 0
m_InputType: 0
m_AsteriskChar: 42
m_KeyboardType: 0
m_LineType: 0
m_HideMobileInput: 0
m_CharacterValidation: 0
m_CharacterLimit: 0
m_OnEndEdit:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.InputField+SubmitEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
m_OnValueChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.InputField+OnChangeEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
m_CaretColor: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_CustomCaretColor: 0
m_SelectionColor: {r: 0.65882355, g: 0.80784315, b: 1, a: 0.7529412}
m_Text:
m_CaretBlinkRate: 0.85
m_CaretWidth: 1
m_ReadOnly: 0
--- !u!1 &2903128163706489844
GameObject:
m_ObjectHideFlags: 0
......@@ -2367,7 +1925,7 @@ GameObject:
- component: {fileID: 2618440267838434844}
- component: {fileID: 957700767519685388}
m_Layer: 5
m_Name: x1
m_Name: x
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
......@@ -2573,7 +2131,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: floor1x
m_Text: wallX
--- !u!1 &3603290481052885353
GameObject:
m_ObjectHideFlags: 0
......@@ -2652,7 +2210,7 @@ MonoBehaviour:
m_HorizontalOverflow: 0
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: floor1y
m_Text: wallY
--- !u!1 &3853351717184365030
GameObject:
m_ObjectHideFlags: 0
......@@ -2732,85 +2290,6 @@ MonoBehaviour:
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text: remove wall
--- !u!1 &6388829674209829808
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1677018730519983174}
- component: {fileID: 7464822997841039959}
- component: {fileID: 7006305903338409404}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1677018730519983174
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6388829674209829808}
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_Children: []
m_Father: {fileID: 203137767687738723}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &7464822997841039959
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6388829674209829808}
m_CullTransparentMesh: 0
--- !u!114 &7006305903338409404
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 6388829674209829808}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, 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_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
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: 0
m_AlignByGeometry: 0
m_RichText: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
--- !u!1 &8258786785925499026
GameObject:
m_ObjectHideFlags: 0
......@@ -2842,8 +2321,6 @@ Transform:
- {fileID: 5398906991837850868}
- {fileID: 8119863323363109291}
- {fileID: 4303392193841889760}
- {fileID: 7316920853675499895}
- {fileID: 203137767687738723}
m_Father: {fileID: 1444571407667829093}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
......@@ -2976,82 +2453,3 @@ MonoBehaviour:
m_CallState: 2
m_TypeName: UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!1 &8608865759125542028
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1369601684702755672}
- component: {fileID: 9051313386528458074}
- component: {fileID: 3401128656473531387}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1369601684702755672
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8608865759125542028}
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_Children: []
m_Father: {fileID: 7316920853675499895}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: -0.5}
m_SizeDelta: {x: -20, y: -13}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &9051313386528458074
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8608865759125542028}
m_CullTransparentMesh: 0
--- !u!114 &3401128656473531387
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8608865759125542028}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 708705254, guid: f70555f144d8491a825f0804e09c671c, 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_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_TypeName: UnityEngine.UI.MaskableGraphic+CullStateChangedEvent, UnityEngine.UI,
Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
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: 0
m_AlignByGeometry: 0
m_RichText: 0
m_HorizontalOverflow: 1
m_VerticalOverflow: 0
m_LineSpacing: 1
m_Text:
......@@ -490,11 +490,6 @@ PrefabInstance:
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 1444571407667829093, guid: 0b18400fb62a12d4e9cb5fbb8ecbb53f,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 0b18400fb62a12d4e9cb5fbb8ecbb53f, type: 3}
--- !u!1001 &5089720519379341084
......@@ -638,12 +633,6 @@ PrefabInstance:
propertyPath: surface
value:
objectReference: {fileID: 2102809461}
- target: {fileID: 3268100033343711389, guid: 11285456de5f1854d947bea83275646f,
type: 3}
propertyPath: stage.Array.data[0]
value:
objectReference: {fileID: 2597539376576235671, guid: bec0ce48aa2c7d14abcf504346360066,
type: 3}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 11285456de5f1854d947bea83275646f, type: 3}
--- !u!1001 &7277015660625800392
......
......@@ -11,10 +11,6 @@ public class CameraController : MonoBehaviour
float verticalInput = Input.GetAxis("Vertical");
transform.position += new Vector3(verticalInput + horizontalInput, 0, verticalInput - horizontalInput);
}
void CameraRotate()
{
}
// Start is called before the first frame update
void Start()
......@@ -26,6 +22,5 @@ public class CameraController : MonoBehaviour
void Update()
{
CameraMove();
CameraRotate();
}
}
......@@ -16,68 +16,45 @@ public class Map : MonoBehaviour
/// <summary>
/// Get floor at position.
/// </summary>
/// <param name="x">X position of floor.</param>
/// <param name="y">Y position of floor.</param>
/// <param name="pos">Position of floor.</param>
/// <returns></returns>
public Floor GetFloorAtPos(int x, int y)
public Floor GetFloorAtPos(Vector2Int pos)
{
if ((x >= 0 ? (x > maxMapSize / 2) : (x < -maxMapSize / 2)) || (y >= 0 ? (y > maxMapSize / 2) : (y < -maxMapSize / 2)))
if ((pos.x >= 0 ? (pos.x > maxMapSize / 2) : (pos.x < -maxMapSize / 2)) || (pos.y >= 0 ? (pos.y > maxMapSize / 2) : (pos.y < -maxMapSize / 2)))
{
Debug.Log("Input size exceeds map's max size.");
return null;
}
Vector2Int floorPos = new Vector2Int(x, y);
return floorGrid.ContainsKey(floorPos) ? floorGrid[floorPos] : null;
return floorGrid.ContainsKey(pos) ? floorGrid[pos] : null;
}
/// <summary>
/// Get floor at position.
/// </summary>
/// <param name="pos">Position of floor.</param>
/// <param name="pos">Position of wall.</param>
/// <returns></returns>
public Floor GetFloorAtPos(Vector2Int pos)
public Wall GetWallAtPos(Vector2 pos)
{
return GetFloorAtPos(pos.x, pos.y);
}
/// <summary>
/// Get floor at position.
/// </summary>
/// <param name="x">X position of floor.</param>
/// <param name="y">Y position of floor.</param>
/// <returns></returns>
public Wall GetWallAtPos(Floor floor1, Floor floor2)
{
Vector2 wallPos = (Vector2)(floor1.mapPos + floor2.mapPos) / 2;
return wallGrid.ContainsKey(wallPos) ? wallGrid[wallPos] : null;
return wallGrid.ContainsKey(pos) ? wallGrid[pos] : null;
}
/// <summary>
/// Create floor at position.
/// </summary>
/// <param name="x">X position of floor.</param>
/// <param name="y">Y position of floor.</param>
public void CreateFloor(int x, int y)
/// <param name="pos">Position of floor.</param>
public void CreateFloor(Vector2Int pos)
{
if ((x >= 0 ? (x > maxMapSize / 2) : (x < -maxMapSize / 2)) || (y >= 0 ? (y > maxMapSize / 2) : (y < -maxMapSize / 2)))
if ((pos.x >= 0 ? (pos.x > maxMapSize / 2) : (pos.x < -maxMapSize / 2)) || (pos.y >= 0 ? (pos.y > maxMapSize / 2) : (pos.y < -maxMapSize / 2)))
{
Debug.Log("Input size exceeds map's max size.");
return;
}
Vector2Int floorPos = new Vector2Int(x, y);
if (!floorGrid.ContainsKey(floorPos))
if (!floorGrid.ContainsKey(pos))
{
floorGrid.Add(floorPos, Instantiate(MapManager.inst.floor, new Vector3(floorPos.x, 0, floorPos.y), Quaternion.identity, floors.transform).GetComponent<Floor>());
floorGrid[floorPos].SetmapPos(floorPos);
floorGrid.Add(pos, Instantiate(MapManager.inst.floor, new Vector3(pos.x, 0, pos.y), Quaternion.identity, floors.transform).GetComponent<Floor>());
floorGrid[pos].SetmapPos(pos);
StartCoroutine(MapManager.inst.Rebaker());
}
else
Debug.Log("Floor already exists at : (" + x + ", " + y + ")");
}
/// <summary>
/// Create floor at position.
/// </summary>
/// <param name="pos">Position of floor.</param>
public void CreateFloor(Vector2Int pos)
{
CreateFloor(pos.x, pos.y);
Debug.Log("Floor already exists at : (" + pos.x + ", " + pos.y + ")");
}
/// <summary>
/// Create floor in rectangular area between pos1 and pos2.
......@@ -92,111 +69,86 @@ public class Map : MonoBehaviour
int yMin = Mathf.Min(pos1.y, pos2.y);
for (int i = xMin; i <= xMax; i++)
for (int j = yMin; j <= yMax; j++)
CreateFloor(i, j);
CreateFloor(new Vector2Int(i, j));
}
/// <summary>
/// Remove floor at position.
/// </summary>
/// <param name="x">X position of floor.</param>
/// <param name="y">Y position of floor.</param>
public void RemoveFloor(int x, int y)
/// <param name="pos">Position of floor.</param>
public void RemoveFloor(Vector2Int pos)
{
if ((x >= 0 ? (x > maxMapSize / 2) : (x < -maxMapSize / 2)) || (y >= 0 ? (y > maxMapSize / 2) : (y < -maxMapSize / 2)))
if ((pos.x >= 0 ? (pos.x > maxMapSize / 2) : (pos.x < -maxMapSize / 2)) || (pos.y >= 0 ? (pos.y > maxMapSize / 2) : (pos.y < -maxMapSize / 2)))
{
Debug.Log("Input size exceeds map's max size.");
return;
}
Vector2Int floorPos = new Vector2Int(x, y);
if (floorGrid.ContainsKey(floorPos))
if (floorGrid.ContainsKey(pos))
{
Destroy(floorGrid[floorPos].gameObject);
floorGrid.Remove(floorPos);
Destroy(floorGrid[pos].gameObject);
floorGrid.Remove(pos);
StartCoroutine(MapManager.inst.Rebaker());
}
else
Debug.Log("Floor doesn't exists at : (" + x + ", " + y + ")");
Debug.Log("Floor doesn't exists at : (" + pos.x + ", " + pos.y + ")");
}
/// <summary>
/// Remove floor at position.
/// Create wall at position.
/// </summary>
/// <param name="pos">Position of floor.</param>
public void RemoveFloor(Vector2Int pos)
/// <param name="pos">Position of wall.</param>
public void CreateWall(Vector2 pos)
{
RemoveFloor(pos.x, pos.y);
}
/// <summary>
/// Create wall between two floors.
/// </summary>
/// <param name="floor1"></param>
/// <param name="floor2"></param>
public void CreateWall(Floor floor1, Floor floor2)
{
if(floor1 == null || floor2 == null)
if (((int)pos.x >= 0 ? ((int)pos.x > maxMapSize / 2) : ((int)pos.x < -maxMapSize / 2)) || ((int)pos.y >= 0 ? ((int)pos.y > maxMapSize / 2) : ((int)pos.y < -maxMapSize / 2)))
{
Debug.Log("There is no floor near the wall.");
Debug.Log("Input size exceeds map's max size.");
return;
}
else if(floor1.mapPos == floor2.mapPos)
if (Mathf.Abs(pos.x * 10) % 5 != 0 || Mathf.Abs(pos.y * 10) % 5 != 0 || (Mathf.Abs(pos.x * 10) % 10 == 5 && Mathf.Abs(pos.y * 10) % 10 == 5) || (Mathf.Abs(pos.x * 10) % 10 != 5 && Mathf.Abs(pos.y * 10) % 10 != 5))
{
Debug.Log("Two floors are same.");
Debug.Log("Inappropriate position of wall.");
return;
}
Vector2 wallPos = (Vector2)(floor1.mapPos + floor2.mapPos) / 2;
if (!wallGrid.ContainsKey(wallPos))
if (!wallGrid.ContainsKey(pos))
{
if(Mathf.Abs(floor1.mapPos.x - floor2.mapPos.x) > 1 || Mathf.Abs(floor1.mapPos.y - floor2.mapPos.y) > 1 ||
(Mathf.Abs(floor1.mapPos.x - floor2.mapPos.x) == 1 && Mathf.Abs(floor1.mapPos.y - floor2.mapPos.y) == 1))
{
Debug.Log("Two floors are not adjacent floors.");
return;
}
wallGrid.Add(wallPos, Instantiate(MapManager.inst.wall, new Vector3(wallPos.x, 0, wallPos.y), Quaternion.identity, walls.transform).GetComponent<Wall>());
wallGrid[wallPos].SetmapPos(wallPos);
wallGrid[wallPos].transform.LookAt(floor1.transform);
wallGrid.Add(pos, Instantiate(MapManager.inst.wall, new Vector3(pos.x, 0, pos.y), Quaternion.identity, walls.transform).GetComponent<Wall>());
wallGrid[pos].SetmapPos(pos);
if (Mathf.Abs(pos.x * 10) % 10 == 5)
wallGrid[pos].transform.eulerAngles = new Vector3(0, 90, 0);
else if (Mathf.Abs(pos.y * 10) % 10 == 5)
wallGrid[pos].transform.eulerAngles = new Vector3(0, 0, 0);
StartCoroutine(MapManager.inst.Rebaker());
}
else
Debug.Log("Wall already exists between : " + floor1.mapPos + ", " + floor2.mapPos);
Debug.Log("Wall already exists at : " + pos);
}
/// <summary>
/// Create walls from two floors, toward dir's direction.
/// </summary>
/// <param name="floor1"></param>
/// <param name="floor2"></param>
/// <param name="dir">Direction you want to create walls.</param>
/// <param name="length">Amount of walls you want to create.</param>
public void CreateWall(Floor floor1, Floor floor2, Vector2 dir, int length)
/// <param name="pos">Start position of wall.</param>
/// <param name="dir">Direction of walls.</param>
/// <param name="length">Amount of walls.</param>
public void CreateWall(Vector2 pos, Vector2 dir, int length)
{
Vector2Int floor1Pos = floor1.mapPos;
Vector2Int floor2Pos = floor2.mapPos;
Vector2 wallPos = pos;
for (int i = 0; i < length; i++)
{
if(GetFloorAtPos(floor1Pos) == null || GetFloorAtPos(floor2Pos) == null)
{
Debug.Log("Floor doesn't exists.\nMaybe length you input exceeded current floors' length.");
return;
}
CreateWall(GetFloorAtPos(floor1Pos), GetFloorAtPos(floor2Pos));
floor1Pos += new Vector2Int((int)dir.x, (int)dir.y);
floor2Pos += new Vector2Int((int)dir.x, (int)dir.y);
CreateWall(wallPos);
wallPos += new Vector2((int)dir.x, (int)dir.y);
}
}
/// <summary>
/// Remove wall between two floors.
/// Remove wall at position.
/// </summary>
/// <param name="floor1"></param>
/// <param name="floor2"></param>
public void RemoveWall(Floor floor1, Floor floor2)
/// <param name="pos">Position of wall.</param>
public void RemoveWall(Vector2 pos)
{
Vector2 wallPos = (Vector2)(floor1.mapPos + floor2.mapPos) / 2;
if (wallGrid.ContainsKey(wallPos))
if (wallGrid.ContainsKey(pos))
{
Destroy(wallGrid[wallPos].gameObject);
wallGrid.Remove(wallPos);
Destroy(wallGrid[pos].gameObject);
wallGrid.Remove(pos);
StartCoroutine(MapManager.inst.Rebaker());
}
else
Debug.Log("Wall doesn't exists between : " + floor1.mapPos + ", " + floor2.mapPos);
Debug.Log("Wall doesn't exists between : " + pos);
}
private void LoadObjects()
......@@ -230,7 +182,7 @@ public class Map : MonoBehaviour
// Start is called before the first frame update
void Start()
{
Debug.Log((-0.5 * 10) % 10);
}
// Update is called once per frame
......
......@@ -14,7 +14,6 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public enum TileMode { None, Floor, Wall, StartFloor };
TileMode currentMode;
public Text modeSign;
public GameObject clickSign;
public GameObject startSign;
public Dictionary<Floor, GameObject> startSigns;
public GameObject mapSizeSetter;
......@@ -22,9 +21,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public Material editWallMat;
public Material realWallMat;
Vector2Int[] wallInputFloors;
bool isWallClicked;
bool isEditorStarted;
bool isCreateMode;
......@@ -110,7 +107,6 @@ public class MapEditor : SingletonBehaviour<MapEditor>
private void Awake()
{
MapManager.inst.isMapEditingOn = true;
clickSign.SetActive(false);
isEditorStarted = false;
isCreateMode = true;
startSigns = new Dictionary<Floor, GameObject>();
......@@ -120,8 +116,6 @@ public class MapEditor : SingletonBehaviour<MapEditor>
void Start()
{
StartMap(stage[0]);
wallInputFloors = new Vector2Int[2];
isWallClicked = false;
SwitchMode(0);
}
......@@ -135,7 +129,12 @@ public class MapEditor : SingletonBehaviour<MapEditor>
if (Physics.Raycast(mouseRay, out hit))
{
Debug.Log(hit.transform.position);
Vector2Int clickedPos = new Vector2Int((int)hit.transform.position.x, (int)hit.transform.position.z);
Vector2Int clickedPos = Vector2Int.zero;
Vector2 wallPos = Vector2.zero;
if (hit.transform.tag == "wallSign")
wallPos = new Vector2(hit.transform.position.x, hit.transform.position.z);
else
clickedPos = new Vector2Int((int)hit.transform.position.x, (int)hit.transform.position.z);
if(currentMode == TileMode.Floor)
{
if (isCreateMode)
......@@ -145,28 +144,15 @@ public class MapEditor : SingletonBehaviour<MapEditor>
}
else if(currentMode == TileMode.Wall)
{
if (!isWallClicked)
if (isCreateMode)
{
clickSign.SetActive(true);
wallInputFloors[0] = clickedPos;
clickSign.transform.position = new Vector3(clickedPos.x, 1, clickedPos.y);
isWallClicked = true;
Debug.Log(wallPos);
currentMap.CreateWall(wallPos);
if(currentMap.GetWallAtPos(wallPos) != null)
currentMap.GetWallAtPos(wallPos).gameObject.GetComponent<MeshRenderer>().material = editWallMat;
}
else
{
wallInputFloors[1] = clickedPos;
if (isCreateMode)
{
currentMap.CreateWall(currentMap.GetFloorAtPos(wallInputFloors[0]), currentMap.GetFloorAtPos(wallInputFloors[1]));
if(currentMap.GetWallAtPos(currentMap.GetFloorAtPos(wallInputFloors[0]), currentMap.GetFloorAtPos(wallInputFloors[1])) != null)
currentMap.GetWallAtPos(currentMap.GetFloorAtPos(wallInputFloors[0]), currentMap.GetFloorAtPos(wallInputFloors[1]))
.gameObject.GetComponent<MeshRenderer>().material = editWallMat;
}
else
currentMap.RemoveWall(currentMap.GetFloorAtPos(wallInputFloors[0]), currentMap.GetFloorAtPos(wallInputFloors[1]));
clickSign.SetActive(false);
isWallClicked = false;
}
currentMap.RemoveWall(wallPos);
}
else if(currentMode == TileMode.StartFloor)
{
......
......@@ -35,13 +35,28 @@ public class Player : MonoBehaviour
}
IEnumerator CheckIfPlayerArrived(Vector3 destination)
{
while (Mathf.Abs(transform.position.x - destination.x) > 0.001f || Mathf.Abs(transform.position.z - destination.z) > 0.001f)
while (Mathf.Abs(transform.position.x - destination.x) > 0.01f || Mathf.Abs(transform.position.z - destination.z) > 0.01f)
{
yield return null;
}
transform.position = new Vector3(destination.x, transform.position.y, destination.z);
PlayerController.inst.isPlayerMoving = false;
}
public IEnumerator ZoomInAtPlayer(float startTime)
{
Ray mouseRay;
RaycastHit hit;
while(Time.time - startTime <= 2)
{
yield return null;
mouseRay = Camera.main.ScreenPointToRay(Input.mousePosition);
Physics.Raycast(mouseRay, out hit);
if (!hit.collider.gameObject.tag.Equals("Player"))
break;
}
if (Time.time - startTime <= 2) ;
else Debug.Log("asdf");
}
// Start is called before the first frame update
void Start()
{
......
......@@ -48,7 +48,8 @@ public class PlayerController : SingletonBehaviour<PlayerController>
currentPlayer.ResetCurrentPlayer();
currentPlayer = hit.transform.gameObject.GetComponent<Player>();
StartCoroutine(currentPlayer.SetCurrentPlayer());
Debug.Log(hit.collider.gameObject.tag);
StartCoroutine(currentPlayer.ZoomInAtPlayer(Time.time));
Debug.Log(hit.collider.gameObject.tag);
}
else if (Physics.Raycast(mouseRay, out hit) && hit.collider.gameObject.tag.Equals("floor"))
{
......
......@@ -7,27 +7,23 @@ public class TestTools : MonoBehaviour
{
public InputField floorXInput, floorYInput;
public InputField wall1XInput, wall1YInput, wall2XInput, wall2YInput;
public InputField wallXInput, wallYInput;
public void AddFloor()
{
MapManager.inst.currentMap.CreateFloor(int.Parse(floorXInput.text), int.Parse(floorYInput.text));
MapManager.inst.currentMap.CreateFloor(new Vector2Int(int.Parse(floorXInput.text), int.Parse(floorYInput.text)));
}
public void RemoveFloor()
{
MapManager.inst.currentMap.RemoveFloor(int.Parse(floorXInput.text), int.Parse(floorYInput.text));
MapManager.inst.currentMap.RemoveFloor(new Vector2Int(int.Parse(floorXInput.text), int.Parse(floorYInput.text)));
}
public void AddWall()
{
MapManager.inst.currentMap.CreateWall(
MapManager.inst.currentMap.GetFloorAtPos(int.Parse(wall1XInput.text), int.Parse(wall1YInput.text)),
MapManager.inst.currentMap.GetFloorAtPos(int.Parse(wall2XInput.text), int.Parse(wall2YInput.text)));
MapManager.inst.currentMap.CreateWall(new Vector2(float.Parse(wallXInput.text), float.Parse(wallYInput.text)));
}
public void RemoveWall()
{
MapManager.inst.currentMap.RemoveWall(
MapManager.inst.currentMap.GetFloorAtPos(int.Parse(wall1XInput.text), int.Parse(wall1YInput.text)),
MapManager.inst.currentMap.GetFloorAtPos(int.Parse(wall2XInput.text), int.Parse(wall2YInput.text)));
MapManager.inst.currentMap.RemoveWall(new Vector2(float.Parse(wallXInput.text), float.Parse(wallYInput.text)));
}
public void SaveMap()
......
......@@ -6,6 +6,7 @@ TagManager:
tags:
- wall
- floor
- wallSign
layers:
- Default
- TransparentFX
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment