Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
civilization-iii
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
5
Issues
5
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
true-history-committee
civilization-iii
Commits
602a0ea8
You need to sign in or sign up before continuing.
Commit
602a0ea8
authored
Jul 01, 2018
by
15조준엽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
initial commit
parent
66ffeb73
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
633 additions
and
2513 deletions
+633
-2513
hextile.prefab
Assets/Prefabs/hextile.prefab
+450
-503
hextile.prefab.meta
Assets/Prefabs/hextile.prefab.meta
+0
-2
Game.unity
Assets/Scenes/Game.unity
+83
-1995
GameManager.cs
Assets/Script/GameManager.cs
+71
-0
GameManager.cs.meta
Assets/Script/GameManager.cs.meta
+11
-0
HexTile.cs
Assets/Script/Tile/HexTile.cs
+12
-9
ProjectSettings.asset
ProjectSettings/ProjectSettings.asset
+3
-3
UnityConnectSettings.asset
ProjectSettings/UnityConnectSettings.asset
+3
-1
No files found.
Assets/Prefabs/hextile.prefab
View file @
602a0ea8
This diff is collapsed.
Click to expand it.
Assets/Prefabs/hextile.prefab.meta
View file @
602a0ea8
fileFormatVersion: 2
guid: ef12b8f6d512e104b979d4a75f3e60c0
timeCreated: 1518406688
licenseType: Free
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 100100000
...
...
Assets/Scenes/Game.unity
View file @
602a0ea8
This diff is collapsed.
Click to expand it.
Assets/Script/GameManager.cs
0 → 100644
View file @
602a0ea8
using
System
;
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
CivModel
;
public
class
GameManager
:
MonoBehaviour
{
private
CivModel
.
Game
_game
;
public
CivModel
.
Game
Game
{
get
{
return
_game
;
}
}
public
float
outerRadius
=
1f
;
// Outer&inner radius of hex tile.
public
float
innerRadius
=
Mathf
.
Sqrt
(
3
)
/
2
;
// These variables can be deleted if there are no use.
public
GameObject
HextilePrefab
;
private
GameObject
[,]
_tiles
;
public
GameObject
[,]
Tiles
{
get
{
return
_tiles
;
}
}
void
Awake
()
{
var
factories
=
new
IGameSchemeFactory
[]
{
new
CivModel
.
Common
.
GameSchemeFactory
(),
new
CivModel
.
Hwan
.
GameSchemeFactory
(),
new
CivModel
.
Finno
.
GameSchemeFactory
(),
new
CivModel
.
Quests
.
GameSchemeFactory
(),
new
CivModel
.
Zap
.
GameSchemeFactory
(),
new
CivModel
.
AI
.
GameSchemeFactory
()
};
_game
=
new
CivModel
.
Game
(
".\\Assets\\map.txt"
,
factories
);
_game
.
StartTurn
();
}
// Use this for initialization
void
Start
()
{
InitiateMap
();
}
// Update is called once per frame
void
Update
()
{
}
private
void
InitiateMap
()
{
_tiles
=
new
GameObject
[
_game
.
Terrain
.
Width
,
_game
.
Terrain
.
Height
];
for
(
int
i
=
0
;
i
<
_game
.
Terrain
.
Width
;
i
++)
{
for
(
int
j
=
0
;
j
<
_game
.
Terrain
.
Height
;
j
++)
{
Vector3
pos
=
new
Vector3
(
2
*
i
*
innerRadius
,
-
0.05f
,
-
j
*
outerRadius
*
1.5f
);
if
(
j
%
2
!=
0
)
{
pos
.
x
-=
innerRadius
;
}
_tiles
[
i
,
j
]
=
Instantiate
(
HextilePrefab
,
pos
,
Quaternion
.
identity
);
_tiles
[
i
,
j
].
name
=
String
.
Format
(
"({0},{1})"
,
i
,
j
);
_tiles
[
i
,
j
].
GetComponent
<
HexTile
>().
point
=
_game
.
Terrain
.
GetPoint
(
i
,
j
);
/*
* TODO
* hextile을 생성한 후, Terrian point 클래스의 값을 이용하여
* Hextile의 terrains, tilebuilding을 수정해야 함.
*/
}
}
}
}
Assets/Script/
Temp
.meta
→
Assets/Script/
GameManager.cs
.meta
View file @
602a0ea8
fileFormatVersion: 2
guid: 6bd8a49bccaadfc4c95d2ffc7cea604c
folderAsset: yes
DefaultImporter:
guid: 21eefa2ef0518bc4891057f3f8916cb5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
Assets/Script/Tile/HexTile.cs
View file @
602a0ea8
...
...
@@ -2,20 +2,23 @@
using
System.Collections.Generic
;
using
UnityEngine
;
public
class
HexTile
:
MonoBehaviour
{
// 현재 tile의 위치의 point class
public
CivModel
.
Terrain
.
Point
point
;
void
Start
()
{
}
void
Update
()
{
// prefab의 자식 gameobject들
GameObject
terrains
;
GameObject
tilebuildings
;
}
/*
* TODO
* Hextile Prefab을 수정하여 terrain와 tilebuilding을 설정할 수 있게 해야함.
*/
/*
* 관련 legacy code
public void ChangeTile()
{
if (terrains == null)
...
...
@@ -54,5 +57,5 @@ public class HexTile : MonoBehaviour
{
TileBuildingObject(building);
}
}
}
*/
}
ProjectSettings/ProjectSettings.asset
View file @
602a0ea8
...
...
@@ -664,9 +664,9 @@ PlayerSettings:
UNet
:
1
facebookSdkVersion
:
7.9.4
apiCompatibilityLevel
:
3
cloudProjectId
:
3
c4449d6-16ad-47f1-9c24-c6b481667cdd
projectName
:
civilization-iii
organizationId
:
dshseungw
on
cloudProjectId
:
3
51bd782-e721-4672-a71a-85649ff2d005
projectName
:
civilization-iii
(1)
organizationId
:
absl
on
cloudEnabled
:
0
enableNativePlatformBackendsForNewInputSystem
:
0
disableOldInputManagerSupport
:
0
ProjectSettings/UnityConnectSettings.asset
View file @
602a0ea8
...
...
@@ -28,7 +28,9 @@ UnityConnectSettings:
m_TestMode
:
0
m_IosGameId
:
m_AndroidGameId
:
m_GameIds
:
{}
m_GameIds
:
AndroidPlayer
:
iPhonePlayer
:
m_GameId
:
PerformanceReportingSettings
:
m_Enabled
:
0
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