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
c1450a7c
Commit
c1450a7c
authored
Jan 22, 2018
by
redsuncore
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
CameraMoveFixed
CameraMoveFixed Focus
parent
5ec15821
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
56 deletions
+60
-56
GameScene.unity
Assets/Scenes/GameScene.unity
+12
-12
CIVGameManager.cs
Assets/Scripts/CIVGameManager.cs
+48
-12
ManagementUIController.cs
Assets/Scripts/ManagementUIController.cs
+0
-19
ManagementUIController.cs.meta
Assets/Scripts/ManagementUIController.cs.meta
+0
-13
No files found.
Assets/Scenes/GameScene.unity
View file @
c1450a7c
...
...
@@ -1078,9 +1078,9 @@ RectTransform:
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
32
0
,
y
:
4
}
m_SizeDelta
:
{
x
:
320
,
y
:
200
}
m_AnchorMax: {x: 0
.33, y: 0.4
}
m_AnchoredPosition: {x: 0, y: 4}
m_SizeDelta: {x:
0, y: -4
}
m_Pivot: {x: 1, y: 0}
--- !u!114 &665629349
MonoBehaviour:
...
...
@@ -1626,12 +1626,12 @@ Prefab:
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
propertyPath: m_AnchoredPosition.x
value
:
14
0
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
propertyPath: m_AnchoredPosition.y
value
:
-2
0
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
...
...
@@ -1651,7 +1651,7 @@ Prefab:
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
propertyPath: m_AnchorMin.y
value
:
1
value:
0
objectReference: {fileID: 0}
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
...
...
@@ -1661,7 +1661,7 @@ Prefab:
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
propertyPath: m_AnchorMax.y
value
:
1
value:
0
objectReference: {fileID: 0}
- target: {fileID: 224370154200431468, guid: e251050c3a94e2a47be7fa8a4796fbbd,
type: 2}
...
...
@@ -1900,10 +1900,10 @@ RectTransform:
m_Father: {fileID: 2074330601}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin
:
{
x
:
0
,
y
:
0
}
m_AnchorMax
:
{
x
:
0
,
y
:
0
}
m_AnchoredPosition
:
{
x
:
320
,
y
:
204
}
m_SizeDelta
:
{
x
:
320
,
y
:
20
0
}
m_AnchorMin: {x: 0, y: 0
.4
}
m_AnchorMax: {x: 0
.33, y: 0.8
}
m_AnchoredPosition: {x:
0, y: 0
}
m_SizeDelta: {x:
0, y:
0}
m_Pivot: {x: 1, y: 0}
--- !u!114 &1115068182
MonoBehaviour:
...
...
@@ -2684,7 +2684,7 @@ Prefab:
- target: {fileID: 224863861108230814, guid: 47ef1c05cbecfff42aec8f14c7958d12,
type: 2}
propertyPath: m_AnchoredPosition.y
value
:
-2
0
value: 0
objectReference: {fileID: 0}
- target: {fileID: 224863861108230814, guid: 47ef1c05cbecfff42aec8f14c7958d12,
type: 2}
...
...
Assets/Scripts/CIVGameManager.cs
View file @
c1450a7c
...
...
@@ -3,12 +3,15 @@ using System.Collections;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.EventSystems
;
using
CivPresenter
;
using
CivModel
;
using
CivModel.Common
;
public
class
CIVGameManager
:
MonoBehaviour
,
IView
{
private
const
float
cameraSpeed
=
4.0f
;
public
enum
DistrictSprite
{
None
,
CityCenter
}
public
static
Sprite
[]
DistrictSprites
=>
districtSprites
;
private
static
Sprite
[]
districtSprites
;
...
...
@@ -21,19 +24,33 @@ public class CIVGameManager : MonoBehaviour, IView {
public
static
Sprite
[]
TileSprites
=>
tileSprites
;
private
static
Sprite
[]
tileSprites
;
public
void
MoveSight
(
int
dx
,
int
dy
)
/*
public void MoveSight(int dx, int dy)
{
mainCamera.transform.Translate(new Vector3(dx, dy, 0));
//버그 있음. 움직일 시 아래로 내려갈수록 지면에 가까워짐. (rotation 문제)
}
}
*/
public
void
Refocus
()
{
{
if
(
pointSelected
.
HasValue
)
{
Focus
(
pointSelected
);
}
}
public
void
Focus
(
Unit
unit
)
{
if
(
unit
.
PlacedPoint
.
HasValue
)
{
Focus
(
unit
.
PlacedPoint
.
Value
);
}
}
public
void
Focus
(
CivModel
.
Terrain
.
Point
?
pt
)
{
if
(
pt
.
HasValue
)
{
Focus
(
pt
.
Value
.
Position
);
}
}
public
void
Focus
(
Position
pos
)
{
CameraChange
(
cells
[
pos
.
X
,
pos
.
Y
].
transform
.
position
);
...
...
@@ -60,6 +77,7 @@ public class CIVGameManager : MonoBehaviour, IView {
}
private
GameObject
cellSelected
=
null
;
private
CivModel
.
Terrain
.
Point
?
pointSelected
;
private
bool
readyToClick
=
false
;
public
void
CastRay
()
...
...
@@ -87,8 +105,7 @@ public class CIVGameManager : MonoBehaviour, IView {
public
void
SelectCell
(
GameObject
go
)
{
cellSelected
=
go
;
CivModel
.
Terrain
.
Point
point
=
FindCell
(
cellSelected
);
pointSelected
=
FindCell
(
cellSelected
);
}
public
CivModel
.
Terrain
.
Point
FindCell
(
GameObject
go
)
{
...
...
@@ -199,23 +216,42 @@ public class CIVGameManager : MonoBehaviour, IView {
// Update is called once per frame
void
Update
()
{
float
delt
=
Time
.
deltaTime
;
if
(
Input
.
GetMouseButtonDown
(
0
))
{
CastRay
();
Debug
.
Log
(
"mouseDown"
);
if
(
EventSystem
.
current
.
IsPointerOverGameObject
()
==
false
)
{
CastRay
();
if
(
cellSelected
!=
null
)
{
Focus
(
pointSelected
);
}
}
}
if
(
Input
.
GetKeyDown
(
KeyCode
.
Escape
))
mPresenter
.
CommandCancel
();
if
(
Input
.
GetKey
(
KeyCode
.
UpArrow
))
mPresenter
.
CommandArrowKey
(
Direction
.
Down
);
if
(
Input
.
GetKey
(
KeyCode
.
DownArrow
))
{
mPresenter
.
CommandArrowKey
(
Direction
.
Up
);
mainCamera
.
transform
.
Translate
(
new
Vector3
(
0
,
cameraSpeed
*
delt
,
0
));
}
if
(
Input
.
GetKey
(
KeyCode
.
DownArrow
))
{
mPresenter
.
CommandArrowKey
(
Direction
.
Down
);
mainCamera
.
transform
.
Translate
(
new
Vector3
(
0
,
-
cameraSpeed
*
delt
,
0
));
}
if
(
Input
.
GetKey
(
KeyCode
.
LeftArrow
))
{
mPresenter
.
CommandArrowKey
(
Direction
.
Left
);
mainCamera
.
transform
.
Translate
(
new
Vector3
(-
cameraSpeed
*
delt
,
0
,
0
));
}
if
(
Input
.
GetKey
(
KeyCode
.
RightArrow
))
{
mPresenter
.
CommandArrowKey
(
Direction
.
Right
);
mainCamera
.
transform
.
Translate
(
new
Vector3
(
cameraSpeed
*
delt
,
0
,
0
));
}
if
(
Input
.
GetKey
(
KeyCode
.
F
))
mPresenter
.
CommandRefocus
();
...
...
Assets/Scripts/ManagementUIController.cs
deleted
100644 → 0
View file @
5ec15821
using
System.Collections
;
using
System.Collections.Generic
;
using
UnityEngine
;
using
UnityEngine.UI
;
public
class
ManagementUIController
:
MonoBehaviour
{
private
Canvas
managemantUI
;
private
Canvas
cameraUI
;
// Use this for initialization
void
Start
()
{
}
// Update is called once per frame
void
Update
()
{
}
}
Assets/Scripts/ManagementUIController.cs.meta
deleted
100644 → 0
View file @
5ec15821
fileFormatVersion: 2
guid: 41e4a5fcff86ff74a95f898f5beff68e
timeCreated: 1516266823
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
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