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
4bfc9450
Commit
4bfc9450
authored
Aug 05, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
골지점 복사 수정, 또 거울 수-정
parent
90a0a3ed
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
54 additions
and
26 deletions
+54
-26
Blue.mat
Assets/Models/Materials/Blue.mat
+2
-2
stage18.json
Assets/Resources/Stages/stage18.json
+1
-0
stage18.json.meta
Assets/Resources/Stages/stage18.json.meta
+7
-0
PlayStage.unity
Assets/Scenes/PlayStage.unity
+4
-0
Map.cs
Assets/Scripts/Map/Map.cs
+4
-0
Mirror.cs
Assets/Scripts/Map/Mirror.cs
+36
-24
No files found.
Assets/Models/Materials/Blue.mat
View file @
4bfc9450
...
...
@@ -61,7 +61,7 @@ Material:
-
_DetailNormalMapScale
:
1
-
_DstBlend
:
0
-
_GlossMapScale
:
1
-
_Glossiness
:
0
.5
-
_Glossiness
:
0
-
_GlossyReflections
:
1
-
_Metallic
:
0
-
_Mode
:
0
...
...
@@ -73,5 +73,5 @@ Material:
-
_UVSec
:
0
-
_ZWrite
:
1
m_Colors
:
-
_Color
:
{
r
:
1
,
g
:
1
,
b
:
1
,
a
:
1
}
-
_Color
:
{
r
:
0.5707547
,
g
:
0.57195157
,
b
:
1
,
a
:
1
}
-
_EmissionColor
:
{
r
:
0
,
g
:
0
,
b
:
0
,
a
:
1
}
Assets/Resources/Stages/stage18.json
0 → 100644
View file @
4bfc9450
{
"objects"
:[{
"tag"
:
0
,
"xPos"
:
25.0
,
"yPos"
:
0.0
},{
"tag"
:
2
,
"xPos"
:
-2.0
,
"yPos"
:
-0.5
},{
"tag"
:
3
,
"xPos"
:
1.5
,
"yPos"
:
0.0
},{
"tag"
:
2
,
"xPos"
:
1.0
,
"yPos"
:
-0.5
},{
"tag"
:
2
,
"xPos"
:
2.0
,
"yPos"
:
-0.5
},{
"tag"
:
3
,
"xPos"
:
-1.5
,
"yPos"
:
0.0
},{
"tag"
:
1
,
"xPos"
:
-2.0
,
"yPos"
:
0.0
},{
"tag"
:
1
,
"xPos"
:
-1.0
,
"yPos"
:
0.0
},{
"tag"
:
1
,
"xPos"
:
0.0
,
"yPos"
:
0.0
},{
"tag"
:
1
,
"xPos"
:
1.0
,
"yPos"
:
0.0
},{
"tag"
:
1
,
"xPos"
:
2.0
,
"yPos"
:
0.0
},{
"tag"
:
1
,
"xPos"
:
-2.0
,
"yPos"
:
-1.0
},{
"tag"
:
1
,
"xPos"
:
-1.0
,
"yPos"
:
-1.0
},{
"tag"
:
1
,
"xPos"
:
0.0
,
"yPos"
:
-1.0
},{
"tag"
:
1
,
"xPos"
:
2.0
,
"yPos"
:
-1.0
},{
"tag"
:
1
,
"xPos"
:
1.0
,
"yPos"
:
-1.0
},{
"tag"
:
4
,
"xPos"
:
0.0
,
"yPos"
:
-1.0
},{
"tag"
:
5
,
"xPos"
:
-2.0
,
"yPos"
:
0.0
},{
"tag"
:
5
,
"xPos"
:
2.0
,
"yPos"
:
0.0
}],
"clears"
:[{
"type"
:
6
,
"goal"
:
2
}],
"cases"
:[
0
,
1
],
"bullets"
:[
1
,
1
,
1
,
1
],
"comments"
:
null
}
\ No newline at end of file
Assets/Resources/Stages/stage18.json.meta
0 → 100644
View file @
4bfc9450
fileFormatVersion: 2
guid: 34d47bb45c63f2c409aba21d51a5946e
TextScriptImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scenes/PlayStage.unity
View file @
4bfc9450
...
...
@@ -1364,6 +1364,10 @@ PrefabInstance:
propertyPath
:
commentUIGenerator
value
:
objectReference
:
{
fileID
:
158856774
}
-
target
:
{
fileID
:
2122327709
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
currentStage
value
:
objectReference
:
{
fileID
:
0
}
-
target
:
{
fileID
:
52444459818764334
,
guid
:
42247a938bb6e554eb00dc08303a72d6
,
type
:
3
}
propertyPath
:
m_Name
...
...
Assets/Scripts/Map/Map.cs
View file @
4bfc9450
...
...
@@ -78,7 +78,11 @@ public class Map : MonoBehaviour
StartCoroutine
(
MapManager
.
inst
.
Rebaker
());
}
else
{
Debug
.
Log
(
"Floor already exists at : ("
+
pos
.
x
+
", "
+
pos
.
y
+
")"
);
floorGrid
[
pos
].
isGoalFloor
=
isGoal
;
floorGrid
[
pos
].
RefreshGoal
();
}
}
/// <summary>
/// Create floor in rectangular area between pos1 and pos2.
...
...
Assets/Scripts/Map/Mirror.cs
View file @
4bfc9450
...
...
@@ -96,26 +96,24 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
Wall
wallAtPos
=
MapManager
.
inst
.
currentMap
.
GetWallAtPos
(
wallPos
);
if
(
wallAtPos
!=
null
)
// have wall at wallpos
{
if
(
MapManager
.
inst
.
currentMap
.
wallGrid
.
ContainsKey
(
oppWallPos
)
&&
wallAtPos
.
type
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
oppWallPos
);
}
else
// create wall
Pair
wallPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallAtPos
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wallAtPos
.
rdPos
,
true
));
if
(
wallPair
.
l
>
wallPair
.
r
)
wallPair
=
wallPair
.
Swap
();
if
(
IsInRay
(
parRay
,
wallPair
))
{
Pair
wallPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallAtPos
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wallAtPos
.
rdPos
,
true
)
);
if
(
wallPair
.
l
>
wallPair
.
r
)
wallPair
=
wallPair
.
Swap
(
);
MapManager
.
inst
.
currentMap
.
CreateWall
(
oppWallPos
,
wallAtPos
.
type
);
SubtractRay
(
parRay
,
wallPair
);
if
(
IsInRay
(
parRay
,
wallPair
))
if
(
wallAtPos
.
type
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
CreateWall
(
oppWallPos
,
wallAtPos
.
type
);
SubtractRay
(
parRay
,
wallPair
);
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
oppWallPos
);
}
}
}
else
if
(
MapManager
.
inst
.
currentMap
.
GetWallAtPos
(
oppWallPos
)
!=
null
)
// no wall at wallPos but have at opposite
{
// remove wall
MapManager
.
inst
.
currentMap
.
RemoveWall
(
oppWallPos
);
Pair
tempPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallPos
+
(
dir
?
new
Vector2
(-
0.5f
,
0
)
:
new
Vector2
(
0
,
-
0.5f
)),
true
),
PointToParRay
(
stPos
,
wallPos
+
(
dir
?
new
Vector2
(
0.5f
,
0
)
:
new
Vector2
(
0
,
0.5f
)),
true
));
if
(
IsInRay
(
parRay
,
tempPair
))
MapManager
.
inst
.
currentMap
.
RemoveWall
(
oppWallPos
);
}
}
float
iMid
=
i
+
0.5f
*
side
;
...
...
@@ -130,26 +128,24 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
Wall
wallAtPos
=
MapManager
.
inst
.
currentMap
.
GetWallAtPos
(
wallPos
);
if
(
wallAtPos
!=
null
)
// have wall at wallpos
{
if
(
MapManager
.
inst
.
currentMap
.
wallGrid
.
ContainsKey
(
oppWallPos
)
&&
wallAtPos
.
type
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
oppWallPos
);
}
else
// create wall
Pair
wallPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallAtPos
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wallAtPos
.
rdPos
,
true
));
if
(
wallPair
.
l
>
wallPair
.
r
)
wallPair
=
wallPair
.
Swap
();
if
(
IsInRay
(
parRay
,
wallPair
))
{
Pair
wallPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallAtPos
.
ldPos
,
true
),
PointToParRay
(
stPos
,
wallAtPos
.
rdPos
,
true
)
);
if
(
wallPair
.
l
>
wallPair
.
r
)
wallPair
=
wallPair
.
Swap
(
);
MapManager
.
inst
.
currentMap
.
CreateWall
(
oppWallPos
,
wallAtPos
.
type
);
SubtractRay
(
parRay
,
wallPair
);
if
(
IsInRay
(
parRay
,
wallPair
))
if
(
wallAtPos
.
type
==
WallType
.
Mirror
)
// change to Mirror
{
MapManager
.
inst
.
currentMap
.
CreateWall
(
oppWallPos
,
wallAtPos
.
type
);
SubtractRay
(
parRay
,
wallPair
);
MapManager
.
inst
.
currentMap
.
ChangeToMirror
(
oppWallPos
);
}
}
}
else
if
(
MapManager
.
inst
.
currentMap
.
GetWallAtPos
(
oppWallPos
)
!=
null
)
// no wall at wallPos but have at opposite
{
// remove wall
MapManager
.
inst
.
currentMap
.
RemoveWall
(
oppWallPos
);
Pair
tempPair
=
new
Pair
(
PointToParRay
(
stPos
,
wallPos
+
(
dir
?
new
Vector2
(-
0.5f
,
0
)
:
new
Vector2
(
0
,
-
0.5f
)),
true
),
PointToParRay
(
stPos
,
wallPos
+
(
dir
?
new
Vector2
(
0.5f
,
0
)
:
new
Vector2
(
0
,
0.5f
)),
true
));
if
(
IsInRay
(
parRay
,
tempPair
))
MapManager
.
inst
.
currentMap
.
RemoveWall
(
oppWallPos
);
}
// copy / remove floor and object
Vector2
pointPos
=
dir
?
new
Vector2
(
j
,
iMid
)
:
new
Vector2
(
iMid
,
j
);
...
...
@@ -386,6 +382,22 @@ public class Mirror : Wall, IBulletInteractor, IBreakable
return
false
;
}
bool
IsInRayWeak
(
List
<
Pair
>
_parRay
,
Pair
_range
)
{
bool
output
=
false
;
foreach
(
Pair
pair
in
_parRay
)
{
//Debug.Log("IsinRay (" + pair.l + ", " + pair.r + ") " + _range.l + ", " + _range.r);
if
(
pair
.
r
<
_range
.
l
||
pair
.
l
>
_range
.
r
)
continue
;
else
{
output
=
true
;
break
;
}
}
return
output
;
}
/// <summary>
/// calculate where _chPos is from _stPos
/// </summary>
...
...
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