inventory complete

This commit is contained in:
sewmina7@gmail.com 2024-07-20 11:23:27 +05:30
parent 0772a9b9c8
commit 54e7625fae
30 changed files with 710 additions and 200 deletions

6
.vsconfig Normal file
View File

@ -0,0 +1,6 @@
{
"version": "1.0",
"components": [
"Microsoft.VisualStudio.Workload.ManagedGame"
]
}

View File

@ -15,7 +15,7 @@ public class GameManager : NetworkBehaviour
public static GameManager instance;
public List<LootData> lootDatas;
public InventoryItemsCollection inventoryItems;
private void Awake() {
instance = this;
@ -65,6 +65,20 @@ public class GameManager : NetworkBehaviour
public void SpawnPickup(string type, Vector3 position){
foreach(item i in inventoryItems.items)
{
if(i.type == type)
{
GameObject go = Instantiate(i.prefab, position, Quaternion.identity);
NetworkServer.Spawn(go);
return;
}
}
return;
foreach(LootData loot in lootDatas){
if(loot.type == type){
GameObject newLoot = Instantiate(loot.prefab, position, Quaternion.identity);

View File

@ -1,40 +1,98 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;
using Assets.HeroEditor4D.InventorySystem.Scripts.Data;
using Assets.HeroEditor4D.InventorySystem.Scripts.Elements;
using UnityEngine;
public class InventoryManager : MonoBehaviour
{
public playerNetwork pnet;
public InventorySlot[] inventorySlots;
public List<InventoryItemEntry> entries = new List<InventoryItemEntry>();
public InventoryItemsCollection lootsData;
public GameObject ItemInventoryPrefab;
public List<item> startingItems;
public bool resetInventory = false;
private void OnValidate()
{
if (resetInventory)
{
resetInventory= false;
foreach(InventorySlot slot in inventorySlots)
{
slot.Clear();
}
}
}
public item GetItemByType(string type)
{
foreach(item i in lootsData.items)
{
if(i.type == type)
{
return i;
}
}
Debug.Log("Could not find anything for " + type);
return null;
}
void Start(){
foreach(item i in startingItems){
AddInvItem(i);
}
}
UpdateEntries();
}
void UpdateEntries(){
entries = new List<InventoryItemEntry>();
public Dictionary<int, string> GetEntries(){
Dictionary<int, string> entries = new Dictionary<int, string>();
for(int i=0; i < inventorySlots.Length; i++){
ItemInventory itemInSlot = inventorySlots[i].GetComponentInChildren<ItemInventory>();
if(itemInSlot!= null){
entries.Add(new InventoryItemEntry(){slotIndex = i, lootType=itemInSlot.item.name ?? "null"});
if(itemInSlot!= null && itemInSlot.item != null){
entries.Add(i, itemInSlot.item.type);
}
}
return entries;
}
public void SetInventory(Dictionary<int, string> data)
{
Clear();
foreach(KeyValuePair<int, string> entry in data)
{
SpawnNewItem(GetItemByType(entry.Value), inventorySlots[entry.Key]);
}
}
public bool UseItem(item i)
{
if(pnet.health >= 100)
{
return false;
}
pnet.SetHealth(pnet.health+i.healthIncrease);
return true;
}
public void DropItem(item i)
{
pnet.DropPickup(i.type);
}
public void AddInvItem(string type)
{
AddInvItem(GetItemByType(type));
}
public void AddInvItem (item item){
//find an empty slot
for(int i = 0 ; i < inventorySlots.Length ; i++){
for(int i = inventorySlots.Length-1; i >=0 ; i--){
InventorySlot slot = inventorySlots[i];
ItemInventory itemInSlot = slot.GetComponentInChildren<ItemInventory>();
@ -44,6 +102,8 @@ public class InventoryManager : MonoBehaviour
}
//implement check for slot full
}
Debug.Log("Slots are full");
}
public void Clear(){
@ -58,14 +118,7 @@ public class InventoryManager : MonoBehaviour
GameObject newItemAdd = Instantiate(ItemInventoryPrefab , slot.transform);
ItemInventory inventoryItemm = newItemAdd.GetComponent<ItemInventory>();
inventoryItemm.InitializeNewItem(item);
inventoryItemm.Set(item,this);
}
}
[System.Serializable]
public class InventoryItemEntry{
public int slotIndex;
public string lootType;
}
}

View File

@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5b07afdbcf13e43438545d591cfd2e4b
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@ -4189,6 +4189,7 @@ GameObject:
- component: {fileID: 8564501428482374954}
- component: {fileID: 3309997887793242165}
- component: {fileID: 7117555236479878038}
- component: {fileID: 792125466887298690}
m_Layer: 6
m_Name: DarkBG
m_TagString: Untagged
@ -4321,6 +4322,18 @@ MonoBehaviour:
m_StringArgument:
m_BoolArgument: 1
m_CallState: 2
--- !u!114 &792125466887298690
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1434918977759242644}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 82935aba65d2428469a24dedf18d218a, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!1 &1475775774587403139
GameObject:
m_ObjectHideFlags: 0
@ -8915,6 +8928,7 @@ MonoBehaviour:
m_EditorClassIdentifier:
inventorySlotsParent: {fileID: 5136219042727571430}
lootData: {fileID: 11400000, guid: 6294ffab408434613b9a1b8e86f89d78, type: 2}
inventoryManager: {fileID: 242513768880542571}
--- !u!114 &7345234694237798538
MonoBehaviour:
m_ObjectHideFlags: 0
@ -20235,6 +20249,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 3b6d909e9c710453da71d1ea3889b46f, type: 3}
m_Name:
m_EditorClassIdentifier:
pnet: {fileID: 3490052650544955176}
inventorySlots:
- {fileID: 6707631524958494506}
- {fileID: 1668337141762987234}
@ -20253,12 +20268,13 @@ MonoBehaviour:
- {fileID: 9128470654918185051}
- {fileID: 4647273784657615903}
- {fileID: 1198090170047894088}
entries: []
lootsData: {fileID: 11400000, guid: 6294ffab408434613b9a1b8e86f89d78, type: 2}
ItemInventoryPrefab: {fileID: 9023307358686047025, guid: d57761fe16b0a44dca1d428b0436ec32, type: 3}
startingItems:
- {fileID: 11400000, guid: 42a12e4a74cd34b0e8387fcd7080842f, type: 2}
- {fileID: 11400000, guid: 6baa3a497be4f40c1bfbe7e278cbf39f, type: 2}
- {fileID: 11400000, guid: d0d4296fac40f4b65b2bb32b5abe8089, type: 2}
resetInventory: 0
--- !u!1 &5233407467267683229
GameObject:
m_ObjectHideFlags: 0
@ -37537,12 +37553,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -37654,12 +37695,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (7)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -37771,12 +37837,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (3)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -37888,12 +37979,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (10)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38005,12 +38121,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (8)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38042,10 +38183,6 @@ PrefabInstance:
propertyPath: item
value:
objectReference: {fileID: 11400000, guid: 42a12e4a74cd34b0e8387fcd7080842f, type: 2}
- target: {fileID: 317806100456606608, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: image
value:
objectReference: {fileID: 3259867605899578088}
- target: {fileID: 947504658420709683, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Pivot.x
value: 0.5
@ -38167,7 +38304,8 @@ PrefabInstance:
value: slot1
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38176,17 +38314,6 @@ RectTransform:
m_CorrespondingSourceObject: {fileID: 947504658420709683, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_PrefabInstance: {fileID: 2045125724308082529}
m_PrefabAsset: {fileID: 0}
--- !u!114 &3259867605899578088 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 3556963350440510857, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_PrefabInstance: {fileID: 2045125724308082529}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!114 &4652559270763465766 stripped
MonoBehaviour:
m_CorrespondingSourceObject: {fileID: 6697003292283306823, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38327,7 +38454,8 @@ PrefabInstance:
value: slot1 (3)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38476,7 +38604,8 @@ PrefabInstance:
value: slot1 (2)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38625,7 +38754,8 @@ PrefabInstance:
value: slot1 (1)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38737,12 +38867,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (2)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38854,12 +39009,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (6)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -38971,12 +39151,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (5)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -39088,12 +39293,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (1)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -39242,7 +39472,8 @@ PrefabInstance:
value: slot1 (4)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -39354,12 +39585,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (9)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -39471,12 +39727,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (4)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
@ -39588,12 +39869,37 @@ PrefabInstance:
propertyPath: m_Sprite
value:
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 4631943559028778230, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6945455276672163225, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
propertyPath: m_Name
value: slot1 (11)
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_RemovedGameObjects:
- {fileID: 7659201621259741678, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: c73927b1ea7c6404abc5fe8c6fa78b95, type: 3}

View File

@ -102,6 +102,7 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0
lootType: apple
lootData: {fileID: 11400000, guid: 42a12e4a74cd34b0e8387fcd7080842f, type: 2}
pickupDistance: 1
closestPlayerDist: 3.4028235e+38
--- !u!114 &-9217226190404173927

View File

@ -102,6 +102,7 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0
lootType: potion
lootData: {fileID: 11400000, guid: 6baa3a497be4f40c1bfbe7e278cbf39f, type: 2}
pickupDistance: 1
closestPlayerDist: 3.4028235e+38
--- !u!114 &-9217226190404173927

View File

@ -102,6 +102,7 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0
lootType: meat
lootData: {fileID: 11400000, guid: 70e115a7396c64a4fbac8663d6bc5999, type: 2}
pickupDistance: 1
closestPlayerDist: 3.4028235e+38
--- !u!114 &-9217226190404173927

View File

@ -102,6 +102,7 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0
lootType: potion2
lootData: {fileID: 11400000, guid: b387b851981db4a13933c3aa6bcf49e8, type: 2}
pickupDistance: 1
closestPlayerDist: 3.4028235e+38
--- !u!114 &-9217226190404173927

View File

@ -102,6 +102,7 @@ MonoBehaviour:
syncMode: 0
syncInterval: 0
lootType: strawberry
lootData: {fileID: 11400000, guid: d0d4296fac40f4b65b2bb32b5abe8089, type: 2}
pickupDistance: 1
closestPlayerDist: 3.4028235e+38
--- !u!114 &-9217226190404173927

View File

@ -12,4 +12,9 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: ce357d1989dcf4aa5bab83fb8ffbc8a8, type: 3}
m_Name: Collection
m_EditorClassIdentifier:
items: []
items:
- {fileID: 11400000, guid: 42a12e4a74cd34b0e8387fcd7080842f, type: 2}
- {fileID: 11400000, guid: 6baa3a497be4f40c1bfbe7e278cbf39f, type: 2}
- {fileID: 11400000, guid: 70e115a7396c64a4fbac8663d6bc5999, type: 2}
- {fileID: 11400000, guid: b387b851981db4a13933c3aa6bcf49e8, type: 2}
- {fileID: 11400000, guid: d0d4296fac40f4b65b2bb32b5abe8089, type: 2}

View File

@ -12,6 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0225c604ac20d48e8ba8aca0e2252024, type: 3}
m_Name: BluePotion
m_EditorClassIdentifier:
type: blue_potion
image: {fileID: 21300000, guid: 50ec32c78fb02184eb172cc581f2a0d7, type: 3}
type: 0
action: 0
prefab: {fileID: 3041359854809748956, guid: 6087918ac9a4e4724ad89f8f5585e014, type: 3}
count: 0
spawnProbability: 50

View File

@ -12,6 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0225c604ac20d48e8ba8aca0e2252024, type: 3}
m_Name: apple
m_EditorClassIdentifier:
type: apple
image: {fileID: 21300000, guid: 0ca683d694afea64b85a7bb9d0e07a96, type: 3}
type: 0
action: 0
prefab: {fileID: 3041359854809748956, guid: e03629168e8d04fc59c355c4650b2ca6, type: 3}
count: 0
spawnProbability: 50

View File

@ -12,6 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0225c604ac20d48e8ba8aca0e2252024, type: 3}
m_Name: meat
m_EditorClassIdentifier:
type: meat
image: {fileID: 21300000, guid: 7d078199b6f0c2d4da3cceaaad6ed5b1, type: 3}
type: 0
action: 0
prefab: {fileID: 3041359854809748956, guid: 7a5836fbd01854c16b578783b7286788, type: 3}
count: 0
spawnProbability: 50

View File

@ -12,6 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0225c604ac20d48e8ba8aca0e2252024, type: 3}
m_Name: potion
m_EditorClassIdentifier:
type: potion
image: {fileID: 21300000, guid: 5f82506c96ef7d847b95d1eba1577b58, type: 3}
type: 0
action: 0
prefab: {fileID: 3041359854809748956, guid: 7f262905c13704f01ad6e8514eed78e2, type: 3}
count: 0
spawnProbability: 50

View File

@ -12,6 +12,8 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 0225c604ac20d48e8ba8aca0e2252024, type: 3}
m_Name: strawberry
m_EditorClassIdentifier:
type: strawberry
image: {fileID: 21300000, guid: bd36293e111dc8940a795114c430a028, type: 3}
type: 0
action: 0
prefab: {fileID: 3041359854809748956, guid: 5baa5c19757e348da9a54e9ba0354bd4, type: 3}
count: 0
spawnProbability: 50

View File

@ -38,6 +38,7 @@ RenderSettings:
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
@ -2212,6 +2213,7 @@ MonoBehaviour:
prefab: {fileID: 3041359854809748956, guid: 5baa5c19757e348da9a54e9ba0354bd4, type: 3}
count: 0
spawnProbability: 50
inventoryItems: {fileID: 11400000, guid: 6294ffab408434613b9a1b8e86f89d78, type: 2}
--- !u!4 &608202480
Transform:
m_ObjectHideFlags: 0
@ -327828,15 +327830,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0.3, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -327920,15 +327920,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -460312,15 +460310,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: -7909654892493620595, guid: cd20e8790f3e4884ca3c74989aa84a83, type: 3}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -591570,15 +591566,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 2
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -642762,15 +642756,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 4.34, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -643976,15 +643968,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -659646,15 +659636,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 2
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -659735,15 +659723,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -695139,15 +695125,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 0
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 0001030405
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -695213,15 +695197,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 0
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 0001030405
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -710517,15 +710499,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 2
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -720342,15 +720322,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 2
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -720435,15 +720413,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 2
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -726835,15 +726811,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -728059,15 +728033,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 2
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -772663,15 +772635,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: -7909654892493620595, guid: cd20e8790f3e4884ca3c74989aa84a83, type: 3}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}
@ -774093,15 +774063,13 @@ ParticleSystemRenderer:
m_RenderAlignment: 0
m_Pivot: {x: 0, y: 0.3, z: 0}
m_Flip: {x: 0, y: 0, z: 0}
m_UseCustomVertexStreams: 0
m_EnableGPUInstancing: 1
m_ApplyActiveColorSpace: 1
m_AllowRoll: 1
m_FreeformStretching: 0
m_RotateWithStretchDirection: 1
m_UseCustomVertexStreams: 0
m_VertexStreams: 00010304
m_UseCustomTrailVertexStreams: 0
m_TrailVertexStreams: 00010304
m_Mesh: {fileID: 0}
m_Mesh1: {fileID: 0}
m_Mesh2: {fileID: 0}

View File

@ -9,46 +9,13 @@ public class Inventory : MonoBehaviour
{
public Transform inventorySlotsParent;
public InventoryItemsCollection lootData;
public Dictionary<string, int> Stock;
public InventoryManager inventoryManager;
playerNetwork playerNet;
void Awake(){
playerNet = GetComponent<playerNetwork>();
}
void Start(){
UpdateUI();
for(int i=0; i < inventorySlotsParent.childCount; i++){
int index =0;
index = i;
inventorySlotsParent.GetChild(i).GetChild(1).GetComponent<Button>().onClick.AddListener(()=>{ DropItem(index); });
inventorySlotsParent.GetChild(i).GetChild(0).GetComponent<Button>().onClick.AddListener(()=>{ UseItem(index); });
}
}
public Dictionary<string, int> getInventoryDictionary (){
Dictionary<string, int> invDictionary = new Dictionary<string, int>();
foreach(item loot in lootData.items){
if(invDictionary.ContainsKey(loot.type)){
invDictionary[loot.type]+= loot.count;
}
else{
invDictionary.Add(loot.type, loot.count);
}
}
return invDictionary;
}
public void setInventoryData(Dictionary<string, int> invSetData){
foreach(item loot in lootData.items){
if(invSetData.ContainsKey(loot.type)){
loot.count += invSetData[loot.type];
}
}
UpdateUI();
}
private void UseItem(int index){
if(playerNet.health >= 100){
@ -88,6 +55,9 @@ public class Inventory : MonoBehaviour
}
public void AddItem(string type){
inventoryManager.AddInvItem(type);
return;
foreach(item loot in lootData.items){
if(loot.type == type){
loot.count++;
@ -129,7 +99,6 @@ public class Inventory : MonoBehaviour
public void UpdateUI(){
// for(int i =0; i < inventorySlotsParent.childCount; i++){
// Sprite chosenSprite = null;
// if(i < lootData.items.Length){

View File

@ -0,0 +1,13 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.EventSystems;
public class InventoryDropper : MonoBehaviour, IDropHandler
{
public void OnDrop(PointerEventData eventData)
{
ItemInventory inventoryItemm = eventData.pointerDrag.GetComponent<ItemInventory>();
inventoryItemm.Drop();
}
}

View File

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

View File

@ -1,3 +1,4 @@
using Assets.HeroEditor4D.InventorySystem.Scripts.Elements;
using System;
using System.Collections;
using System.Collections.Generic;
@ -15,4 +16,9 @@ public class InventorySlot : MonoBehaviour , IDropHandler
}
}
public void Clear()
{
GetComponentInChildren<ItemInventory>().Clear();
}
}

View File

@ -5,21 +5,38 @@ using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
public class ItemInventory : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler
public class ItemInventory : MonoBehaviour, IBeginDragHandler, IDragHandler, IEndDragHandler, IPointerClickHandler
{
public item item;
public Image image;
[HideInInspector]
public Transform parentAfterDrag;
public void InitializeNewItem(item newItem)
public Image image;
InventoryManager inventoryManager = new InventoryManager();
public void Set(item newItem, InventoryManager man)
{
inventoryManager = man;
Debug.Log("Setting new item to this slot " + newItem.type, gameObject);
item = newItem;
image.sprite = newItem.image;
image.sprite = newItem.image;
}
public void Start(){
//initialize items
public void Clear()
{
UnityEditor.EditorApplication.delayCall += () =>
{
DestroyImmediate(gameObject);
};
}
public void Drop()
{
inventoryManager.
DropItem(item);
Destroy(gameObject);
}
public void OnBeginDrag(PointerEventData eventData)
@ -38,9 +55,20 @@ public class ItemInventory : MonoBehaviour, IBeginDragHandler, IDragHandler, IEn
public void OnEndDrag(PointerEventData eventData)
{
image.raycastTarget = true;
Debug.Log("Dropping into " + parentAfterDrag.name, parentAfterDrag.gameObject);
if(parentAfterDrag == transform.parent)
{
Destroy(gameObject);
}
image.raycastTarget = true;
transform.SetParent(parentAfterDrag);
}
public void OnPointerClick(PointerEventData eventData)
{
if (inventoryManager.UseItem(item))
{
Destroy(gameObject);
}
}
}

View File

@ -12,6 +12,7 @@ public class item : ScriptableObject
public GameObject prefab;
public int count;
public int spawnProbability = 50;
public int healthIncrease = 10;

View File

@ -7,7 +7,7 @@ public class pickup : NetworkBehaviour
{
public string lootType = "default";
public item lootData;
float updaterInterval = 0.4f;
void Awake(){

View File

@ -231,7 +231,7 @@ public class playerNetwork : NetworkBehaviour
//int playerCoin = int.Parse(coins.text);
Dictionary<string, object> saveValues = new Dictionary<string, object>{
{"playerInventory" , inventory.getInventoryDictionary()},
{"playerInventory" , inventory.inventoryManager.GetEntries()},
{"playerHealth" , health},
{"playerCoin", playerCoin},
{"killCount", enemyKillCount},
@ -288,8 +288,8 @@ public class playerNetwork : NetworkBehaviour
healthBar.value =(savedHealth);
armorBar.value = savedHealth;
//load Inventory
Dictionary<string, int> inventoryGetData = snapshot.GetValue<Dictionary<string,int>>("playerInventory");
inventory.setInventoryData(inventoryGetData);
Dictionary<int, string> inventoryGetData = snapshot.GetValue<Dictionary<int, string>>("playerInventory");
inventory.inventoryManager.SetInventory(inventoryGetData);
completedQuests = snapshot.GetValue<List<string>>("completedQuest");
@ -654,9 +654,9 @@ public class playerNetwork : NetworkBehaviour
public void PickupObject(pickup item){
if(!isServer){ Debug.LogError("Cant call command on client, 403"); return; }
if(isLocalPlayer){
pickupObject(item.lootType);
pickupObject(item.lootData.type);
}else{
RpcPickupObject(item.lootType);
RpcPickupObject(item.lootData.type);
}
}
@ -688,9 +688,12 @@ public class playerNetwork : NetworkBehaviour
public void GoBackMenu(){
startClient.instance.networkManager.StopClient();
SceneManager.LoadScene("GameLogin");
#if UNITY_EDITOR
#else
PlayGamesPlatform.Instance.SignOut();
Firebase.Auth.FirebaseAuth.DefaultInstance.SignOut();
#endif
}
}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 90e32e3c620794acaab9beb996283602
guid: e36215879fcc3a04ebe252cf421b97c3
TextScriptImporter:
externalObjects: {}
userData:

View File

@ -8,6 +8,7 @@
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.6",
"com.unity.timeline": "1.7.6",
"com.unity.toolchain.win-x86_64-linux-x86_64": "2.0.9",
"com.unity.ugui": "1.0.0",
"com.unity.visualscripting": "1.9.1",
"com.unity.modules.ai": "1.0.0",

View File

@ -1,11 +1,11 @@
{
"dependencies": {
"com.unity.2d.animation": {
"version": "9.1.1",
"version": "9.0.3",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.common": "8.0.2",
"com.unity.2d.common": "8.0.1",
"com.unity.2d.sprite": "1.0.0",
"com.unity.collections": "1.1.0",
"com.unity.modules.animation": "1.0.0",
@ -14,7 +14,7 @@
"url": "https://packages.unity.com"
},
"com.unity.2d.aseprite": {
"version": "1.1.4",
"version": "1.0.0",
"depth": 1,
"source": "registry",
"dependencies": {
@ -26,7 +26,7 @@
"url": "https://packages.unity.com"
},
"com.unity.2d.common": {
"version": "8.0.2",
"version": "8.0.1",
"depth": 2,
"source": "registry",
"dependencies": {
@ -46,12 +46,12 @@
"url": "https://packages.unity.com"
},
"com.unity.2d.psdimporter": {
"version": "8.0.5",
"version": "8.0.2",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.2d.animation": "9.1.1",
"com.unity.2d.common": "8.0.2",
"com.unity.2d.animation": "9.0.1",
"com.unity.2d.common": "8.0.1",
"com.unity.2d.sprite": "1.0.0"
},
"url": "https://packages.unity.com"
@ -63,12 +63,12 @@
"dependencies": {}
},
"com.unity.2d.spriteshape": {
"version": "9.0.3",
"version": "9.0.2",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.1.0",
"com.unity.2d.common": "8.0.2",
"com.unity.2d.common": "8.0.1",
"com.unity.modules.physics2d": "1.0.0"
},
"url": "https://packages.unity.com"
@ -83,7 +83,7 @@
}
},
"com.unity.2d.tilemap.extras": {
"version": "3.1.2",
"version": "3.1.1",
"depth": 1,
"source": "registry",
"dependencies": {
@ -95,12 +95,11 @@
"url": "https://packages.unity.com"
},
"com.unity.burst": {
"version": "1.8.15",
"version": "1.8.7",
"depth": 3,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1",
"com.unity.modules.jsonserialize": "1.0.0"
"com.unity.mathematics": "1.2.1"
},
"url": "https://packages.unity.com"
},
@ -133,14 +132,14 @@
"depth": 0,
"source": "builtin",
"dependencies": {
"com.unity.2d.animation": "9.1.1",
"com.unity.2d.animation": "9.0.3",
"com.unity.2d.pixel-perfect": "5.0.3",
"com.unity.2d.psdimporter": "8.0.5",
"com.unity.2d.psdimporter": "8.0.2",
"com.unity.2d.sprite": "1.0.0",
"com.unity.2d.spriteshape": "9.0.3",
"com.unity.2d.spriteshape": "9.0.2",
"com.unity.2d.tilemap": "1.0.0",
"com.unity.2d.tilemap.extras": "3.1.2",
"com.unity.2d.aseprite": "1.1.4"
"com.unity.2d.tilemap.extras": "3.1.1",
"com.unity.2d.aseprite": "1.0.0"
}
},
"com.unity.ide.rider": {
@ -175,6 +174,22 @@
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot": {
"version": "2.0.10",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.sysroot.linux-x86_64": {
"version": "2.0.9",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.33",
"depth": 0,
@ -207,6 +222,16 @@
},
"url": "https://packages.unity.com"
},
"com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "2.0.9",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 0,

View File

@ -48,7 +48,6 @@ PlayerSettings:
defaultScreenHeightWeb: 600
m_StereoRenderingPath: 0
m_ActiveColorSpace: 0
unsupportedMSAAFallback: 0
m_SpriteBatchVertexThreshold: 300
m_MTRendering: 1
mipStripping: 0
@ -76,7 +75,6 @@ PlayerSettings:
androidMinimumWindowWidth: 400
androidMinimumWindowHeight: 300
androidFullscreenMode: 1
androidAutoRotationBehavior: 1
defaultIsNativeResolution: 1
macRetinaSupport: 1
runInBackground: 0
@ -88,7 +86,6 @@ PlayerSettings:
hideHomeButton: 0
submitAnalytics: 1
usePlayerLog: 1
dedicatedServerOptimizations: 0
bakeCollisionMeshes: 0
forceSingleInstance: 0
useFlipModelSwapchain: 1
@ -128,7 +125,6 @@ PlayerSettings:
switchNVNMaxPublicTextureIDCount: 0
switchNVNMaxPublicSamplerIDCount: 0
switchNVNGraphicsFirmwareMemory: 32
switchMaxWorkerMultiple: 8
stadiaPresentMode: 0
stadiaTargetFramerate: 0
vulkanNumSwapchainBuffers: 3
@ -149,7 +145,6 @@ PlayerSettings:
isWsaHolographicRemotingEnabled: 0
enableFrameTimingStats: 0
enableOpenGLProfilerGPURecorders: 1
allowHDRDisplaySupport: 0
useHDRDisplay: 0
hdrBitDepth: 0
m_ColorGamuts: 00000000
@ -384,6 +379,103 @@ PlayerSettings:
m_Height: 81
m_Kind: 2
m_SubKind:
- m_BuildTarget: iPhone
m_Icons:
- m_Textures: []
m_Width: 180
m_Height: 180
m_Kind: 0
m_SubKind: iPhone
- m_Textures: []
m_Width: 120
m_Height: 120
m_Kind: 0
m_SubKind: iPhone
- m_Textures: []
m_Width: 167
m_Height: 167
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 152
m_Height: 152
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 76
m_Height: 76
m_Kind: 0
m_SubKind: iPad
- m_Textures: []
m_Width: 120
m_Height: 120
m_Kind: 3
m_SubKind: iPhone
- m_Textures: []
m_Width: 80
m_Height: 80
m_Kind: 3
m_SubKind: iPhone
- m_Textures: []
m_Width: 80
m_Height: 80
m_Kind: 3
m_SubKind: iPad
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 3
m_SubKind: iPad
- m_Textures: []
m_Width: 87
m_Height: 87
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 58
m_Height: 58
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 29
m_Height: 29
m_Kind: 1
m_SubKind: iPhone
- m_Textures: []
m_Width: 58
m_Height: 58
m_Kind: 1
m_SubKind: iPad
- m_Textures: []
m_Width: 29
m_Height: 29
m_Kind: 1
m_SubKind: iPad
- m_Textures: []
m_Width: 60
m_Height: 60
m_Kind: 2
m_SubKind: iPhone
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 2
m_SubKind: iPhone
- m_Textures: []
m_Width: 40
m_Height: 40
m_Kind: 2
m_SubKind: iPad
- m_Textures: []
m_Width: 20
m_Height: 20
m_Kind: 2
m_SubKind: iPad
- m_Textures: []
m_Width: 1024
m_Height: 1024
m_Kind: 4
m_SubKind: App Store
m_BuildTargetBatching: []
m_BuildTargetShaderSettings: []
m_BuildTargetGraphicsJobs:
@ -458,7 +550,7 @@ PlayerSettings:
switchSocketConcurrencyLimit: 14
switchScreenResolutionBehavior: 2
switchUseCPUProfiler: 0
switchEnableFileSystemTrace: 0
switchUseGOLDLinker: 0
switchLTOSetting: 0
switchApplicationID: 0x01004b9000490000
switchNSODependencies:
@ -588,6 +680,7 @@ PlayerSettings:
switchSocketBufferEfficiency: 4
switchSocketInitializeEnabled: 1
switchNetworkInterfaceManagerInitializeEnabled: 1
switchPlayerConnectionEnabled: 1
switchUseNewStyleFilepaths: 0
switchUseLegacyFmodPriorities: 0
switchUseMicroSleepForYield: 1

View File

@ -1,2 +1,2 @@
m_EditorVersion: 2022.3.33f1
m_EditorVersionWithRevision: 2022.3.33f1 (b2c853adf198)
m_EditorVersion: 2022.3.7f1
m_EditorVersionWithRevision: 2022.3.7f1 (b16b3b16c7a0)