mirror of
https://github.com/DerTyp7/fps-citybuild-unity.git
synced 2025-10-29 20:22:08 +01:00
Update ResourceManager
This commit is contained in:
18
Assets/Scripts/Resources/Items/Stone.asset
Normal file
18
Assets/Scripts/Resources/Items/Stone.asset
Normal file
@@ -0,0 +1,18 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 232c60ba7df6f074d9c92fa97215e412, type: 3}
|
||||
m_Name: Stone
|
||||
m_EditorClassIdentifier:
|
||||
name: New Item
|
||||
uuid: new_item
|
||||
icon: {fileID: 0}
|
||||
isDefaultItem: 0
|
||||
8
Assets/Scripts/Resources/Items/Stone.asset.meta
Normal file
8
Assets/Scripts/Resources/Items/Stone.asset.meta
Normal file
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9309bb620f211124297c6d9da498fca1
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -16,4 +16,18 @@ public class ResourceManager: MonoBehaviour
|
||||
itemList.Add(item);
|
||||
}
|
||||
|
||||
public int Count(Item item)
|
||||
{
|
||||
int count = 0;
|
||||
|
||||
foreach(Item i in itemList)
|
||||
{
|
||||
if(i == item)
|
||||
{
|
||||
count += 1;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user