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
dba4f6af
Commit
dba4f6af
authored
May 12, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
이제 벽을 좌표만으로 생성할 수 있음. 플레이어 발사 모드 WIP
parent
36a5a80b
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
280 additions
and
847 deletions
+280
-847
MapEditorCanvas.prefab
Assets/Prefabs/MapEditor/MapEditorCanvas.prefab
+1
-81
MapEditorTile.prefab
Assets/Prefabs/MapEditor/MapEditorTile.prefab
+181
-1
MapManager.prefab
Assets/Prefabs/MapManager.prefab
+1
-1
TestTools.prefab
Assets/Prefabs/TestTools.prefab
+8
-610
SampleScene.unity
Assets/Scenes/SampleScene.unity
+0
-11
CameraController.cs
Assets/Scripts/CameraController.cs
+0
-5
Map.cs
Assets/Scripts/Map/Map.cs
+52
-100
MapEditor.cs
Assets/Scripts/MapEditor/MapEditor.cs
+13
-27
Player.cs
Assets/Scripts/Player.cs
+16
-1
PlayerController.cs
Assets/Scripts/PlayerController.cs
+2
-1
TestTools.cs
Assets/Scripts/TestTools.cs
+5
-9
TagManager.asset
ProjectSettings/TagManager.asset
+1
-0
No files found.
Assets/Prefabs/MapEditor/MapEditorCanvas.prefab
View file @
dba4f6af
...
...
@@ -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
}
...
...
Assets/Prefabs/MapEditor/MapEditorTile.prefab
View file @
dba4f6af
%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
}
...
...
Assets/Prefabs/MapManager.prefab
View file @
dba4f6af
...
...
@@ -51,4 +51,4 @@ MonoBehaviour:
currentMap
:
{
fileID
:
0
}
surface
:
{
fileID
:
0
}
stage
:
-
{
fileID
:
6311566525947587311
,
guid
:
49597164dd7e7454ca5a790c491a214e
,
type
:
3
}
-
{
fileID
:
2597539376576235671
,
guid
:
bec0ce48aa2c7d14abcf504346360066
,
type
:
3
}
Assets/Prefabs/TestTools.prefab
View file @
dba4f6af
This diff is collapsed.
Click to expand it.
Assets/Scenes/SampleScene.unity
View file @
dba4f6af
...
...
@@ -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
...
...
Assets/Scripts/CameraController.cs
View file @
dba4f6af
...
...
@@ -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
();
}
}
Assets/Scripts/Map/Map.cs
View file @
dba4f6af
This diff is collapsed.
Click to expand it.
Assets/Scripts/MapEditor/MapEditor.cs
View file @
dba4f6af
...
...
@@ -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
;
...
...
@@ -23,8 +22,6 @@ 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
)
{
clickSign
.
SetActive
(
true
);
wallInputFloors
[
0
]
=
clickedPos
;
clickSign
.
transform
.
position
=
new
Vector3
(
clickedPos
.
x
,
1
,
clickedPos
.
y
);
isWallClicked
=
true
;
}
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
;
Debug
.
Log
(
wallPos
);
currentMap
.
CreateWall
(
wallPos
);
if
(
currentMap
.
GetWallAtPos
(
wallPos
)
!=
null
)
currentMap
.
GetWallAtPos
(
wallPos
)
.
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
)
{
...
...
Assets/Scripts/Player.cs
View file @
dba4f6af
...
...
@@ -35,13 +35,28 @@ public class Player : MonoBehaviour
}
IEnumerator
CheckIfPlayerArrived
(
Vector3
destination
)
{
while
(
Mathf
.
Abs
(
transform
.
position
.
x
-
destination
.
x
)
>
0.0
01f
||
Mathf
.
Abs
(
transform
.
position
.
z
-
destination
.
z
)
>
0.0
01f
)
while
(
Mathf
.
Abs
(
transform
.
position
.
x
-
destination
.
x
)
>
0.0
1f
||
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
()
{
...
...
Assets/Scripts/PlayerController.cs
View file @
dba4f6af
...
...
@@ -48,6 +48,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
currentPlayer
.
ResetCurrentPlayer
();
currentPlayer
=
hit
.
transform
.
gameObject
.
GetComponent
<
Player
>();
StartCoroutine
(
currentPlayer
.
SetCurrentPlayer
());
StartCoroutine
(
currentPlayer
.
ZoomInAtPlayer
(
Time
.
time
));
Debug
.
Log
(
hit
.
collider
.
gameObject
.
tag
);
}
else
if
(
Physics
.
Raycast
(
mouseRay
,
out
hit
)
&&
hit
.
collider
.
gameObject
.
tag
.
Equals
(
"floor"
))
...
...
Assets/Scripts/TestTools.cs
View file @
dba4f6af
...
...
@@ -7,27 +7,23 @@ public class TestTools : MonoBehaviour
{
public
InputField
floorXInput
,
floorYInput
;
public
InputField
wall
1XInput
,
wall1YInput
,
wall2XInput
,
wall2
YInput
;
public
InputField
wall
XInput
,
wall
YInput
;
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
()
...
...
ProjectSettings/TagManager.asset
View file @
dba4f6af
...
...
@@ -6,6 +6,7 @@ TagManager:
tags
:
-
wall
-
floor
-
wallSign
layers
:
-
Default
-
TransparentFX
...
...
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