Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
tetra-tower
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Oenos
tetra-tower
Commits
d0ed256b
Commit
d0ed256b
authored
Feb 01, 2019
by
16도재형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
플레이어 공격에도 GetButton 사용
parent
e3a994bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
21 deletions
+7
-21
PlayerAttack.cs
Assets/Scripts/Characters/PlayerAttack.cs
+7
-21
No files found.
Assets/Scripts/Characters/PlayerAttack.cs
View file @
d0ed256b
...
@@ -4,10 +4,8 @@ using UnityEditor.Animations;
...
@@ -4,10 +4,8 @@ using UnityEditor.Animations;
using
UnityEngine
;
using
UnityEngine
;
using
UnityEngine.UI
;
using
UnityEngine.UI
;
public
class
PlayerAttack
:
MonoBehaviour
{
public
class
PlayerAttack
:
MonoBehaviour
{
public
float
[]
attackRaw
=
new
float
[
3
];
public
bool
[]
attack
=
new
bool
[
3
];
public
int
[]
attackKeyState
=
new
int
[
3
];
//0: released 1: push 2: pushing
public
bool
cancel
;
public
float
cancelRaw
;
public
int
cancelKeyState
;
public
bool
playingSkill
;
public
bool
playingSkill
;
public
float
comboTime
;
public
float
comboTime
;
public
Text
time
,
combo
;
public
Text
time
,
combo
;
...
@@ -36,22 +34,10 @@ public class PlayerAttack : MonoBehaviour {
...
@@ -36,22 +34,10 @@ public class PlayerAttack : MonoBehaviour {
{
{
SetTimeText
(
comboTime
,
comboEndTime
-
Time
.
time
);
SetTimeText
(
comboTime
,
comboEndTime
-
Time
.
time
);
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
i
=
0
;
i
<
3
;
i
++)
attackRaw
[
i
]
=
Input
.
GetAxisRaw
(
"Fire"
+
(
i
+
1
));
attack
[
i
]
=
Input
.
GetButtonDown
(
"Fire"
+
(
i
+
1
));
cancelRaw
=
Input
.
GetAxisRaw
(
"Stop"
);
cancel
=
Input
.
GetButtonDown
(
"Stop"
);
for
(
int
i
=
0
;
i
<
3
;
i
++)
if
(
cancel
)
{
if
(
attackRaw
[
i
]
>
0
&&
attackKeyState
[
i
]
<
2
)
attackKeyState
[
i
]++;
else
if
(
attackRaw
[
i
]
==
0
)
attackKeyState
[
i
]
=
0
;
}
if
(
cancelRaw
>
0
&&
cancelKeyState
<
2
)
cancelKeyState
++;
else
if
(
cancelRaw
==
0
)
cancelKeyState
=
0
;
if
(
cancelKeyState
==
1
)
{
{
comboTimeOn
=
false
;
comboTimeOn
=
false
;
}
}
...
@@ -59,7 +45,7 @@ public class PlayerAttack : MonoBehaviour {
...
@@ -59,7 +45,7 @@ public class PlayerAttack : MonoBehaviour {
if
(!
playingSkill
)
if
(!
playingSkill
)
{
{
for
(
int
i
=
0
;
i
<
3
;
i
++)
for
(
int
i
=
0
;
i
<
3
;
i
++)
if
(
attack
KeyState
[
i
]
==
1
)
if
(
attack
[
i
]
)
{
{
comboArray
+=
(
char
)(
'A'
+
i
);
comboArray
+=
(
char
)(
'A'
+
i
);
CheckCombo
();
CheckCombo
();
...
...
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