Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CityGen
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Kent Holt
CityGen
Commits
e201cf1c
Commit
e201cf1c
authored
6 years ago
by
Kent Holt
Browse files
Options
Downloads
Patches
Plain Diff
Fixed typo
parent
a2560e64
No related branches found
No related tags found
Loading
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Assets/Scripts/Editor/CityGenWindow.cs
+18
-0
18 additions, 0 deletions
Assets/Scripts/Editor/CityGenWindow.cs
with
18 additions
and
0 deletions
Assets/Scripts/Editor/CityGenWindow.cs
+
18
−
0
View file @
e201cf1c
...
@@ -21,6 +21,24 @@ public class CityGenWindow : EditorWindow
...
@@ -21,6 +21,24 @@ public class CityGenWindow : EditorWindow
GUILayout
.
EndScrollView
();
GUILayout
.
EndScrollView
();
}
}
// Save the data about city.
void
save
(
string
fileName
=
"data"
)
{
// Covert city object to json.
string
cityDataAsJson
=
JsonUtility
.
ToJson
(
this
.
city
);
//print(Application.persistentDataPath + this.jsonFilePath);
// Creates a directory in local disk.
System
.
IO
.
Directory
.
CreateDirectory
(
Application
.
persistentDataPath
+
"/CityData"
);
// Write all the data to a file.
System
.
IO
.
File
.
WriteAllText
(
Application
.
persistentDataPath
+
this
.
jsonFilePath
,
cityDataAsJson
);
}
// Load the data about city.
void
load
(){
string
cityDataAsJson
=
System
.
IO
.
File
.
ReadAllText
(
Application
.
persistentDataPath
+
this
.
jsonFilePath
);
city
=
JsonUtility
.
FromJson
<
City
>(
cityDataAsJson
);
}
// ######### Container Classes #########
// ######### Container Classes #########
private
class
CityEntry
private
class
CityEntry
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment