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
5d1b1fb4
Commit
5d1b1fb4
authored
Feb 17, 2018
by
16도재형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MovingAttack available; need testing (
#7
)
parent
e10f8e1f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
6 deletions
+45
-6
GameManager.cs
Assets/Scripts/GameManager.cs
+44
-5
UIManager.cs
Assets/Scripts/UIManager.cs
+1
-1
No files found.
Assets/Scripts/GameManager.cs
View file @
5d1b1fb4
...
...
@@ -252,7 +252,7 @@ public class GameManager : MonoBehaviour {
mainCamera
.
transform
.
position
=
new
Vector3
(
x
,
6.75f
,
z
);
}
// Camera controll
ing
s
// Camera controlls
void
CameraMove
(
Vector3
vec
)
{
mainCamera
.
transform
.
Translate
(
vec
*
cameraMoveSpeed
*
Time
.
deltaTime
,
Space
.
World
);
...
...
@@ -279,6 +279,7 @@ public class GameManager : MonoBehaviour {
public
void
MoveStateEnter
()
{
// State change
if
(
onMoveState
)
return
;
if
(
onAttackState
)
AttackStateExit
();
if
(
onSkillState
)
SkillStateExit
();
onMoveState
=
true
;
...
...
@@ -296,23 +297,61 @@ public class GameManager : MonoBehaviour {
}
void
MoveStateExit
()
{
onMoveState
=
false
;
if
(
_parameterPoints
==
null
)
return
;
for
(
int
i
=
0
;
i
<
_parameterPoints
.
Length
;
i
++)
{
if
(
_parameterPoints
!=
null
)
if
(
_parameterPoints
[
i
]
!=
null
)
{
CivModel
.
Position
pos
=
_parameterPoints
[
i
].
Value
.
Position
;
_cells
[
pos
.
X
,
pos
.
Y
].
GetComponent
<
HexTile
>().
StopFlickering
();
}
}
_parameterPoints
=
null
;
onMoveState
=
false
;
// TODO
}
public
void
AttackStateEnter
()
{
// State change
if
(
onAttackState
)
return
;
if
(
onMoveState
)
MoveStateExit
();
if
(
onSkillState
)
SkillStateExit
();
onAttackState
=
true
;
// If _selectedActor cannot attack
if
(
_selectedActor
.
MovingAttackAct
==
null
)
return
;
// Select attackable adjacent tiles
_parameterPoints
=
_selectedActor
.
PlacedPoint
.
Value
.
Adjacents
();
for
(
int
i
=
0
;
i
<
_parameterPoints
.
Length
;
i
++)
{
if
(
_selectedActor
.
MovingAttackAct
.
IsActable
(
_parameterPoints
[
i
]))
{
CivModel
.
Position
pos
=
_parameterPoints
[
i
].
Value
.
Position
;
_cells
[
pos
.
X
,
pos
.
Y
].
GetComponent
<
HexTile
>().
FlickerRed
();
}
}
}
void
AttackStateExit
()
{
onAttackState
=
false
;
// TODO
if
(
_parameterPoints
==
null
)
return
;
for
(
int
i
=
0
;
i
<
_parameterPoints
.
Length
;
i
++)
{
if
(
_parameterPoints
[
i
]
!=
null
)
{
CivModel
.
Position
pos
=
_parameterPoints
[
i
].
Value
.
Position
;
_cells
[
pos
.
X
,
pos
.
Y
].
GetComponent
<
HexTile
>().
StopFlickering
();
}
}
_parameterPoints
=
null
;
}
void
SkillStateExit
()
...
...
Assets/Scripts/UIManager.cs
View file @
5d1b1fb4
...
...
@@ -130,7 +130,7 @@ public class UIManager : MonoBehaviour {
public
void
AttackActive
()
{
SkillSet
.
SetActive
(
false
);
GameManager
.
I
.
AttackStateEnter
();
}
public
void
SkillSetActive
()
...
...
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