Commit e3a994bf authored by 16도재형's avatar 16도재형

InputManager 수정, 상호작용 부분 Update로 옮김

parent 3b3dd3c4
...@@ -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,11 +80,35 @@ public class PlayerController : MonoBehaviour ...@@ -81,11 +80,35 @@ 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.GetAxisRaw("interaction"); interaction = Input.GetButtonDown("Interaction");
if (Input.GetButtonDown("Jump")) if (Input.GetButtonDown("Jump"))
{ {
jump = true; jump = true;
} }
if (GetItemRay() == false)
{
if (lastDropItem != null)
{
lastDropItem.HighlightSwitch(false);
lastDropItem = null;
}
if (lastLifeStone != null)
{
lastLifeStone.HighlightSwitch(false);
lastLifeStone = null;
}
}
if (lastDropItem != null && interaction)
{
print(lastDropItem.PushItem() + "냠냠");
}
if (lastLifeStone != null && interaction)
{
lastLifeStone.ApplyLifeStone();
print("생명석 냠냠");
}
} }
private void FixedUpdate() private void FixedUpdate()
...@@ -99,32 +122,6 @@ public class PlayerController : MonoBehaviour ...@@ -99,32 +122,6 @@ public class PlayerController : MonoBehaviour
rb.gravityScale = rbAttackGravityScale; rb.gravityScale = rbAttackGravityScale;
return; return;
} }
if (GetItemRay() == false )
{
if (lastDropItem != null)
{
lastDropItem.HighlightSwitch(false);
lastDropItem = null;
}
if (lastLifeStone != null)
{
lastLifeStone.HighlightSwitch(false);
lastLifeStone = null;
}
}
if (interaction != 1f) interactionCoolDown = true;
if (lastDropItem!=null && interaction == 1f &&interactionCoolDown)
{
interactionCoolDown = false;
print(lastDropItem.PushItem()+"냠냠");
}
if(lastLifeStone!=null && interaction == 1f && interactionCoolDown)
{
interactionCoolDown = false;
lastLifeStone.ApplyLifeStone();
print("생명석 냠냠");
}
if (isGrounded) if (isGrounded)
isJumpable = true; isJumpable = true;
......
...@@ -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:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment