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
41c1d2da
Commit
41c1d2da
authored
Jul 02, 2019
by
18손재민
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
맵 데이터 json파일로 저장 기능 구현 완료, 로드 작업 중
parent
f51f20bf
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
19 deletions
+44
-19
Editor.meta
Assets/Editor.meta
+0
-8
Newtonsoft.Json.dll
Assets/Newtonsoft.Json.dll
+0
-0
Newtonsoft.Json.dll.meta
Assets/Newtonsoft.Json.dll.meta
+33
-0
MapManager.cs
Assets/Scripts/Managers/MapManager.cs
+9
-2
MapEditor.cs
Assets/Scripts/MapEditor.cs
+2
-8
Assets2019-07-01-22-58-34.json
Assets2019-07-01-22-58-34.json
+0
-1
No files found.
Assets/Editor.meta
deleted
100644 → 0
View file @
f51f20bf
fileFormatVersion: 2
guid: ef75a379c7ec93a4d85966c580bcc286
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
Assets/Newtonsoft.Json.dll
0 → 100644
View file @
41c1d2da
File added
Assets/Newtonsoft.Json.dll.meta
0 → 100644
View file @
41c1d2da
fileFormatVersion: 2
guid: 2a181461c3622c14b804bb5eabec750c
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
defineConstraints: []
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
Assets/Scripts/Managers/MapManager.cs
View file @
41c1d2da
...
...
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using
UnityEngine
;
using
UnityEditor
;
using
UnityEngine.AI
;
using
System.Text
;
public
class
MapManager
:
SingletonBehaviour
<
MapManager
>
{
...
...
@@ -23,9 +24,15 @@ public class MapManager : SingletonBehaviour<MapManager>
public
Map
[]
stage
;
public
BulletFactory
bulletFactory
;
public
TextAsset
asd
;
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);
...
...
@@ -35,7 +42,7 @@ public class MapManager : SingletonBehaviour<MapManager>
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
]);
PlayerController.inst.bulletList.Add(currentMap.initialBullets[i]);
*/
}
public
IEnumerator
Rebaker
()
{
...
...
Assets/Scripts/MapEditor.cs
View file @
41c1d2da
...
...
@@ -2,6 +2,7 @@
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
Newtonsoft.Json
;
using
System.IO
;
public
class
MapEditor
:
SingletonBehaviour
<
MapEditor
>
...
...
@@ -63,7 +64,6 @@ public class MapEditor : SingletonBehaviour<MapEditor>
}
foreach
(
Transform
child
in
currentMap
.
floors
.
transform
)
{
Debug
.
Log
(
"dD"
);
Floor
temp
=
child
.
GetComponent
<
Floor
>();
mapSaveData
.
Add
(
new
MapSaveData
(
TileMode
.
Floor
,
temp
.
mapPos
));
if
(
child
.
GetComponent
<
Floor
>().
isGoalFloor
)
...
...
@@ -89,13 +89,7 @@ public class MapEditor : SingletonBehaviour<MapEditor>
mapSaveData
.
Add
(
new
MapSaveData
(
TileMode
.
BMannequin
,
temp
.
GetPos
()));
}
}
List
<
MapSaveData
>
a
=
new
List
<
MapSaveData
>();
a
.
Add
(
new
MapSaveData
(
TileMode
.
None
,
new
Vector2
(
2
,
3
)));
string
mapSaveJson
=
JsonUtility
.
ToJson
(
a
);
Debug
.
Log
(
mapSaveJson
);
File
.
WriteAllText
(
localPath
,
mapSaveJson
);
File
.
WriteAllText
(
localPath
,
JsonConvert
.
SerializeObject
(
mapSaveData
));
Debug
.
Log
(
"Map saved at "
+
localPath
);}
}
public
void
SaveCurrentMap
()
...
...
Assets2019-07-01-22-58-34.json
deleted
100644 → 0
View file @
f51f20bf
{}
\ No newline at end of file
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