mirror of
https://github.com/Leahnaya/TheKingsRace.git
synced 2026-08-21 18:04:27 -05:00
Fixed Player Jump and Added Itemmanager
PlayerJump uses raycast to detect when to get jumps back ItemManager Holds all scriptable Objects that are within resources Added a resource folder
This commit is contained in:
@@ -4,8 +4,12 @@ using UnityEngine;
|
||||
|
||||
public class PlayerInventory : MonoBehaviour
|
||||
{
|
||||
//List of items
|
||||
[SerializeField] List<Item> items;
|
||||
|
||||
//Scripts
|
||||
public PlayerStats pStats;
|
||||
public InventoryManager invMan;
|
||||
|
||||
public bool AddItem(Item item){
|
||||
items.Add(item);
|
||||
@@ -21,7 +25,14 @@ public class PlayerInventory : MonoBehaviour
|
||||
|
||||
void Awake(){
|
||||
pStats = GetComponent<PlayerStats>();
|
||||
invMan = GetComponent<InventoryManager>();//////UPDATE WHEN THIS IS NO LONGER ATTACHED TO THE PLAYER
|
||||
}
|
||||
|
||||
void Start(){
|
||||
AddItem(invMan.ItemList[0]);
|
||||
AddItem(invMan.ItemList[1]);
|
||||
foreach (Item item in items){
|
||||
Debug.Log(item.name);
|
||||
item.Equip(pStats);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user