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

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

parent 3b3dd3c4
......@@ -60,8 +60,7 @@ public class PlayerController : MonoBehaviour
[SerializeField]
private DroppedItem lastDropItem;
private DroppedLifeStone lastLifeStone;
private float interaction;
private bool interactionCoolDown=true;
private bool interaction;
public PlayerState playerState, previousState;
void Start()
......@@ -81,11 +80,35 @@ public class PlayerController : MonoBehaviour
if (!upKeyDown) upKeyDown = previous <= 0 && verticalRaw > 0;
if (!downKeyDown) downKeyDown = previous >= 0 && verticalRaw < 0;
interaction = Input.GetAxisRaw("interaction");
interaction = Input.GetButtonDown("Interaction");
if (Input.GetButtonDown("Jump"))
{
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()
......@@ -99,32 +122,6 @@ public class PlayerController : MonoBehaviour
rb.gravityScale = rbAttackGravityScale;
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)
isJumpable = true;
......
......@@ -9,8 +9,8 @@ InputManager:
m_Name: Horizontal
descriptiveName:
descriptiveNegativeName:
negativeButton: left
positiveButton: right
negativeButton: a
positiveButton: d
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -25,8 +25,8 @@ InputManager:
m_Name: Vertical
descriptiveName:
descriptiveNegativeName:
negativeButton: down
positiveButton: up
negativeButton: s
positiveButton: w
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -42,7 +42,7 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: z
positiveButton: j
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -58,7 +58,7 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: x
positiveButton: k
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -74,7 +74,7 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: c
positiveButton: l
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -90,7 +90,7 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: v
positiveButton: ;
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -106,7 +106,7 @@ InputManager:
descriptiveName:
descriptiveNegativeName:
negativeButton:
positiveButton: up
positiveButton: space
altNegativeButton:
altPositiveButton:
gravity: 1000
......@@ -133,6 +133,22 @@ InputManager:
type: 0
axis: 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: Mouse X
descriptiveName:
......@@ -293,38 +309,6 @@ InputManager:
type: 0
axis: 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
m_Name: Cancel
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