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
c95e51c0
Commit
c95e51c0
authored
Jun 29, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'map'
parents
125f9cfe
755664ce
Changes
12
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1105 additions
and
1087 deletions
+1105
-1087
Player3Test.prefab
Assets/Player3Test.prefab
+1
-25
Goal Sign.prefab
Assets/Prefabs/MapEditor/Goal Sign.prefab
+82
-0
Goal Sign.prefab.meta
Assets/Prefabs/MapEditor/Goal Sign.prefab.meta
+1
-1
MapEditorCanvas.prefab
Assets/Prefabs/MapEditor/MapEditorCanvas.prefab
+862
-13
SavedMap_2019-05-14-22-39-32.prefab
Assets/SavedMap_2019-05-14-22-39-32.prefab
+0
-982
MapEditor.unity
Assets/Scenes/MapEditor.unity
+71
-2
GameManager.cs
Assets/Scripts/Managers/GameManager.cs
+13
-0
MapManager.cs
Assets/Scripts/Managers/MapManager.cs
+3
-1
ClearCondition.cs
Assets/Scripts/Map/ClearCondition.cs
+16
-13
Map.cs
Assets/Scripts/Map/Map.cs
+9
-8
MapEditor.cs
Assets/Scripts/MapEditor/MapEditor.cs
+46
-31
PlayerController.cs
Assets/Scripts/PlayerController.cs
+1
-11
No files found.
Assets/Player3Test.prefab
View file @
c95e51c0
...
...
@@ -106,7 +106,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
1
,
y
:
0
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&1634709099193762938
GameObject
:
...
...
@@ -214,7 +213,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-2
,
y
:
-1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&1638206002697659172
GameObject
:
...
...
@@ -322,7 +320,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
1
,
y
:
1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&1737410653383664023
GameObject
:
...
...
@@ -378,6 +375,7 @@ MonoBehaviour:
-
{
fileID
:
6317210441967747213
}
-
{
fileID
:
8692496119037193698
}
-
{
fileID
:
4002211523417806573
}
initialBullets
:
00000000010000000200000000000000010000000200000000000000010000000200000000000000
clearConditions
:
-
type
:
0
count
:
0
...
...
@@ -491,7 +489,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
2
,
y
:
0
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&2189700681577347922
GameObject
:
...
...
@@ -599,7 +596,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-2
,
y
:
2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&2292282653549884484
GameObject
:
...
...
@@ -707,7 +703,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-1
,
y
:
2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&2339437859421285817
GameObject
:
...
...
@@ -815,7 +810,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-2
,
y
:
-2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&2681926362236754680
GameObject
:
...
...
@@ -923,7 +917,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
2
,
y
:
1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&3525591482656589422
GameObject
:
...
...
@@ -1031,7 +1024,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
2
,
y
:
-2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&4007647678807291638
GameObject
:
...
...
@@ -1264,7 +1256,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
1
,
y
:
-2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&4592160369612705167
GameObject
:
...
...
@@ -1372,7 +1363,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
1
,
y
:
-1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&4709249395185914413
GameObject
:
...
...
@@ -1480,7 +1470,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
1
,
y
:
2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&4810397660174508062
GameObject
:
...
...
@@ -1588,7 +1577,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-1
,
y
:
-1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&5069305046428251933
GameObject
:
...
...
@@ -1696,7 +1684,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-1
,
y
:
0
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&5342110572568681991
GameObject
:
...
...
@@ -1804,7 +1791,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
0
,
y
:
-2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&5390496715387352304
GameObject
:
...
...
@@ -2092,7 +2078,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
0
,
y
:
1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&6532917746544365902
GameObject
:
...
...
@@ -2234,7 +2219,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-2
,
y
:
1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&7141810549857698684
GameObject
:
...
...
@@ -2342,7 +2326,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
0
,
y
:
0
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&7422189717627061705
GameObject
:
...
...
@@ -2575,7 +2558,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-2
,
y
:
0
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&7560450311381198066
GameObject
:
...
...
@@ -2838,7 +2820,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-1
,
y
:
1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&8683807963293059402
GameObject
:
...
...
@@ -2946,7 +2927,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
0
,
y
:
2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&8695425579486219508
GameObject
:
...
...
@@ -3054,7 +3034,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
2
,
y
:
2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&8852115476851130467
GameObject
:
...
...
@@ -3162,7 +3141,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
0
,
y
:
-1
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&9046791506793280589
GameObject
:
...
...
@@ -3270,7 +3248,6 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
-1
,
y
:
-2
}
isPassed
:
0
isGoalFloor
:
0
---
!u!1
&9206324191454810788
GameObject
:
...
...
@@ -3378,5 +3355,4 @@ MonoBehaviour:
m_Name
:
m_EditorClassIdentifier
:
mapPos
:
{
x
:
2
,
y
:
-1
}
isPassed
:
0
isGoalFloor
:
0
Assets/Prefabs/MapEditor/Goal Sign.prefab
0 → 100644
View file @
c95e51c0
%YAML
1.1
%TAG
!u!
tag:unity3d.com,2011:
---
!u!1
&646008409675212278
GameObject
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
serializedVersion
:
6
m_Component
:
-
component
:
{
fileID
:
5027787848459216200
}
-
component
:
{
fileID
:
841522919254151368
}
m_Layer
:
0
m_Name
:
Goal Sign
m_TagString
:
Untagged
m_Icon
:
{
fileID
:
0
}
m_NavMeshLayer
:
0
m_StaticEditorFlags
:
0
m_IsActive
:
1
---
!u!4
&5027787848459216200
Transform
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
646008409675212278
}
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
:
0
}
m_RootOrder
:
0
m_LocalEulerAnglesHint
:
{
x
:
90
,
y
:
0
,
z
:
0
}
---
!u!212
&841522919254151368
SpriteRenderer
:
m_ObjectHideFlags
:
0
m_CorrespondingSourceObject
:
{
fileID
:
0
}
m_PrefabInstance
:
{
fileID
:
0
}
m_PrefabAsset
:
{
fileID
:
0
}
m_GameObject
:
{
fileID
:
646008409675212278
}
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_ReceiveGI
:
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.99501103
,
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
Assets/
SavedMap_2019-05-14-22-39-32
.prefab.meta
→
Assets/
Prefabs/MapEditor/Goal Sign
.prefab.meta
View file @
c95e51c0
fileFormatVersion: 2
guid:
32ff564f49869bf40a53d07394eb081b
guid:
6801da87b9c13dc4a97e2c31d6e37ab3
PrefabImporter:
externalObjects: {}
userData:
...
...
Assets/Prefabs/MapEditor/MapEditorCanvas.prefab
View file @
c95e51c0
This diff is collapsed.
Click to expand it.
Assets/SavedMap_2019-05-14-22-39-32.prefab
deleted
100644 → 0
View file @
125f9cfe
This diff is collapsed.
Click to expand it.
Assets/Scenes/MapEditor.unity
View file @
c95e51c0
...
...
@@ -38,7 +38,7 @@ RenderSettings:
m_ReflectionIntensity
:
1
m_CustomReflection
:
{
fileID
:
0
}
m_Sun
:
{
fileID
:
0
}
m_IndirectSpecularColor
:
{
r
:
0.18028334
,
g
:
0.225713
4
,
b
:
0.30692226
,
a
:
1
}
m_IndirectSpecularColor
:
{
r
:
0.18028334
,
g
:
0.225713
28
,
b
:
0.3069217
,
a
:
1
}
m_UseRadianceAmbientProbe
:
0
---
!u!157
&3
LightmapSettings
:
...
...
@@ -341,7 +341,7 @@ Transform:
m_GameObject
:
{
fileID
:
797716766
}
m_LocalRotation
:
{
x
:
0.40821788
,
y
:
-0.23456968
,
z
:
0.10938163
,
w
:
0.8754261
}
m_LocalPosition
:
{
x
:
0
,
y
:
3
,
z
:
0
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
1
}
m_LocalScale
:
{
x
:
1
,
y
:
1
,
z
:
0.99999994
}
m_Children
:
[]
m_Father
:
{
fileID
:
0
}
m_RootOrder
:
2
...
...
@@ -501,6 +501,75 @@ PrefabInstance:
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
20dee07e28273f049a9093ae4453912f
,
type
:
3
}
---
!u!1001
&1133429038
PrefabInstance
:
m_ObjectHideFlags
:
0
serializedVersion
:
2
m_Modification
:
m_TransformParent
:
{
fileID
:
0
}
m_Modifications
:
-
target
:
{
fileID
:
52444459818764334
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_Name
value
:
GameManager
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalPosition.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalPosition.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalPosition.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalRotation.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalRotation.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalRotation.z
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalRotation.w
value
:
1
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_RootOrder
value
:
6
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.x
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.y
value
:
0
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764335
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_LocalEulerAnglesHint.z
value
:
0
objectReference
:
{
fileID
:
0
}
m_RemovedComponents
:
[]
m_SourcePrefab
:
{
fileID
:
100100000
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
---
!u!1
&1295796961
GameObject
:
m_ObjectHideFlags
:
0
...
...
Assets/Scripts/Managers/GameManager.cs
View file @
c95e51c0
...
...
@@ -40,5 +40,18 @@ public class GameManager : SingletonBehaviour<GameManager>
{
if
(!
MapManager
.
inst
.
isMapEditingOn
)
MapManager
.
inst
.
LoadMap
(
MapManager
.
inst
.
stage
[
0
]);
else
{
for
(
int
i
=
0
;
i
<
9
;
i
++)
clearIndex
[
i
]
=
-
1
;
nFloor
=
clearIndex
[(
int
)
ClearType
.
NFloor
];
nTurret
=
clearIndex
[(
int
)
ClearType
.
NTurret
];
nCase
=
clearIndex
[(
int
)
ClearType
.
NCase
];
nPlayer
=
clearIndex
[(
int
)
ClearType
.
NPlayer
];
aFloor
=
clearIndex
[(
int
)
ClearType
.
AllFloor
];
aTurret
=
clearIndex
[(
int
)
ClearType
.
AllTurret
];
aCase
=
clearIndex
[(
int
)
ClearType
.
AllCase
];
white
=
clearIndex
[(
int
)
ClearType
.
White
];
black
=
clearIndex
[(
int
)
ClearType
.
Black
];
}
}
}
Assets/Scripts/Managers/MapManager.cs
View file @
c95e51c0
...
...
@@ -25,7 +25,7 @@ public class MapManager : SingletonBehaviour<MapManager>
public
void
LoadMap
(
Map
_newMap
)
{
if
(
currentMap
!=
null
)
if
(
currentMap
!=
null
)
Destroy
(
currentMap
.
gameObject
);
currentMap
=
Instantiate
(
_newMap
);
currentMap
.
transform
.
position
=
new
Vector3
(
0
,
0
,
0
);
...
...
@@ -33,6 +33,8 @@ public class MapManager : SingletonBehaviour<MapManager>
GameManager
.
inst
.
SetClearIndex
(
currentMap
);
for
(
int
i
=
0
;
i
<
currentMap
.
startFloors
.
Count
;
i
++)
PlayerController
.
inst
.
CreatePlayer
(
currentMap
.
startFloors
[
i
]);
for
(
int
i
=
0
;
i
<
currentMap
.
initialBullets
.
Count
;
i
++)
PlayerController
.
inst
.
bulletList
.
Add
(
currentMap
.
initialBullets
[
i
]);
}
public
IEnumerator
Rebaker
()
{
...
...
Assets/Scripts/Map/ClearCondition.cs
View file @
c95e51c0
...
...
@@ -31,6 +31,8 @@ public class ClearCondition
}*/
public
void
IsDone
(
int
_count
=
0
,
int
_goal
=
0
)
{
if
(!
MapManager
.
inst
.
isMapEditingOn
)
{
count
+=
_count
;
goal
+=
_goal
;
...
...
@@ -48,4 +50,5 @@ public class ClearCondition
isDone
=
false
;
}
}
}
}
Assets/Scripts/Map/Map.cs
View file @
c95e51c0
...
...
@@ -14,6 +14,7 @@ public class Map : MonoBehaviour
public
GameObject
walls
;
public
GameObject
objects
;
public
List
<
Floor
>
startFloors
;
public
List
<
BulletCode
>
initialBullets
;
public
List
<
ClearCondition
>
clearConditions
;
...
...
@@ -61,7 +62,7 @@ public class Map : MonoBehaviour
floorGrid
[
pos
].
mapPos
=
pos
;
floorGrid
[
pos
].
isGoalFloor
=
isGoal
;
if
(
GameManager
.
aFloor
>=
0
&&
isGoal
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aFloor
].
IsDone
(
0
,
1
);
clearConditions
[
GameManager
.
aFloor
].
IsDone
(
0
,
1
);
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
}
else
...
...
@@ -96,7 +97,7 @@ public class Map : MonoBehaviour
if
(
floorGrid
.
ContainsKey
(
pos
))
{
if
(
GameManager
.
aFloor
>=
0
&&
floorGrid
[
pos
].
isGoalFloor
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aFloor
].
IsDone
(
0
,
-
1
);
clearConditions
[
GameManager
.
aFloor
].
IsDone
(
0
,
-
1
);
Destroy
(
floorGrid
[
pos
].
gameObject
);
floorGrid
.
Remove
(
pos
);
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
...
...
@@ -219,12 +220,12 @@ public class Map : MonoBehaviour
case
ObjType
.
Briefcase
:
objectGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
briefCase
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
objects
.
transform
).
GetComponent
<
IObject
>());
if
(
GameManager
.
aCase
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aCase
].
IsDone
(
0
,
1
);
clearConditions
[
GameManager
.
aCase
].
IsDone
(
0
,
1
);
break
;
case
ObjType
.
Camera
:
objectGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
cameraTurret
,
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
objects
.
transform
).
GetComponent
<
IObject
>());
if
(
GameManager
.
aTurret
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aTurret
].
IsDone
(
0
,
1
);
clearConditions
[
GameManager
.
aTurret
].
IsDone
(
0
,
1
);
break
;
case
ObjType
.
Mannequin
:
objectGrid
.
Add
(
pos
,
Instantiate
(
MapManager
.
inst
.
mannequins
[
Random
.
Range
(
0
,
5
)],
new
Vector3
(
pos
.
x
,
0
,
pos
.
y
),
Quaternion
.
identity
,
objects
.
transform
).
GetComponent
<
IObject
>());
...
...
@@ -246,15 +247,15 @@ public class Map : MonoBehaviour
if
(
objectGrid
.
ContainsKey
(
pos
))
{
if
(
objectGrid
[
pos
].
GetType
()
==
ObjType
.
Briefcase
&&
GameManager
.
aCase
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aCase
].
IsDone
(
0
,
-
1
);
clearConditions
[
GameManager
.
aCase
].
IsDone
(
0
,
-
1
);
else
if
(
objectGrid
[
pos
].
GetType
()
==
ObjType
.
Camera
&&
GameManager
.
aTurret
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
aTurret
].
IsDone
(
0
,
-
1
);
clearConditions
[
GameManager
.
aTurret
].
IsDone
(
0
,
-
1
);
else
if
(
objectGrid
[
pos
].
GetType
()
==
ObjType
.
Mannequin
)
{
if
(
objectGrid
[
pos
].
GetObject
().
GetComponent
<
Mannequin
>().
isWhite
&&
GameManager
.
white
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
white
].
IsDone
(
0
,
-
1
);
clearConditions
[
GameManager
.
white
].
IsDone
(
0
,
-
1
);
else
if
(!
objectGrid
[
pos
].
GetObject
().
GetComponent
<
Mannequin
>().
isWhite
&&
GameManager
.
black
>=
0
)
MapManager
.
inst
.
currentMap
.
clearConditions
[
GameManager
.
black
].
IsDone
(
0
,
-
1
);
clearConditions
[
GameManager
.
black
].
IsDone
(
0
,
-
1
);
}
Destroy
(
objectGrid
[
pos
].
GetObject
());
objectGrid
.
Remove
(
pos
);
...
...
Assets/Scripts/MapEditor/MapEditor.cs
View file @
c95e51c0
...
...
@@ -9,16 +9,13 @@ public class MapEditor : SingletonBehaviour<MapEditor>
public
Map
currentMap
;
public
Map
[]
stage
;
public
MapEditorTile
tile
;
public
enum
TileMode
{
None
,
Floor
,
Normal
Wall
,
Mirror
,
StartFloor
,
Briefcase
,
Camera
,
WMannequin
,
BMannequin
};
public
enum
TileMode
{
None
,
Floor
,
Normal
,
Mirror
,
StartFloor
,
Briefcase
,
Camera
,
WMannequin
,
BMannequin
,
goalFloor
};
TileMode
currentMode
;
public
Text
modeSign
;
public
GameObject
startSign
;
public
Dictionary
<
Floor
,
GameObject
>
startSigns
;
public
GameObject
mapSizeSetter
;
public
GameObject
mapEditorTiles
;
public
GameObject
startSign
,
goalSign
,
mapSizeSetter
,
mapEditorTiles
;
public
Dictionary
<
Floor
,
GameObject
>
startSigns
,
goalSigns
;
public
Material
editWallMat
;
public
Material
realWallMat
;
public
Material
editNormalMat
,
realNormalMat
;
bool
isEditorStarted
;
bool
isCreateMode
;
...
...
@@ -45,16 +42,14 @@ public class MapEditor : SingletonBehaviour<MapEditor>
Debug
.
Log
(
"There is no start floor."
);
else
{
foreach
(
Transform
child
in
currentMap
.
walls
.
transform
)
{
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
realWallMat
;
}
foreach
(
Transform
child
in
currentMap
.
walls
.
transform
)
if
(
child
.
GetComponent
<
Wall
>()
is
NormalWall
)
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
realNormalMat
;
PrefabUtility
.
SaveAsPrefabAsset
(
_newMap
.
gameObject
,
localPath
);
Debug
.
Log
(
"Map saved at "
+
localPath
);
foreach
(
Transform
child
in
currentMap
.
walls
.
transform
)
{
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
}
if
(
child
.
GetComponent
<
Wall
>()
is
NormalWall
)
child
.
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editNormalMat
;
}
}
public
void
SaveCurrentMap
()
...
...
@@ -101,6 +96,11 @@ public class MapEditor : SingletonBehaviour<MapEditor>
else
modeSign
.
text
=
sign
+
" Destroy"
;
}
public
void
AddBulletToPlayer
(
int
bulletMode
)
{
currentMap
.
initialBullets
.
Add
((
BulletCode
)
bulletMode
);
//PlayerController.inst.bulletList.Add((BulletCode)bulletMode);
}
private
void
Awake
()
{
...
...
@@ -108,6 +108,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
isEditorStarted
=
false
;
isCreateMode
=
true
;
startSigns
=
new
Dictionary
<
Floor
,
GameObject
>();
goalSigns
=
new
Dictionary
<
Floor
,
GameObject
>();
}
// Start is called before the first frame update
...
...
@@ -140,26 +141,14 @@ public class MapEditor : SingletonBehaviour<MapEditor>
else
currentMap
.
RemoveFloor
(
clickedPos
);
}
else
if
(
currentMode
==
TileMode
.
NormalWall
)
{
if
(
isCreateMode
)
{
Debug
.
Log
(
wallPos
);
currentMap
.
CreateWall
(
wallPos
,
WallType
.
Normal
);
if
(
currentMap
.
GetWallAtPos
(
wallPos
)
!=
null
)
currentMap
.
GetWallAtPos
(
wallPos
).
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
editWallMat
;
}
else
currentMap
.
RemoveWall
(
wallPos
);
}
else
if
(
currentMode
==
TileMode
.
Mirror
)
else
if
(
currentMode
==
TileMode
.
Normal
||
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
=
edit
Wal
lMat
;
currentMap
.
CreateWall
(
wallPos
,
(
WallType
)((
int
)
currentMode
-
1
)
);
if
(
currentMap
.
GetWallAtPos
(
wallPos
)
!=
null
&&
currentMap
.
GetWallAtPos
(
wallPos
).
GetComponent
<
Wall
>()
is
NormalWall
)
currentMap
.
GetWallAtPos
(
wallPos
).
gameObject
.
GetComponent
<
MeshRenderer
>().
material
=
edit
Norma
lMat
;
}
else
currentMap
.
RemoveWall
(
wallPos
);
...
...
@@ -193,7 +182,33 @@ public class MapEditor : SingletonBehaviour<MapEditor>
}
}
}
else
if
((
int
)
currentMode
>=
5
)
else
if
(
currentMode
==
TileMode
.
goalFloor
)
{
if
(
isCreateMode
)
{
if
(
currentMap
.
GetFloorAtPos
(
clickedPos
).
isGoalFloor
)
Debug
.
Log
(
"Goal floor already exists at : ("
+
clickedPos
.
x
+
", "
+
clickedPos
.
y
+
")"
);
else
{
currentMap
.
GetFloorAtPos
(
clickedPos
).
isGoalFloor
=
true
;
goalSigns
.
Add
(
currentMap
.
GetFloorAtPos
(
clickedPos
),
Instantiate
(
goalSign
));
goalSigns
[
currentMap
.
GetFloorAtPos
(
clickedPos
)].
transform
.
position
=
new
Vector3
(
clickedPos
.
x
,
2
,
clickedPos
.
y
);
}
}
else
{
if
(!
currentMap
.
GetFloorAtPos
(
clickedPos
).
isGoalFloor
)
Debug
.
Log
(
"Goal floor doesn't exist at : ("
+
clickedPos
.
x
+
", "
+
clickedPos
.
y
+
")"
);
else
{
currentMap
.
GetFloorAtPos
(
clickedPos
).
isGoalFloor
=
false
;
Destroy
(
goalSigns
[
currentMap
.
GetFloorAtPos
(
clickedPos
)].
gameObject
);
goalSigns
.
Remove
(
currentMap
.
GetFloorAtPos
(
clickedPos
));
}
}
}
else
if
((
int
)
currentMode
>=
5
&&
(
int
)
currentMode
<=
8
)
{
if
(
isCreateMode
)
{
...
...
Assets/Scripts/PlayerController.cs
View file @
c95e51c0
...
...
@@ -8,7 +8,7 @@ public class PlayerController : SingletonBehaviour<PlayerController>
{
public
Player
currentPlayer
;
public
bool
isPlayerMoving
,
isPlayerShooting
,
isZooming
;
p
rivate
List
<
BulletCode
>
bulletList
=
new
List
<
BulletCode
>();
p
ublic
List
<
BulletCode
>
bulletList
=
new
List
<
BulletCode
>();
private
int
bulletCount
=
0
;
private
Vector2Int
prePos
;
public
Vector2Int
MapPos
...
...
@@ -126,16 +126,6 @@ public class PlayerController : SingletonBehaviour<PlayerController>
void
Start
()
{
prePos
=
MapPos
;
bulletList
.
Add
(
BulletCode
.
Mirror
);
bulletList
.
Add
(
BulletCode
.
False
);
bulletList
.
Add
(
BulletCode
.
Mirror
);
bulletList
.
Add
(
BulletCode
.
False
);
bulletList
.
Add
(
BulletCode
.
Mirror
);
bulletList
.
Add
(
BulletCode
.
False
);
bulletList
.
Add
(
BulletCode
.
Mirror
);
bulletList
.
Add
(
BulletCode
.
False
);
bulletList
.
Add
(
BulletCode
.
Mirror
);
bulletList
.
Add
(
BulletCode
.
False
);
}
// Update is called once per frame
...
...
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