This commit is contained in:
Evan Nydahl
2021-11-01 13:32:41 -05:00
109 changed files with 39207 additions and 584 deletions

View File

@@ -4,15 +4,17 @@ using UnityEngine;
public class InventoryManager : MonoBehaviour
{
public Item[] allItems;
private List<Item> itemList;
public List<Item> ItemList{
public Item[] allItems;
private List<Item> itemList;
public List<Item> ItemList{
get{ return itemList; }
set{ itemList = value; }
}
void Awake(){
allItems = Resources.LoadAll<Item>("ItemObjects");
}
void Awake(){
allItems = Resources.LoadAll<Item>("ItemObjects");
itemList = new List<Item>(allItems);
}
itemList = new List<Item>(allItems);
}
}

View File

@@ -20,7 +20,7 @@ public class Item: ScriptableObject {
public float playerGravM;
public int costM;
public virtual void Equip(PlayerStats p){
public virtual void Equip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
@@ -50,7 +50,7 @@ public class Item: ScriptableObject {
}
}
public virtual void Unequip(PlayerStats p){
public virtual void Unequip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}

View File

@@ -33,3 +33,4 @@ MonoBehaviour:
hasNitroM: 0
hasDashM: 0
cooldownM: 5
scriptM: {fileID: 11500000, guid: 5162a84172831f4449df60b9ad0ce22f, type: 3}

View File

@@ -33,3 +33,4 @@ MonoBehaviour:
hasNitroM: 0
hasDashM: 0
cooldownM: 0
scriptM: {fileID: 11500000, guid: 535009eaa735a4c4e95c6fc270e32741, type: 3}

View File

@@ -1,6 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
[CreateAssetMenu]
public class SpecialItem : Item
@@ -12,8 +13,8 @@ public class SpecialItem : Item
public bool hasNitroM;
public bool hasDashM;
public float cooldownM;
public override void Equip(PlayerStats p){
public override void Equip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel += maxVelM;
}
@@ -61,7 +62,7 @@ public class SpecialItem : Item
}
}
public override void Unequip(PlayerStats p){
public override void Unequip(PlayerStats p, GameObject player){
if(maxVelM != 0){
p.MaxVel -= maxVelM;
}
@@ -89,24 +90,25 @@ public class SpecialItem : Item
if(playerGravM != 0){
p.PlayerGrav -= playerGravM;
}
if(hasWallrunM != true){
p.HasWallrun = hasWallrunM;
if(hasWallrunM != false){
p.HasWallrun = false;
}
if(hasBlinkM != true){
p.HasBlink = hasBlinkM;
if(hasBlinkM != false){
p.HasBlink = false;
}
if(hasGrappleM != true){
p.HasGrapple = hasGrappleM;
if(hasGrappleM != false){
p.HasGrapple = false;
}
if(hasGliderM != true){
p.HasGlider = hasGliderM;
if(hasGliderM != false){
p.HasGlider = false;
}
if(hasNitroM != true){
p.HasNitro = hasNitroM;
if(hasNitroM != false){
p.HasNitro = false;
}
if(hasDashM != true){
p.HasDash = hasDashM;
if(hasDashM != false){
p.HasDash = false;
}
}
}

View File

@@ -1,15 +0,0 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WallRunItem : Item
{
public void Equip(PlayerStats p){
p.HasWallrun = true;
}
public void Unequip(PlayerStats p)
{
p.HasWallrun = false;
}
}

View File

@@ -1,11 +0,0 @@
fileFormatVersion: 2
guid: 80dbcf4212f11a74ebd5289c2b5eb309
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: