Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
man-in-the-mirror
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
4
Issues
4
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MIM
man-in-the-mirror
Commits
7b1a3753
Commit
7b1a3753
authored
May 14, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
머지 완료. 이제 일반 벽이랑 거울을 구분하지 않음.
parent
5ac41704
Changes
13
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
1046 additions
and
9110 deletions
+1046
-9110
Player3Test.prefab
Assets/Player3Test.prefab
+760
-8992
Player3Test.prefab.meta
Assets/Player3Test.prefab.meta
+1
-1
EmptyStage.prefab
Assets/Prefabs/Map/EmptyStage.prefab
+2
-34
MapEditorCanvas.prefab
Assets/Prefabs/MapEditor/MapEditorCanvas.prefab
+220
-11
MapManager.prefab
Assets/Prefabs/MapManager.prefab
+2
-1
TestTools.prefab
Assets/Prefabs/TestTools.prefab
+1
-1
SampleScene.unity
Assets/Scenes/SampleScene.unity
+0
-11
Map.cs
Assets/Scripts/Map/Map.cs
+26
-28
Mirror.cs
Assets/Scripts/Map/Mirror.cs
+12
-22
MapEditor.cs
Assets/Scripts/MapEditor/MapEditor.cs
+17
-5
MapManager.cs
Assets/Scripts/MapManager.cs
+1
-0
MirrorReflect.cs
Assets/Scripts/MirrorReflect.cs
+1
-1
TestTools.cs
Assets/Scripts/TestTools.cs
+3
-3
No files found.
Assets/Player3Test.prefab
View file @
7b1a3753
This diff is collapsed.
Click to expand it.
Assets/Player3Test.prefab.meta
View file @
7b1a3753
fileFormatVersion: 2
fileFormatVersion: 2
guid:
efdd0a8c7422a444aaf46a97886b9674
guid:
dbb2e09c19fe5ad49b11a6b95e5ac9e8
PrefabImporter:
PrefabImporter:
externalObjects: {}
externalObjects: {}
userData:
userData:
...
...
Assets/Prefabs/Map/EmptyStage.prefab
View file @
7b1a3753
...
@@ -60,7 +60,6 @@ Transform:
...
@@ -60,7 +60,6 @@ Transform:
m_Children
:
m_Children
:
-
{
fileID
:
630498074586648373
}
-
{
fileID
:
630498074586648373
}
-
{
fileID
:
630498075143909937
}
-
{
fileID
:
630498075143909937
}
-
{
fileID
:
3826732887261846405
}
-
{
fileID
:
529438060023616287
}
-
{
fileID
:
529438060023616287
}
m_Father
:
{
fileID
:
0
}
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
0
m_RootOrder
:
0
...
@@ -81,8 +80,7 @@ MonoBehaviour:
...
@@ -81,8 +80,7 @@ MonoBehaviour:
testInputSizeY
:
0
testInputSizeY
:
0
maxMapSize
:
0
maxMapSize
:
0
floors
:
{
fileID
:
630498074586648370
}
floors
:
{
fileID
:
630498074586648370
}
normalWalls
:
{
fileID
:
630498075143909950
}
walls
:
{
fileID
:
630498075143909950
}
mirrors
:
{
fileID
:
7511194446601115184
}
objects
:
{
fileID
:
4632550998073714819
}
objects
:
{
fileID
:
4632550998073714819
}
startFloors
:
[]
startFloors
:
[]
---
!u!1
&630498075143909950
---
!u!1
&630498075143909950
...
@@ -95,7 +93,7 @@ GameObject:
...
@@ -95,7 +93,7 @@ GameObject:
m_Component
:
m_Component
:
-
component
:
{
fileID
:
630498075143909937
}
-
component
:
{
fileID
:
630498075143909937
}
m_Layer
:
0
m_Layer
:
0
m_Name
:
Normal
Walls
m_Name
:
Walls
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
@@ -143,35 +141,5 @@ Transform:
...
@@ -143,35 +141,5 @@ Transform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
630498074781569475
}
m_Father
:
{
fileID
:
630498074781569475
}
m_RootOrder
:
3
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
---
!u!1
&7511194446601115184
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
3826732887261846405
}
m_Layer
:
0
m_Name
:
Mirrors
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&3826732887261846405
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
7511194446601115184
}
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
:
630498074781569475
}
m_RootOrder
:
2
m_RootOrder
:
2
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
Assets/Prefabs/MapEditor/MapEditorCanvas.prefab
View file @
7b1a3753
...
@@ -30,7 +30,7 @@ RectTransform:
...
@@ -30,7 +30,7 @@ RectTransform:
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_Children
:
[]
m_Children
:
[]
m_Father
:
{
fileID
:
1444571407667829093
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
3
m_RootOrder
:
4
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
1
}
m_AnchorMin
:
{
x
:
0.5
,
y
:
1
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
1
}
m_AnchorMax
:
{
x
:
0.5
,
y
:
1
}
...
@@ -190,7 +190,7 @@ RectTransform:
...
@@ -190,7 +190,7 @@ RectTransform:
m_Children
:
m_Children
:
-
{
fileID
:
1439117913
}
-
{
fileID
:
1439117913
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
8
m_RootOrder
:
9
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
1
}
m_AnchorMin
:
{
x
:
0
,
y
:
1
}
m_AnchorMax
:
{
x
:
0
,
y
:
1
}
m_AnchorMax
:
{
x
:
0
,
y
:
1
}
...
@@ -280,7 +280,7 @@ MonoBehaviour:
...
@@ -280,7 +280,7 @@ MonoBehaviour:
m_Arguments
:
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
UnityEngine.Object, UnityEngine
m_ObjectArgumentAssemblyTypeName
:
UnityEngine.Object, UnityEngine
m_IntArgument
:
3
m_IntArgument
:
4
m_FloatArgument
:
0
m_FloatArgument
:
0
m_StringArgument
:
m_StringArgument
:
m_BoolArgument
:
0
m_BoolArgument
:
0
...
@@ -300,7 +300,7 @@ GameObject:
...
@@ -300,7 +300,7 @@ GameObject:
-
component
:
{
fileID
:
696008945
}
-
component
:
{
fileID
:
696008945
}
-
component
:
{
fileID
:
696008944
}
-
component
:
{
fileID
:
696008944
}
m_Layer
:
5
m_Layer
:
5
m_Name
:
Select Wall
m_Name
:
Select
Normal
Wall
m_TagString
:
Untagged
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
...
@@ -323,7 +323,7 @@ RectTransform:
...
@@ -323,7 +323,7 @@ RectTransform:
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
-100
,
y
:
-
30
0
}
m_AnchoredPosition
:
{
x
:
-100
,
y
:
-
25
0
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&696008946
---
!u!222
&696008946
...
@@ -527,11 +527,11 @@ RectTransform:
...
@@ -527,11 +527,11 @@ RectTransform:
m_Children
:
m_Children
:
-
{
fileID
:
369540419
}
-
{
fileID
:
369540419
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
4
m_RootOrder
:
5
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
-100
,
y
:
-5
0
2
}
m_AnchoredPosition
:
{
x
:
-100
,
y
:
-5
5
2
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&820947106
---
!u!222
&820947106
...
@@ -702,7 +702,7 @@ MonoBehaviour:
...
@@ -702,7 +702,7 @@ MonoBehaviour:
m_HorizontalOverflow
:
0
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_LineSpacing
:
1
m_Text
:
Wall
m_Text
:
Normal
Wall
---
!u!1
&1313533563
---
!u!1
&1313533563
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -735,7 +735,7 @@ RectTransform:
...
@@ -735,7 +735,7 @@ RectTransform:
m_Children
:
m_Children
:
-
{
fileID
:
1986925106
}
-
{
fileID
:
1986925106
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
7
m_RootOrder
:
8
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
0
,
y
:
1
}
m_AnchorMin
:
{
x
:
0
,
y
:
1
}
m_AnchorMax
:
{
x
:
0
,
y
:
1
}
m_AnchorMax
:
{
x
:
0
,
y
:
1
}
...
@@ -1181,7 +1181,7 @@ RectTransform:
...
@@ -1181,7 +1181,7 @@ RectTransform:
m_Children
:
m_Children
:
-
{
fileID
:
1689662818
}
-
{
fileID
:
1689662818
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
5
m_RootOrder
:
6
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
...
@@ -1565,6 +1565,135 @@ MonoBehaviour:
...
@@ -1565,6 +1565,135 @@ MonoBehaviour:
m_CallState
:
2
m_CallState
:
2
m_TypeName
:
UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
m_TypeName
:
UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
Culture=neutral, PublicKeyToken=null
---
!u!1
&81655362707678673
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
8783809867742632484
}
-
component
:
{
fileID
:
3181193321318070976
}
-
component
:
{
fileID
:
6686507055774122234
}
-
component
:
{
fileID
:
1575022290113492524
}
m_Layer
:
5
m_Name
:
Select Mirror
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&8783809867742632484
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
81655362707678673
}
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
:
3609199073757121303
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
3
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_AnchorMin
:
{
x
:
1
,
y
:
1
}
m_AnchorMax
:
{
x
:
1
,
y
:
1
}
m_AnchoredPosition
:
{
x
:
-100
,
y
:
-400
}
m_SizeDelta
:
{
x
:
150
,
y
:
150
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&3181193321318070976
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
81655362707678673
}
m_CullTransparentMesh
:
0
---
!u!114
&6686507055774122234
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
81655362707678673
}
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
:
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
---
!u!114
&1575022290113492524
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
81655362707678673
}
m_Enabled
:
1
m_EditorHideFlags
:
0
m_Script
:
{
fileID
:
1392445389
,
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
:
6686507055774122234
}
m_OnClick
:
m_PersistentCalls
:
m_Calls
:
-
m_Target
:
{
fileID
:
1444571408780882988
}
m_MethodName
:
SwitchMode
m_Mode
:
3
m_Arguments
:
m_ObjectArgument
:
{
fileID
:
0
}
m_ObjectArgumentAssemblyTypeName
:
UnityEngine.Object, UnityEngine
m_IntArgument
:
3
m_FloatArgument
:
0
m_StringArgument
:
m_BoolArgument
:
0
m_CallState
:
2
m_TypeName
:
UnityEngine.UI.Button+ButtonClickedEvent, UnityEngine.UI, Version=1.0.0.0,
Culture=neutral, PublicKeyToken=null
---
!u!1
&1444571407224148018
---
!u!1
&1444571407224148018
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -1739,6 +1868,7 @@ RectTransform:
...
@@ -1739,6 +1868,7 @@ RectTransform:
-
{
fileID
:
1397994405
}
-
{
fileID
:
1397994405
}
-
{
fileID
:
2052786946
}
-
{
fileID
:
2052786946
}
-
{
fileID
:
696008943
}
-
{
fileID
:
696008943
}
-
{
fileID
:
8783809867742632484
}
-
{
fileID
:
153720728
}
-
{
fileID
:
153720728
}
-
{
fileID
:
820947103
}
-
{
fileID
:
820947103
}
-
{
fileID
:
1805658145
}
-
{
fileID
:
1805658145
}
...
@@ -2328,6 +2458,85 @@ MonoBehaviour:
...
@@ -2328,6 +2458,85 @@ MonoBehaviour:
m_VerticalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_LineSpacing
:
1
m_Text
:
y
m_Text
:
y
---
!u!1
&1635523780322756234
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
3609199073757121303
}
-
component
:
{
fileID
:
7505153412200370459
}
-
component
:
{
fileID
:
3354903131333413546
}
m_Layer
:
5
m_Name
:
Text
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!224
&3609199073757121303
RectTransform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1635523780322756234
}
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
:
8783809867742632484
}
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
}
m_SizeDelta
:
{
x
:
0
,
y
:
0
}
m_Pivot
:
{
x
:
0.5
,
y
:
0.5
}
---
!u!222
&7505153412200370459
CanvasRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1635523780322756234
}
m_CullTransparentMesh
:
0
---
!u!114
&3354903131333413546
MonoBehaviour
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
1635523780322756234
}
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
:
50
m_FontStyle
:
0
m_BestFit
:
0
m_MinSize
:
3
m_MaxSize
:
300
m_Alignment
:
4
m_AlignByGeometry
:
0
m_RichText
:
1
m_HorizontalOverflow
:
0
m_VerticalOverflow
:
0
m_LineSpacing
:
1
m_Text
:
Mirror
---
!u!1
&1659395240958955467
---
!u!1
&1659395240958955467
GameObject
:
GameObject
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
@@ -2567,5 +2776,5 @@ Transform:
...
@@ -2567,5 +2776,5 @@ Transform:
-
{
fileID
:
1444571408487427164
}
-
{
fileID
:
1444571408487427164
}
-
{
fileID
:
4478955882850902285
}
-
{
fileID
:
4478955882850902285
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_Father
:
{
fileID
:
1444571407667829093
}
m_RootOrder
:
6
m_RootOrder
:
7
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
m_LocalEulerAnglesHint
:
{
x
:
0
,
y
:
0
,
z
:
0
}
Assets/Prefabs/MapManager.prefab
View file @
7b1a3753
...
@@ -47,9 +47,10 @@ MonoBehaviour:
...
@@ -47,9 +47,10 @@ MonoBehaviour:
floor
:
{
fileID
:
19711883686801522
,
guid
:
71931eea896a59a4683986cfd369b8ee
,
type
:
3
}
floor
:
{
fileID
:
19711883686801522
,
guid
:
71931eea896a59a4683986cfd369b8ee
,
type
:
3
}
normalWall
:
{
fileID
:
2953616027608884528
,
guid
:
a4dcd71ec9f819f4e88c7b5ac24f4b0d
,
normalWall
:
{
fileID
:
2953616027608884528
,
guid
:
a4dcd71ec9f819f4e88c7b5ac24f4b0d
,
type
:
3
}
type
:
3
}
mirror
:
{
fileID
:
0
}
players
:
[]
players
:
[]
player
:
{
fileID
:
8862060874303168220
,
guid
:
6ba287375b5ad4b458a7b7b99c6d6a08
,
type
:
3
}
player
:
{
fileID
:
8862060874303168220
,
guid
:
6ba287375b5ad4b458a7b7b99c6d6a08
,
type
:
3
}
currentMap
:
{
fileID
:
0
}
currentMap
:
{
fileID
:
0
}
surface
:
{
fileID
:
0
}
surface
:
{
fileID
:
0
}
stage
:
stage
:
-
{
fileID
:
2
597539376576235671
,
guid
:
bec0ce48aa2c7d14abcf504346360066
,
type
:
3
}
-
{
fileID
:
2
496973653136699540
,
guid
:
dbb2e09c19fe5ad49b11a6b95e5ac9e8
,
type
:
3
}
Assets/Prefabs/TestTools.prefab
View file @
7b1a3753
...
@@ -1215,7 +1215,7 @@ GameObject:
...
@@ -1215,7 +1215,7 @@ GameObject:
m_Icon
:
{
fileID
:
0
}
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
m_IsActive
:
0
---
!u!4
&1444571408780882984
---
!u!4
&1444571408780882984
Transform
:
Transform
:
m_ObjectHideFlags
:
0
m_ObjectHideFlags
:
0
...
...
Assets/Scenes/SampleScene.unity
View file @
7b1a3753
...
@@ -491,11 +491,6 @@ PrefabInstance:
...
@@ -491,11 +491,6 @@ PrefabInstance:
propertyPath
:
m_LocalEulerAnglesHint.z
propertyPath
:
m_LocalEulerAnglesHint.z
value
:
0
value
:
0
objectReference
:
{
fileID
:
0
}
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
1444571407667829093
,
guid
:
0b18400fb62a12d4e9cb5fbb8ecbb53f
,
type
:
3
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
0b18400fb62a12d4e9cb5fbb8ecbb53f
,
type
:
3
}
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
0b18400fb62a12d4e9cb5fbb8ecbb53f
,
type
:
3
}
---
!u!1001
&5089720519379341084
---
!u!1001
&5089720519379341084
...
@@ -639,12 +634,6 @@ PrefabInstance:
...
@@ -639,12 +634,6 @@ PrefabInstance:
propertyPath
:
surface
propertyPath
:
surface
value
:
value
:
objectReference
:
{
fileID
:
2102809461
}
objectReference
:
{
fileID
:
2102809461
}
-
target
:
{
fileID
:
3268100033343711389
,
guid
:
11285456de5f1854d947bea83275646f
,
type
:
3
}
propertyPath
:
stage.Array.data[0]
value
:
objectReference
:
{
fileID
:
1662066324165145400
,
guid
:
efdd0a8c7422a444aaf46a97886b9674
,
type
:
3
}
m_RemovedComponents
:
[]
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
11285456de5f1854d947bea83275646f
,
type
:
3
}
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
11285456de5f1854d947bea83275646f
,
type
:
3
}
---
!u!1001
&7277015660625800392
---
!u!1001
&7277015660625800392
...
...
Assets/Scripts/Map/Map.cs
View file @
7b1a3753
...
@@ -8,12 +8,10 @@ public class Map : MonoBehaviour
...
@@ -8,12 +8,10 @@ public class Map : MonoBehaviour
public
int
testInputSizeX
,
testInputSizeY
;
public
int
testInputSizeX
,
testInputSizeY
;
public
int
maxMapSize
;
public
int
maxMapSize
;
public
Dictionary
<
Vector2Int
,
Floor
>
floorGrid
;
public
Dictionary
<
Vector2Int
,
Floor
>
floorGrid
;
public
Dictionary
<
Vector2
,
NormalWall
>
normalWallGrid
;
public
Dictionary
<
Vector2
,
Wall
>
wallGrid
;
public
Dictionary
<
Vector2
,
Mirror
>
mirrorGrid
;
public
Dictionary
<
Vector2Int
,
IObject
>
objectGrid
;
public
Dictionary
<
Vector2Int
,
IObject
>
objectGrid
;
public
GameObject
floors
;
public
GameObject
floors
;
public
GameObject
normalWalls
;
public
GameObject
walls
;
public
GameObject
mirrors
;
public
GameObject
objects
;
public
GameObject
objects
;
public
List
<
Floor
>
startFloors
;
public
List
<
Floor
>
startFloors
;
...
@@ -38,7 +36,7 @@ public class Map : MonoBehaviour
...
@@ -38,7 +36,7 @@ public class Map : MonoBehaviour
/// <returns></returns>
/// <returns></returns>
public
Wall
GetWallAtPos
(
Vector2
pos
)
public
Wall
GetWallAtPos
(
Vector2
pos
)
{
{
return
normalWallGrid
.
ContainsKey
(
pos
)
?
normalW
allGrid
[
pos
]
:
null
;
return
wallGrid
.
ContainsKey
(
pos
)
?
w
allGrid
[
pos
]
:
null
;
}
}
/// <summary>
/// <summary>
/// Create floor at position.
/// Create floor at position.
...
@@ -99,7 +97,8 @@ public class Map : MonoBehaviour
...
@@ -99,7 +97,8 @@ public class Map : MonoBehaviour
/// Create wall at position.
/// Create wall at position.
/// </summary>
/// </summary>
/// <param name="pos">Position of wall.</param>
/// <param name="pos">Position of wall.</param>
public
void
CreateNormalWall
(
Vector2
pos
)
/// <param name="wallType">Type of walls.</param>
public
void
CreateWall
(
Vector2
pos
,
WallType
wallType
)
{
{
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
)))
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
)))
{
{
...
@@ -111,14 +110,18 @@ public class Map : MonoBehaviour
...
@@ -111,14 +110,18 @@ public class Map : MonoBehaviour
Debug
.
Log
(
"Inappropriate position of wall."
);
Debug
.
Log
(
"Inappropriate position of wall."
);
return
;
return
;
}
}
if
(!
normalW
allGrid
.
ContainsKey
(
pos
))
if
(!
w
allGrid
.
ContainsKey
(
pos
))
{
{
normalWallGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
normalWall
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
normalWalls
.
transform
).
GetComponent
<
NormalWall
>());
if
(
wallType
==
WallType
.
Normal
)
normalWallGrid
[
pos
].
mapPos
=
pos
;
wallGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
normalWall
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
walls
.
transform
).
GetComponent
<
Wall
>());
else
if
(
wallType
==
WallType
.
Mirror
)
wallGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
mirror
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
walls
.
transform
).
GetComponent
<
Wall
>());
wallGrid
[
pos
].
mapPos
=
pos
;
wallGrid
[
pos
].
type
=
wallType
;
if
(
Mathf
.
Abs
(
pos
.
x
*
10
)
%
10
==
5
)
if
(
Mathf
.
Abs
(
pos
.
x
*
10
)
%
10
==
5
)
normalW
allGrid
[
pos
].
transform
.
eulerAngles
=
new
Vector3
(
0
,
90
,
0
);
w
allGrid
[
pos
].
transform
.
eulerAngles
=
new
Vector3
(
0
,
90
,
0
);
else
if
(
Mathf
.
Abs
(
pos
.
y
*
10
)
%
10
==
5
)
else
if
(
Mathf
.
Abs
(
pos
.
y
*
10
)
%
10
==
5
)
normalW
allGrid
[
pos
].
transform
.
eulerAngles
=
new
Vector3
(
0
,
0
,
0
);
w
allGrid
[
pos
].
transform
.
eulerAngles
=
new
Vector3
(
0
,
0
,
0
);
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
}
}
else
else
...
@@ -130,12 +133,13 @@ public class Map : MonoBehaviour
...
@@ -130,12 +133,13 @@ public class Map : MonoBehaviour
/// <param name="pos">Start position of wall.</param>
/// <param name="pos">Start position of wall.</param>
/// <param name="dir">Direction of walls.</param>
/// <param name="dir">Direction of walls.</param>
/// <param name="length">Amount of walls.</param>
/// <param name="length">Amount of walls.</param>
public
void
CreateNormalWall
(
Vector2
pos
,
Vector2
dir
,
int
length
)
/// <param name="wallType">Type of walls.</param>
public
void
CreateWall
(
Vector2
pos
,
Vector2
dir
,
int
length
,
WallType
wallType
)
{
{
Vector2
wallPos
=
pos
;
Vector2
wallPos
=
pos
;
for
(
int
i
=
0
;
i
<
length
;
i
++)
for
(
int
i
=
0
;
i
<
length
;
i
++)
{
{
Create
NormalWall
(
wallPos
);
Create
Wall
(
wallPos
,
wallType
);
wallPos
+=
new
Vector2
((
int
)
dir
.
x
,
(
int
)
dir
.
y
);
wallPos
+=
new
Vector2
((
int
)
dir
.
x
,
(
int
)
dir
.
y
);
}
}
}
}
...
@@ -145,10 +149,10 @@ public class Map : MonoBehaviour
...
@@ -145,10 +149,10 @@ public class Map : MonoBehaviour
/// <param name="pos">Position of wall.</param>
/// <param name="pos">Position of wall.</param>
public
void
RemoveWall
(
Vector2
pos
)
public
void
RemoveWall
(
Vector2
pos
)
{
{
if
(
normalW
allGrid
.
ContainsKey
(
pos
))
if
(
w
allGrid
.
ContainsKey
(
pos
))
{
{
Destroy
(
normalW
allGrid
[
pos
].
gameObject
);
Destroy
(
w
allGrid
[
pos
].
gameObject
);
normalW
allGrid
.
Remove
(
pos
);
w
allGrid
.
Remove
(
pos
);
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
}
}
else
else
...
@@ -158,25 +162,19 @@ public class Map : MonoBehaviour
...
@@ -158,25 +162,19 @@ public class Map : MonoBehaviour
private
void
LoadObjects
()
private
void
LoadObjects
()
{
{
floorGrid
=
new
Dictionary
<
Vector2Int
,
Floor
>();
floorGrid
=
new
Dictionary
<
Vector2Int
,
Floor
>();
normalWallGrid
=
new
Dictionary
<
Vector2
,
NormalWall
>();
wallGrid
=
new
Dictionary
<
Vector2
,
Wall
>();
mirrorGrid
=
new
Dictionary
<
Vector2
,
Mirror
>();
objectGrid
=
new
Dictionary
<
Vector2Int
,
IObject
>();
objectGrid
=
new
Dictionary
<
Vector2Int
,
IObject
>();
for
(
int
i
=
0
;
i
<
floors
.
transform
.
childCount
;
i
++)
for
(
int
i
=
0
;
i
<
floors
.
transform
.
childCount
;
i
++)
{
{
Floor
floor
=
floors
.
transform
.
GetChild
(
i
).
GetComponent
<
Floor
>();
Floor
floor
=
floors
.
transform
.
GetChild
(
i
).
GetComponent
<
Floor
>();
floorGrid
.
Add
(
floor
.
mapPos
,
floor
);
floorGrid
.
Add
(
floor
.
mapPos
,
floor
);
}
}
for
(
int
i
=
0
;
i
<
normalW
alls
.
transform
.
childCount
;
i
++)
for
(
int
i
=
0
;
i
<
w
alls
.
transform
.
childCount
;
i
++)
{
{
NormalWall
normalWall
=
normalWalls
.
transform
.
GetChild
(
i
).
GetComponent
<
Normal
Wall
>();
Wall
wall
=
walls
.
transform
.
GetChild
(
i
).
GetComponent
<
Wall
>();
normalWallGrid
.
Add
(
normalWall
.
mapPos
,
normalW
all
);
wallGrid
.
Add
(
wall
.
mapPos
,
w
all
);
}
}
for
(
int
i
=
0
;
i
<
mirrors
.
transform
.
childCount
;
i
++)
for
(
int
i
=
0
;
i
<
objects
.
transform
.
childCount
;
i
++)
{
Mirror
mirror
=
mirrors
.
transform
.
GetChild
(
i
).
GetComponent
<
Mirror
>();
mirrorGrid
.
Add
(
mirror
.
mapPos
,
mirror
);
}
for
(
int
i
=
0
;
i
<
mirrors
.
transform
.
childCount
;
i
++)
{
{
IObject
iObject
=
objects
.
transform
.
GetChild
(
i
).
GetComponent
<
IObject
>();
IObject
iObject
=
objects
.
transform
.
GetChild
(
i
).
GetComponent
<
IObject
>();
objectGrid
.
Add
(
iObject
.
GetPos
(),
iObject
);
objectGrid
.
Add
(
iObject
.
GetPos
(),
iObject
);
...
@@ -186,7 +184,7 @@ public class Map : MonoBehaviour
...
@@ -186,7 +184,7 @@ public class Map : MonoBehaviour
public
void
InitiateMap
()
public
void
InitiateMap
()
{
{
floorGrid
=
new
Dictionary
<
Vector2Int
,
Floor
>();
floorGrid
=
new
Dictionary
<
Vector2Int
,
Floor
>();
normalWallGrid
=
new
Dictionary
<
Vector2
,
Normal
Wall
>();
wallGrid
=
new
Dictionary
<
Vector2
,
Wall
>();
startFloors
=
new
List
<
Floor
>();
startFloors
=
new
List
<
Floor
>();
}
}
...
...
Assets/Scripts/Map/Mirror.cs
View file @
7b1a3753
...
@@ -36,17 +36,11 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
...
@@ -36,17 +36,11 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
};
};
// check before reflect (check walls and mirrors)
// check before reflect (check walls and mirrors)
foreach
(
var
wall
in
MapManager
.
inst
.
currentMap
.
normalW
allGrid
)
foreach
(
var
wall
in
MapManager
.
inst
.
currentMap
.
w
allGrid
)
{
{
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
wall
.
Value
.
ldPos
,
false
),
PointToParRay
(
stPos
,
wall
.
Value
.
rdPos
,
false
));
if
(
wall
.
Value
.
mapPos
!=
mapPos
)
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
SubtractRay
(
parRay
,
pair
);
}
foreach
(
var
mirr
in
MapManager
.
inst
.
currentMap
.
mirrorGrid
)
{
{
if
(
mirr
.
Value
!=
this
)
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
wall
.
Value
.
ldPos
,
false
),
PointToParRay
(
stPos
,
wall
.
Value
.
rdPos
,
false
));
{
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
mirr
.
Value
.
ldPos
,
false
),
PointToParRay
(
stPos
,
mirr
.
Value
.
rdPos
,
false
));
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
SubtractRay
(
parRay
,
pair
);
SubtractRay
(
parRay
,
pair
);
}
}
...
@@ -71,7 +65,8 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
...
@@ -71,7 +65,8 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
if
((
dir
?
floor
.
Key
.
y
:
floor
.
Key
.
x
)
==
i
)
if
((
dir
?
floor
.
Key
.
y
:
floor
.
Key
.
x
)
==
i
)
{
{
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
floor
.
Value
.
mapPos
,
true
)))
if
(
IsInRay
(
parRay
,
PointToParRay
(
stPos
,
floor
.
Value
.
mapPos
,
true
)))
{
// copy floor
{
/*copy floor*/
int
nextx
=
dir
?
floor
.
Key
.
x
:
2
*
ldPos
.
x
-
floor
.
Key
.
x
;
int
nextx
=
dir
?
floor
.
Key
.
x
:
2
*
ldPos
.
x
-
floor
.
Key
.
x
;
int
nexty
=
dir
?
2
*
ldPos
.
y
-
floor
.
Key
.
y
:
floor
.
Key
.
y
;
int
nexty
=
dir
?
2
*
ldPos
.
y
-
floor
.
Key
.
y
:
floor
.
Key
.
y
;
MapManager
.
inst
.
currentMap
.
CreateFloor
(
new
Vector2Int
(
nextx
,
nexty
));
MapManager
.
inst
.
currentMap
.
CreateFloor
(
new
Vector2Int
(
nextx
,
nexty
));
...
@@ -88,23 +83,18 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
...
@@ -88,23 +83,18 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
}
}
}
}
}
}
foreach
(
var
wall
in
MapManager
.
inst
.
currentMap
.
normalW
allGrid
)
foreach
(
var
wall
in
MapManager
.
inst
.
currentMap
.
w
allGrid
)
{
{
if
((
dir
?
wall
.
Key
.
y
:
wall
.
Key
.
x
)
==
i
)
if
((
dir
?
wall
.
Key
.
y
:
wall
.
Key
.
x
)
==
i
)
{
{
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
wall
.
Value
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wall
.
Value
.
rdPos
,
true
));
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
wall
.
Value
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wall
.
Value
.
rdPos
,
true
));
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
/*copy wall*/
/*copy wall*/
SubtractRay
(
parRay
,
pair
);
float
nextx
=
dir
?
wall
.
Key
.
x
:
2
*
ldPos
.
x
-
wall
.
Key
.
x
;
}
float
nexty
=
dir
?
2
*
ldPos
.
y
-
wall
.
Key
.
y
:
wall
.
Key
.
y
;
}
MapManager
.
inst
.
currentMap
.
CreateWall
(
new
Vector2
(
nextx
,
nexty
),
wall
.
Value
.
type
);
foreach
(
var
mirr
in
MapManager
.
inst
.
currentMap
.
mirrorGrid
)
{
if
(
mirr
.
Value
!=
this
&&
(
dir
?
mirr
.
Key
.
y
:
mirr
.
Key
.
x
)
==
i
)
{
Pair
<
float
,
float
>
pair
=
new
Pair
<
float
,
float
>(
PointToParRay
(
stPos
,
mirr
.
Value
.
ldPos
,
true
),
PointToParRay
(
stPos
,
mirr
.
Value
.
rdPos
,
true
));
if
(
pair
.
l
>
pair
.
r
)
pair
=
pair
.
Swap
();
/*copy mirror*/
SubtractRay
(
parRay
,
pair
);
SubtractRay
(
parRay
,
pair
);
}
}
}
}
...
...
Assets/Scripts/MapEditor/MapEditor.cs
View file @
7b1a3753
...
@@ -11,7 +11,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
...
@@ -11,7 +11,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public
Map
currentMap
;
public
Map
currentMap
;
public
Map
[]
stage
;
public
Map
[]
stage
;
public
MapEditorTile
tile
;
public
MapEditorTile
tile
;
public
enum
TileMode
{
None
,
Floor
,
Wall
,
StartFloor
};
public
enum
TileMode
{
None
,
Floor
,
NormalWall
,
Mirror
,
StartFloor
};
TileMode
currentMode
;
TileMode
currentMode
;
public
Text
modeSign
;
public
Text
modeSign
;
public
GameObject
startSign
;
public
GameObject
startSign
;
...
@@ -47,13 +47,13 @@ public class MapEditor : SingletonBehaviour<MapEditor>
...
@@ -47,13 +47,13 @@ public class MapEditor : SingletonBehaviour<MapEditor>
Debug
.
Log
(
"There is no start floor."
);
Debug
.
Log
(
"There is no start floor."
);
else
else
{
{
foreach
(
Transform
child
in
currentMap
.
normalW
alls
.
transform
)
foreach
(
Transform
child
in
currentMap
.
w
alls
.
transform
)
{
{
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
realWallMat
;
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
realWallMat
;
}
}
PrefabUtility
.
SaveAsPrefabAsset
(
_newMap
.
gameObject
,
localPath
);
PrefabUtility
.
SaveAsPrefabAsset
(
_newMap
.
gameObject
,
localPath
);
Debug
.
Log
(
"Map saved at "
+
localPath
);
Debug
.
Log
(
"Map saved at "
+
localPath
);
foreach
(
Transform
child
in
currentMap
.
normalW
alls
.
transform
)
foreach
(
Transform
child
in
currentMap
.
w
alls
.
transform
)
{
{
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
}
}
...
@@ -142,18 +142,30 @@ public class MapEditor : SingletonBehaviour<MapEditor>
...
@@ -142,18 +142,30 @@ public class MapEditor : SingletonBehaviour<MapEditor>
else
else
currentMap
.
RemoveFloor
(
clickedPos
);
currentMap
.
RemoveFloor
(
clickedPos
);
}
}
else
if
(
currentMode
==
TileMode
.
Wall
)
else
if
(
currentMode
==
TileMode
.
Normal
Wall
)
{
{
if
(
isCreateMode
)
if
(
isCreateMode
)
{
{
Debug
.
Log
(
wallPos
);
Debug
.
Log
(
wallPos
);
currentMap
.
Create
NormalWall
(
wallPos
);
currentMap
.
Create
Wall
(
wallPos
,
WallType
.
Normal
);
if
(
currentMap
.
GetWallAtPos
(
wallPos
)
!=
null
)
if
(
currentMap
.
GetWallAtPos
(
wallPos
)
!=
null
)
currentMap
.
GetWallAtPos
(
wallPos
).
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
currentMap
.
GetWallAtPos
(
wallPos
).
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
}
}
else
else
currentMap
.
RemoveWall
(
wallPos
);
currentMap
.
RemoveWall
(
wallPos
);
}
}
else
if
(
currentMode
==
TileMode
.
Mirror
)
{
if
(
isCreateMode
)
{
Debug
.
Log
(
wallPos
);
currentMap
.
CreateWall
(
wallPos
,
WallType
.
Mirror
);
if
(
currentMap
.
GetWallAtPos
(
wallPos
)
!=
null
)
currentMap
.
GetWallAtPos
(
wallPos
).
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
}
else
currentMap
.
RemoveWall
(
wallPos
);
}
else
if
(
currentMode
==
TileMode
.
StartFloor
)
else
if
(
currentMode
==
TileMode
.
StartFloor
)
{
{
if
(
isCreateMode
)
if
(
isCreateMode
)
...
...
Assets/Scripts/MapManager.cs
View file @
7b1a3753
...
@@ -9,6 +9,7 @@ public class MapManager : SingletonBehaviour<MapManager>
...
@@ -9,6 +9,7 @@ public class MapManager : SingletonBehaviour<MapManager>
public
bool
isMapEditingOn
;
public
bool
isMapEditingOn
;
public
Floor
floor
;
public
Floor
floor
;
public
NormalWall
normalWall
;
public
NormalWall
normalWall
;
public
Mirror
mirror
;
public
List
<
GameObject
>
players
;
public
List
<
GameObject
>
players
;
public
GameObject
player
;
public
GameObject
player
;
public
Map
currentMap
;
public
Map
currentMap
;
...
...
Assets/Scripts/MirrorReflect.cs
View file @
7b1a3753
...
@@ -8,7 +8,7 @@ public class MirrorReflect : MonoBehaviour
...
@@ -8,7 +8,7 @@ public class MirrorReflect : MonoBehaviour
enum
Direction
{
X
,
Z
}
// +X direction and +Z direction. Mirror on both side
enum
Direction
{
X
,
Z
}
// +X direction and +Z direction. Mirror on both side
[
SerializeField
]
[
SerializeField
]
private
Direction
direction
;
private
Direction
direction
=
Direction
.
X
;
public
Transform
mirror
;
public
Transform
mirror
;
public
Transform
mainCam
;
public
Transform
mainCam
;
...
...
Assets/Scripts/TestTools.cs
View file @
7b1a3753
...
@@ -9,7 +9,7 @@ public class TestTools : MonoBehaviour
...
@@ -9,7 +9,7 @@ public class TestTools : MonoBehaviour
public
InputField
wallXInput
,
wallYInput
;
public
InputField
wallXInput
,
wallYInput
;
public
void
AddFloor
()
/*
public void AddFloor()
{
{
MapManager.inst.currentMap.CreateFloor(new Vector2Int(int.Parse(floorXInput.text), int.Parse(floorYInput.text)));
MapManager.inst.currentMap.CreateFloor(new Vector2Int(int.Parse(floorXInput.text), int.Parse(floorYInput.text)));
}
}
...
@@ -19,7 +19,7 @@ public class TestTools : MonoBehaviour
...
@@ -19,7 +19,7 @@ public class TestTools : MonoBehaviour
}
}
public void AddWall()
public void AddWall()
{
{
MapManager
.
inst
.
currentMap
.
Create
Normal
Wall
(
new
Vector2
(
float
.
Parse
(
wallXInput
.
text
),
float
.
Parse
(
wallYInput
.
text
)));
MapManager.inst.currentMap.CreateWall(new Vector2(float.Parse(wallXInput.text), float.Parse(wallYInput.text)));
}
}
public void RemoveWall()
public void RemoveWall()
{
{
...
@@ -33,7 +33,7 @@ public class TestTools : MonoBehaviour
...
@@ -33,7 +33,7 @@ public class TestTools : MonoBehaviour
public void LoadMap()
public void LoadMap()
{
{
MapManager.inst.LoadMap(MapManager.inst.stage[1]);
MapManager.inst.LoadMap(MapManager.inst.stage[1]);
}
}
*/
// Start is called before the first frame update
// Start is called before the first frame update
void
Start
()
void
Start
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment