Merge branch 'EvanBranch' into main

This commit is contained in:
Evan Nydahl
2022-01-31 12:12:00 -06:00
4 changed files with 115 additions and 17 deletions

View File

@@ -0,0 +1,90 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &5756063885148329735
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5756063885148329752}
- component: {fileID: 5756063885148329754}
- component: {fileID: 5756063885148329753}
- component: {fileID: 5143056936348118060}
m_Layer: 5
m_Name: Image
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &5756063885148329752
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5756063885148329735}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 2, y: 2, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 100, y: 100}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5756063885148329754
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5756063885148329735}
m_CullTransparentMesh: 1
--- !u!114 &5756063885148329753
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5756063885148329735}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10907, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &5143056936348118060
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5756063885148329735}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fdff95fc2112c6040a748eeeeb659204, type: 3}
m_Name:
m_EditorClassIdentifier:

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 8150580546fbb0d48bcd414238e2be89
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -34202,6 +34202,14 @@ PrefabInstance:
propertyPath: nitroItem
value:
objectReference: {fileID: 11400000, guid: b91f668477f6b3244b3fea3204e6cd87, type: 2}
- target: {fileID: 8100520363622627413, guid: 362ca97b75c291a47ab81d628a81f440, type: 3}
propertyPath: hasDash
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8100520363622627413, guid: 362ca97b75c291a47ab81d628a81f440, type: 3}
propertyPath: hasNitro
value: 1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 362ca97b75c291a47ab81d628a81f440, type: 3}
--- !u!1 &1457776488
@@ -40048,7 +40056,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
Inv: {fileID: 348746306}
uiPrebab: {fileID: 2234979236645149946, guid: 757a136ec05bee247970d9f727f6b5f2, type: 3}
uiPrebab: {fileID: 5756063885148329735, guid: 8150580546fbb0d48bcd414238e2be89, type: 3}
--- !u!1 &1734064827
GameObject:
m_ObjectHideFlags: 0

View File

@@ -5,26 +5,19 @@ using UnityEngine;
public class CoolDown : MonoBehaviour
{
public PlayerInventory Inv;
private List<SpecialItem> specialItems = new List<SpecialItem>();
//used to check if the playr has abillities
public PlayerStats stats;
public GameObject uiPrebab;
// Start is called before the first frame update
void Start(){
//retrieve all items that are special items here
foreach(var I in Inv.PlayerItemDict){
if(I.Value.GetType() == typeof(SpecialItem)){
SpecialItem temp = (SpecialItem)I.Value;
//if not
if(temp.cooldownM == 0 || I.Value.GetType() != typeof(SpecialItem)){
Debug.Log("Item not fully intialized");
//throw assert
Debug.Assert(temp.cooldownM != 0);
Debug.Assert(I.Value.GetType() == typeof(SpecialItem));
}
specialItems.Add(temp);
}
//check if player has abillity
if(stats.HasNitro == true){
GameObject temp = Instantiate(uiPrebab);
temp.transform.SetParent(this.gameObject.transform);
temp.name = "Nitro";
}
}
//set up ui elements for special items
for(int i = 0; i < specialItems.Count; i++){
//instantiate prefab