inventoryFixedv2
This commit is contained in:
BIN
Assets/.DS_Store
vendored
BIN
Assets/.DS_Store
vendored
Binary file not shown.
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 2613116b8a9839f4eb8abb181b83477e, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: ad5de8193a625af48b1318e417ae6c7e, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 5c1e5d25177fa1740921151b338e4d3b, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 9636898e0cabdf64d99f5040090fe41e, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: cf8ec3e416933f743be4df134d5e44b1, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 645f88d72b3eef14ea19d492a14cf019, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 8e74db0c7188ac54caf60d60c6f47ad8, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: f6a02f93ff106dc4182282e95c48a7b6, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 1b30e6bfb9cebd5418e40f107af416af, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
@@ -62,7 +62,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 29a955f37eb0e3549a9a2dfdc8ebcff6, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
BIN
Assets/Lana Studio/Casual RPG VFX/.DS_Store
vendored
BIN
Assets/Lana Studio/Casual RPG VFX/.DS_Store
vendored
Binary file not shown.
@@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b07afdbcf13e43438545d591cfd2e4b
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
BIN
Assets/MultiplayerPrefab/.DS_Store
vendored
BIN
Assets/MultiplayerPrefab/.DS_Store
vendored
Binary file not shown.
@@ -104,7 +104,7 @@ MeshRenderer:
|
||||
m_RenderingLayerMask: 1
|
||||
m_RendererPriority: 0
|
||||
m_Materials:
|
||||
- {fileID: 2100000, guid: 2613116b8a9839f4eb8abb181b83477e, type: 2}
|
||||
- {fileID: 0}
|
||||
m_StaticBatchInfo:
|
||||
firstSubMesh: 0
|
||||
subMeshCount: 0
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
BIN
Assets/Plugins/.DS_Store
vendored
BIN
Assets/Plugins/.DS_Store
vendored
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Assets/Resources/.DS_Store
vendored
Normal file
BIN
Assets/Resources/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
Assets/Resources/Inventory/.DS_Store
vendored
Normal file
BIN
Assets/Resources/Inventory/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -13,7 +13,8 @@ MonoBehaviour:
|
||||
m_Name: BluePotion
|
||||
m_EditorClassIdentifier:
|
||||
type: blue_potion
|
||||
image: {fileID: 21300000, guid: 50ec32c78fb02184eb172cc581f2a0d7, type: 3}
|
||||
image: {fileID: 21300000, guid: 5b99225932a6c1c4589ee65d3c781ca3, type: 3}
|
||||
prefab: {fileID: 3041359854809748956, guid: 6087918ac9a4e4724ad89f8f5585e014, type: 3}
|
||||
count: 0
|
||||
spawnProbability: 50
|
||||
healthIncrease: 10
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoBehaviour:
|
||||
m_Name: meat
|
||||
m_EditorClassIdentifier:
|
||||
type: meat
|
||||
image: {fileID: 21300000, guid: 7d078199b6f0c2d4da3cceaaad6ed5b1, type: 3}
|
||||
image: {fileID: 21300000, guid: 375e980aa77781c4ab8cfa44cd5ed272, type: 3}
|
||||
prefab: {fileID: 3041359854809748956, guid: 7a5836fbd01854c16b578783b7286788, type: 3}
|
||||
count: 0
|
||||
spawnProbability: 50
|
||||
healthIncrease: 10
|
||||
|
||||
@@ -13,7 +13,8 @@ MonoBehaviour:
|
||||
m_Name: potion
|
||||
m_EditorClassIdentifier:
|
||||
type: potion
|
||||
image: {fileID: 21300000, guid: 5f82506c96ef7d847b95d1eba1577b58, type: 3}
|
||||
image: {fileID: 21300000, guid: 3d1af59b1c8e5f34780559d8fdeb4f5a, type: 3}
|
||||
prefab: {fileID: 3041359854809748956, guid: 7f262905c13704f01ad6e8514eed78e2, type: 3}
|
||||
count: 0
|
||||
spawnProbability: 50
|
||||
healthIncrease: 10
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,6 @@ 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:
|
||||
@@ -158,7 +157,7 @@ RectTransform:
|
||||
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.3221, y: 55}
|
||||
m_AnchoredPosition: {x: -0.000017494, y: 0}
|
||||
m_SizeDelta: {x: 1032.464, y: 153.9197}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &39190436
|
||||
@@ -190,8 +189,8 @@ MonoBehaviour:
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4291228652
|
||||
m_fontColor: {r: 0.9251189, g: 0.9528302, b: 0.7775454, a: 1}
|
||||
rgba: 4278920192
|
||||
m_fontColor: {r: 0, g: 0.14150941, b: 0.042314794, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
@@ -760,7 +759,7 @@ Transform:
|
||||
m_GameObject: {fileID: 864703083}
|
||||
serializedVersion: 2
|
||||
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
m_LocalPosition: {x: -19.2, y: 6.4, z: -15.5}
|
||||
m_LocalPosition: {x: -20.35, y: 6.48, z: -15.5}
|
||||
m_LocalScale: {x: 1, y: 1, z: 1}
|
||||
m_ConstrainProportionsScale: 0
|
||||
m_Children: []
|
||||
@@ -838,7 +837,7 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 0}
|
||||
m_AnchorMax: {x: 0.5, y: 0}
|
||||
m_AnchoredPosition: {x: 0, y: 227.77}
|
||||
m_AnchoredPosition: {x: -0.01001, y: 205}
|
||||
m_SizeDelta: {x: 381.7946, y: 143.43079}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1144784620
|
||||
@@ -910,14 +909,14 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_Color: {r: 1, g: 1, b: 1, a: 0.90588236}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Sprite: {fileID: 21300000, guid: 0da2a21d4c1c54e67bcf82b1835aa87f, type: 3}
|
||||
m_Type: 1
|
||||
m_PreserveAspect: 0
|
||||
m_FillCenter: 1
|
||||
@@ -994,15 +993,15 @@ MonoBehaviour:
|
||||
m_Calls: []
|
||||
m_text: '### USER ###'
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2}
|
||||
m_fontAsset: {fileID: 11400000, guid: c416dba26a5cc4682af5161d902cf565, type: 2}
|
||||
m_sharedMaterial: {fileID: 3201670982812318815, guid: c416dba26a5cc4682af5161d902cf565, type: 2}
|
||||
m_fontSharedMaterials: []
|
||||
m_fontMaterial: {fileID: 0}
|
||||
m_fontMaterials: []
|
||||
m_fontColor32:
|
||||
serializedVersion: 2
|
||||
rgba: 4278190080
|
||||
m_fontColor: {r: 0, g: 0, b: 0, a: 1}
|
||||
rgba: 4294967295
|
||||
m_fontColor: {r: 1, g: 1, b: 1, a: 1}
|
||||
m_enableVertexGradient: 0
|
||||
m_colorMode: 3
|
||||
m_fontColorGradient:
|
||||
@@ -1019,8 +1018,8 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 70.9
|
||||
m_fontSizeBase: 70.9
|
||||
m_fontSize: 58
|
||||
m_fontSizeBase: 58
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
@@ -1221,8 +1220,8 @@ RectTransform:
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0.5, y: 1}
|
||||
m_AnchorMax: {x: 0.5, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: -179.96}
|
||||
m_SizeDelta: {x: 954.2928, y: 359.9138}
|
||||
m_AnchoredPosition: {x: -0.01001, y: -179.9569}
|
||||
m_SizeDelta: {x: 1920, y: 359.9138}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &1568150722
|
||||
MonoBehaviour:
|
||||
@@ -1244,7 +1243,7 @@ MonoBehaviour:
|
||||
m_OnCullStateChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
m_text: " T.O.F \nAdventure"
|
||||
m_text: "TOF \nAdventure"
|
||||
m_isRightToLeft: 0
|
||||
m_fontAsset: {fileID: 11400000, guid: c416dba26a5cc4682af5161d902cf565, type: 2}
|
||||
m_sharedMaterial: {fileID: 3201670982812318815, guid: c416dba26a5cc4682af5161d902cf565, type: 2}
|
||||
@@ -1258,10 +1257,10 @@ MonoBehaviour:
|
||||
m_enableVertexGradient: 1
|
||||
m_colorMode: 2
|
||||
m_fontColorGradient:
|
||||
topLeft: {r: 0.018244913, g: 0.01886791, b: 0.018258456, a: 1}
|
||||
topRight: {r: 0.018244913, g: 0.01886791, b: 0.018258456, a: 1}
|
||||
bottomLeft: {r: 0.1779407, g: 0.018511934, b: 0.3018868, a: 1}
|
||||
bottomRight: {r: 0.1779407, g: 0.018511934, b: 0.3018868, a: 1}
|
||||
topLeft: {r: 1, g: 1, b: 1, a: 1}
|
||||
topRight: {r: 1, g: 1, b: 1, a: 1}
|
||||
bottomLeft: {r: 0.75, g: 1, b: 0.7898748, a: 1}
|
||||
bottomRight: {r: 0.75, g: 1, b: 0.7898748, a: 1}
|
||||
m_fontColorGradientPreset: {fileID: 0}
|
||||
m_spriteAsset: {fileID: 0}
|
||||
m_tintAllSprites: 0
|
||||
@@ -1271,15 +1270,15 @@ MonoBehaviour:
|
||||
m_faceColor:
|
||||
serializedVersion: 2
|
||||
rgba: 4294967295
|
||||
m_fontSize: 106.8
|
||||
m_fontSizeBase: 106.8
|
||||
m_fontSize: 100
|
||||
m_fontSizeBase: 100
|
||||
m_fontWeight: 400
|
||||
m_enableAutoSizing: 0
|
||||
m_fontSizeMin: 18
|
||||
m_fontSizeMax: 72
|
||||
m_fontStyle: 1
|
||||
m_HorizontalAlignment: 16
|
||||
m_VerticalAlignment: 256
|
||||
m_HorizontalAlignment: 2
|
||||
m_VerticalAlignment: 512
|
||||
m_textAlignment: 65535
|
||||
m_characterSpacing: 0
|
||||
m_wordSpacing: 0
|
||||
|
||||
BIN
Assets/Script/.DS_Store
vendored
Normal file
BIN
Assets/Script/.DS_Store
vendored
Normal file
Binary file not shown.
@@ -77,12 +77,22 @@ public class InventoryManager : MonoBehaviour
|
||||
}
|
||||
|
||||
pnet.SetHealth(pnet.health+i.healthIncrease);
|
||||
pnet.SavePlayerData();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public item selectedItem;
|
||||
|
||||
public void SelectItem(item itemI){
|
||||
selectedItem = itemI;
|
||||
}
|
||||
|
||||
public void DropItem(item i)
|
||||
{
|
||||
pnet.DropPickup(i.type);
|
||||
pnet.SavePlayerData();
|
||||
|
||||
}
|
||||
|
||||
public void AddInvItem(string type)
|
||||
@@ -120,5 +130,16 @@ public class InventoryManager : MonoBehaviour
|
||||
ItemInventory inventoryItemm = newItemAdd.GetComponent<ItemInventory>();
|
||||
inventoryItemm.Set(item,this);
|
||||
|
||||
pnet.SavePlayerData();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class InventoryEntry{
|
||||
public int slot;
|
||||
public string item;
|
||||
}
|
||||
@@ -26,16 +26,17 @@ public class ItemInventory : MonoBehaviour, IBeginDragHandler, IDragHandler, IEn
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
UnityEditor.EditorApplication.delayCall += () =>
|
||||
{
|
||||
DestroyImmediate(gameObject);
|
||||
};
|
||||
|
||||
// UnityEditor.EditorApplication.delayCall += () =>
|
||||
// {
|
||||
// DestroyImmediate(gameObject);
|
||||
// };
|
||||
}
|
||||
|
||||
public void Drop()
|
||||
{
|
||||
inventoryManager.
|
||||
DropItem(item);
|
||||
DropItem(item);
|
||||
Destroy(gameObject);
|
||||
}
|
||||
|
||||
@@ -66,6 +67,8 @@ public class ItemInventory : MonoBehaviour, IBeginDragHandler, IDragHandler, IEn
|
||||
|
||||
public void OnPointerClick(PointerEventData eventData)
|
||||
{
|
||||
//inventoryManager.SelectItem(item);
|
||||
|
||||
if (inventoryManager.UseItem(item))
|
||||
{
|
||||
Destroy(gameObject);
|
||||
|
||||
@@ -13,6 +13,7 @@ using GooglePlayGames;
|
||||
using UnityEngine.SocialPlatforms;
|
||||
using Firebase.Auth;
|
||||
using UnityEngine.UI;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
public class playerNetwork : NetworkBehaviour
|
||||
{
|
||||
@@ -222,8 +223,10 @@ public class playerNetwork : NetworkBehaviour
|
||||
#if UNITY_EDITOR
|
||||
return;
|
||||
#endif
|
||||
Debug.Log("*** Save Method Got Called ! ***");
|
||||
|
||||
if(!isLoaded){
|
||||
Debug.Log("*** Save Method Return ***");
|
||||
return;
|
||||
}
|
||||
FirebaseFirestore db = FirebaseFirestore.DefaultInstance;
|
||||
@@ -231,7 +234,7 @@ public class playerNetwork : NetworkBehaviour
|
||||
//int playerCoin = int.Parse(coins.text);
|
||||
Dictionary<string, object> saveValues = new Dictionary<string, object>{
|
||||
|
||||
{"playerInventory" , inventory.inventoryManager.GetEntries()},
|
||||
{"playerInventory" , JsonConvert.SerializeObject(inventory.inventoryManager.GetEntries())},
|
||||
{"playerHealth" , health},
|
||||
{"playerCoin", playerCoin},
|
||||
{"killCount", enemyKillCount},
|
||||
@@ -288,8 +291,8 @@ public class playerNetwork : NetworkBehaviour
|
||||
healthBar.value =(savedHealth);
|
||||
armorBar.value = savedHealth;
|
||||
//load Inventory
|
||||
Dictionary<int, string> inventoryGetData = snapshot.GetValue<Dictionary<int, string>>("playerInventory");
|
||||
inventory.inventoryManager.SetInventory(inventoryGetData);
|
||||
Dictionary<int, string> inventoryGetData = JsonConvert.DeserializeObject<Dictionary<int, string>>(snapshot.GetValue<string>("playerInventory"));
|
||||
inventory.inventoryManager.SetInventory(inventoryGetData);
|
||||
|
||||
completedQuests = snapshot.GetValue<List<string>>("completedQuest");
|
||||
|
||||
@@ -299,6 +302,8 @@ public class playerNetwork : NetworkBehaviour
|
||||
}else{
|
||||
//show error previous data doesnt exists to load
|
||||
Debug.Log("**** No previous data to load ****");
|
||||
isLoaded = true;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
BIN
Assets/TextMesh Pro/.DS_Store
vendored
BIN
Assets/TextMesh Pro/.DS_Store
vendored
Binary file not shown.
BIN
Assets/TextMesh Pro/Resources/.DS_Store
vendored
BIN
Assets/TextMesh Pro/Resources/.DS_Store
vendored
Binary file not shown.
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user