inventory
This commit is contained in:
@@ -46,6 +46,8 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
|
|
||||||
public float HP = 10;
|
public float HP = 10;
|
||||||
|
|
||||||
|
public int inventorySlot = 1;
|
||||||
|
|
||||||
public float energy = 100;
|
public float energy = 100;
|
||||||
public float swungTimer;
|
public float swungTimer;
|
||||||
public bool swung;
|
public bool swung;
|
||||||
@@ -125,6 +127,25 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
HP = 10;
|
HP = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
if (Input.GetKeyDown(KeyCode.Alpha1))
|
||||||
|
{
|
||||||
|
inventorySlot = 1;
|
||||||
|
}
|
||||||
|
if (Input.GetKeyDown(KeyCode.Alpha2))
|
||||||
|
{
|
||||||
|
inventorySlot = 2;
|
||||||
|
}
|
||||||
|
if (Input.GetKeyDown(KeyCode.Alpha3))
|
||||||
|
{
|
||||||
|
inventorySlot = 3;
|
||||||
|
}
|
||||||
|
if (inventorySlot > 3)
|
||||||
|
inventorySlot = 3;
|
||||||
|
if (inventorySlot < 1)
|
||||||
|
inventorySlot = 1;
|
||||||
|
|
||||||
if (Input.GetKeyDown(KeyCode.Escape))
|
if (Input.GetKeyDown(KeyCode.Escape))
|
||||||
{
|
{
|
||||||
if (Time.timeScale == 1)
|
if (Time.timeScale == 1)
|
||||||
@@ -231,6 +252,8 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
|
|
||||||
healthUI.sizeDelta = new Vector2((Mathf.Ceil(HP)-1) + (9 * HP), healthUI.sizeDelta.y);
|
healthUI.sizeDelta = new Vector2((Mathf.Ceil(HP)-1) + (9 * HP), healthUI.sizeDelta.y);
|
||||||
|
|
||||||
|
if (inventorySlot == 1)
|
||||||
|
{
|
||||||
if (Input.GetMouseButtonDown(0))
|
if (Input.GetMouseButtonDown(0))
|
||||||
{
|
{
|
||||||
if (GameObject.FindGameObjectsWithTag("Sword").Length < 1)
|
if (GameObject.FindGameObjectsWithTag("Sword").Length < 1)
|
||||||
@@ -279,6 +302,17 @@ public class PlayerMovement : MonoBehaviour
|
|||||||
dashDistanceTimer = 0;
|
dashDistanceTimer = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (inventorySlot == 2)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if (inventorySlot == 3)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
private void LateUpdate()
|
private void LateUpdate()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user