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
e3a994bf
Commit
e3a994bf
authored
Feb 01, 2019
by
16도재형
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
InputManager 수정, 상호작용 부분 Update로 옮김
parent
3b3dd3c4
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
51 additions
and
70 deletions
+51
-70
PlayerController.cs
Assets/Scripts/Characters/PlayerController.cs
+26
-29
InputManager.asset
ProjectSettings/InputManager.asset
+25
-41
No files found.
Assets/Scripts/Characters/PlayerController.cs
View file @
e3a994bf
...
@@ -60,8 +60,7 @@ public class PlayerController : MonoBehaviour
...
@@ -60,8 +60,7 @@ public class PlayerController : MonoBehaviour
[
SerializeField
]
[
SerializeField
]
private
DroppedItem
lastDropItem
;
private
DroppedItem
lastDropItem
;
private
DroppedLifeStone
lastLifeStone
;
private
DroppedLifeStone
lastLifeStone
;
private
float
interaction
;
private
bool
interaction
;
private
bool
interactionCoolDown
=
true
;
public
PlayerState
playerState
,
previousState
;
public
PlayerState
playerState
,
previousState
;
void
Start
()
void
Start
()
...
@@ -81,25 +80,13 @@ public class PlayerController : MonoBehaviour
...
@@ -81,25 +80,13 @@ public class PlayerController : MonoBehaviour
if
(!
upKeyDown
)
upKeyDown
=
previous
<=
0
&&
verticalRaw
>
0
;
if
(!
upKeyDown
)
upKeyDown
=
previous
<=
0
&&
verticalRaw
>
0
;
if
(!
downKeyDown
)
downKeyDown
=
previous
>=
0
&&
verticalRaw
<
0
;
if
(!
downKeyDown
)
downKeyDown
=
previous
>=
0
&&
verticalRaw
<
0
;
interaction
=
Input
.
Get
AxisRaw
(
"i
nteraction"
);
interaction
=
Input
.
Get
ButtonDown
(
"I
nteraction"
);
if
(
Input
.
GetButtonDown
(
"Jump"
))
if
(
Input
.
GetButtonDown
(
"Jump"
))
{
{
jump
=
true
;
jump
=
true
;
}
}
}
private
void
FixedUpdate
()
if
(
GetItemRay
()
==
false
)
{
isGrounded
=
IsGrounded
();
if
(
GameManager
.
gameState
==
GameState
.
Ingame
&&
MapManager
.
isDoorClosing
!=
true
)
{
if
(
playerState
==
PlayerState
.
Attack
)
{
rb
.
gravityScale
=
rbAttackGravityScale
;
return
;
}
if
(
GetItemRay
()
==
false
)
{
{
if
(
lastDropItem
!=
null
)
if
(
lastDropItem
!=
null
)
{
{
...
@@ -113,18 +100,28 @@ public class PlayerController : MonoBehaviour
...
@@ -113,18 +100,28 @@ public class PlayerController : MonoBehaviour
}
}
}
}
if
(
interaction
!=
1f
)
interactionCoolDown
=
true
;
if
(
lastDropItem
!=
null
&&
interaction
)
if
(
lastDropItem
!=
null
&&
interaction
==
1f
&&
interactionCoolDown
)
{
{
interactionCoolDown
=
false
;
print
(
lastDropItem
.
PushItem
()
+
"냠냠"
);
print
(
lastDropItem
.
PushItem
()+
"냠냠"
);
}
}
if
(
lastLifeStone
!=
null
&&
interaction
==
1f
&&
interactionCoolDow
n
)
if
(
lastLifeStone
!=
null
&&
interactio
n
)
{
{
interactionCoolDown
=
false
;
lastLifeStone
.
ApplyLifeStone
();
lastLifeStone
.
ApplyLifeStone
();
print
(
"생명석 냠냠"
);
print
(
"생명석 냠냠"
);
}
}
}
private
void
FixedUpdate
()
{
isGrounded
=
IsGrounded
();
if
(
GameManager
.
gameState
==
GameState
.
Ingame
&&
MapManager
.
isDoorClosing
!=
true
)
{
if
(
playerState
==
PlayerState
.
Attack
)
{
rb
.
gravityScale
=
rbAttackGravityScale
;
return
;
}
if
(
isGrounded
)
if
(
isGrounded
)
isJumpable
=
true
;
isJumpable
=
true
;
...
...
ProjectSettings/InputManager.asset
View file @
e3a994bf
...
@@ -9,8 +9,8 @@ InputManager:
...
@@ -9,8 +9,8 @@ InputManager:
m_Name
:
Horizontal
m_Name
:
Horizontal
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
left
negativeButton
:
a
positiveButton
:
right
positiveButton
:
d
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -25,8 +25,8 @@ InputManager:
...
@@ -25,8 +25,8 @@ InputManager:
m_Name
:
Vertical
m_Name
:
Vertical
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
down
negativeButton
:
s
positiveButton
:
up
positiveButton
:
w
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -42,7 +42,7 @@ InputManager:
...
@@ -42,7 +42,7 @@ InputManager:
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
negativeButton
:
positiveButton
:
z
positiveButton
:
j
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -58,7 +58,7 @@ InputManager:
...
@@ -58,7 +58,7 @@ InputManager:
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
negativeButton
:
positiveButton
:
x
positiveButton
:
k
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -74,7 +74,7 @@ InputManager:
...
@@ -74,7 +74,7 @@ InputManager:
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
negativeButton
:
positiveButton
:
c
positiveButton
:
l
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -90,7 +90,7 @@ InputManager:
...
@@ -90,7 +90,7 @@ InputManager:
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
negativeButton
:
positiveButton
:
v
positiveButton
:
;
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -106,7 +106,7 @@ InputManager:
...
@@ -106,7 +106,7 @@ InputManager:
descriptiveName
:
descriptiveName
:
descriptiveNegativeName
:
descriptiveNegativeName
:
negativeButton
:
negativeButton
:
positiveButton
:
up
positiveButton
:
space
altNegativeButton
:
altNegativeButton
:
altPositiveButton
:
altPositiveButton
:
gravity
:
1000
gravity
:
1000
...
@@ -133,6 +133,22 @@ InputManager:
...
@@ -133,6 +133,22 @@ InputManager:
type
:
0
type
:
0
axis
:
0
axis
:
0
joyNum
:
0
joyNum
:
0
-
serializedVersion
:
3
m_Name
:
Interaction
descriptiveName
:
descriptiveNegativeName
:
negativeButton
:
positiveButton
:
e
altNegativeButton
:
altPositiveButton
:
gravity
:
1000
dead
:
0.001
sensitivity
:
1000
snap
:
0
invert
:
0
type
:
0
axis
:
0
joyNum
:
0
-
serializedVersion
:
3
-
serializedVersion
:
3
m_Name
:
Mouse X
m_Name
:
Mouse X
descriptiveName
:
descriptiveName
:
...
@@ -293,38 +309,6 @@ InputManager:
...
@@ -293,38 +309,6 @@ InputManager:
type
:
0
type
:
0
axis
:
0
axis
:
0
joyNum
:
0
joyNum
:
0
-
serializedVersion
:
3
m_Name
:
interaction
descriptiveName
:
descriptiveNegativeName
:
negativeButton
:
positiveButton
:
e
altNegativeButton
:
altPositiveButton
:
gravity
:
1000
dead
:
0.001
sensitivity
:
1000
snap
:
0
invert
:
0
type
:
0
axis
:
0
joyNum
:
0
-
serializedVersion
:
3
m_Name
:
Cancel
descriptiveName
:
descriptiveNegativeName
:
negativeButton
:
positiveButton
:
escape
altNegativeButton
:
altPositiveButton
:
joystick button
1
gravity
:
1000
dead
:
0.001
sensitivity
:
1000
snap
:
0
invert
:
0
type
:
0
axis
:
0
joyNum
:
0
-
serializedVersion
:
3
-
serializedVersion
:
3
m_Name
:
Cancel
m_Name
:
Cancel
descriptiveName
:
descriptiveName
:
...
...
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