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
dbbd1473
Commit
dbbd1473
authored
May 05, 2019
by
18신대성
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
모든 Object에 대해 IObject라는 인터페이스를 만듬
parent
a64e7953
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
80 additions
and
6 deletions
+80
-6
Briefcase.cs
Assets/Scripts/Interactors/Briefcase.cs
+17
-2
CameraTurret.cs
Assets/Scripts/Interactors/CameraTurret.cs
+16
-1
IObject.cs
Assets/Scripts/Interactors/Interfaces/IObject.cs
+18
-0
IObject.cs.meta
Assets/Scripts/Interactors/Interfaces/IObject.cs.meta
+11
-0
Mannequin.cs
Assets/Scripts/Interactors/Mannequin.cs
+16
-1
Map.cs
Assets/Scripts/Map/Map.cs
+2
-2
No files found.
Assets/Scripts/Interactors/Briefcase.cs
View file @
dbbd1473
...
...
@@ -2,12 +2,22 @@
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Briefcase
:
MonoBehaviour
,
IPlayerInteractor
public
class
Briefcase
:
MonoBehaviour
,
I
Object
,
I
PlayerInteractor
{
[
SerializeField
]
private
Floor
floor
=
null
;
public
Vector2Int
Position
{
get
{
return
floor
!=
null
?
floor
.
mapPos
:
throw
new
UnassignedReferenceException
(
"Floor of Interactor is not assigned"
);
}
}
public
GameObject
GetObject
()
{
return
gameObject
;
}
public
Vector2
GetPos
()
{
return
new
Vector2
(
transform
.
position
.
x
,
transform
.
position
.
z
);
}
public
void
Init
(
Floor
floor
)
{
this
.
floor
=
floor
;
...
...
@@ -23,4 +33,9 @@ public class Briefcase : MonoBehaviour, IPlayerInteractor
Destroy
(
gameObject
);
}
}
ObjType
IObject
.
GetType
()
{
return
ObjType
.
Briefcase
;
}
}
Assets/Scripts/Interactors/CameraTurret.cs
View file @
dbbd1473
...
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
CameraTurret
:
MonoBehaviour
,
IBreakable
,
IPlayerInteractor
public
class
CameraTurret
:
MonoBehaviour
,
I
Object
,
I
Breakable
,
IPlayerInteractor
{
[
SerializeField
]
private
Floor
floor
=
null
;
...
...
@@ -27,4 +27,19 @@ public class CameraTurret : MonoBehaviour, IBreakable, IPlayerInteractor
//TODO : Restart Level
}
}
public
GameObject
GetObject
()
{
return
gameObject
;
}
public
Vector2
GetPos
()
{
return
new
Vector2
(
transform
.
position
.
x
,
transform
.
position
.
z
);
}
ObjType
IObject
.
GetType
()
{
return
ObjType
.
Camera
;
}
}
Assets/Scripts/Interactors/Interfaces/IObject.cs
0 → 100644
View file @
dbbd1473
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
public
enum
ObjType
{
NULL
,
Briefcase
,
Camera
,
Mannequin
}
public
interface
IObject
{
GameObject
GetObject
();
Vector2
GetPos
();
ObjType
GetType
();
}
Assets/Scripts/Interactors/Interfaces/IObject.cs.meta
0 → 100644
View file @
dbbd1473
fileFormatVersion: 2
guid: e7d883246c45c6f4f94bae2ca2d05d6f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Interactors/Mannequin.cs
View file @
dbbd1473
...
...
@@ -2,7 +2,7 @@
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
Mannequin
:
MonoBehaviour
,
IBulletInteractor
public
class
Mannequin
:
MonoBehaviour
,
I
Object
,
I
BulletInteractor
{
[
SerializeField
]
private
Mesh
[]
mannequinMesh
=
new
Mesh
[
2
];
...
...
@@ -48,4 +48,19 @@ public class Mannequin : MonoBehaviour, IBulletInteractor
{
Color
=
isWhite
?
Color
.
white
:
Color
.
black
;
}
public
GameObject
GetObject
()
{
return
gameObject
;
}
public
Vector2
GetPos
()
{
return
new
Vector2
(
transform
.
position
.
x
,
transform
.
position
.
z
);
}
ObjType
IObject
.
GetType
()
{
return
ObjType
.
Mannequin
;
}
}
Assets/Scripts/Map/Map.cs
View file @
dbbd1473
...
...
@@ -9,8 +9,8 @@ public class Map : MonoBehaviour
public
int
maxMapSize
;
public
Dictionary
<
Vector2Int
,
Floor
>
floorGrid
;
public
Dictionary
<
Vector2
,
Wall
>
wallGrid
;
//
public Dictionary<Vector2, Mirror> mirrorGrid;
// public Dictionary<Vector2Int, Interactable
Object> objectGrid;
public
Dictionary
<
Vector2
,
Mirror
>
mirrorGrid
;
public
Dictionary
<
Vector2Int
,
I
Object
>
objectGrid
;
public
GameObject
floors
;
public
GameObject
walls
;
public
List
<
Floor
>
startFloors
;
...
...
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