Mirror intergrated, WIP on Client Prediction v1
This commit is contained in:
@@ -1,45 +1,45 @@
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "InventoryItem", menuName = "GameData/InventoryItem", order = 1)]
|
||||
[System.Serializable]
|
||||
public class InventoryItem : ScriptableObject
|
||||
{
|
||||
public string itemName;
|
||||
public int price;
|
||||
public int gems;
|
||||
public int stat;
|
||||
public Sprite image;
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class InventoryEntry
|
||||
{
|
||||
public string Item;
|
||||
public int Count;
|
||||
public InventoryEntry(string item, int count)
|
||||
{
|
||||
Item = item;
|
||||
Count = count;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Inventory
|
||||
{
|
||||
public static InventoryItem GetInventoryItem(string itemName)
|
||||
{
|
||||
Object[] shopItems = Resources.LoadAll("ScriptableObjects/ShopItems");
|
||||
// Debug.Log("Searching thru " + shopItems.Length + " SOs");
|
||||
foreach (Object itemObj in shopItems)
|
||||
{
|
||||
InventoryItem item = itemObj as InventoryItem;
|
||||
if (item.itemName == itemName)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
[CreateAssetMenu(fileName = "InventoryItem", menuName = "GameData/InventoryItem", order = 1)]
|
||||
[System.Serializable]
|
||||
public class InventoryItem : ScriptableObject
|
||||
{
|
||||
public string itemName;
|
||||
public int price;
|
||||
public int gems;
|
||||
public int stat;
|
||||
public Sprite image;
|
||||
}
|
||||
|
||||
|
||||
[System.Serializable]
|
||||
public class InventoryEntry
|
||||
{
|
||||
public string Item;
|
||||
public int Count;
|
||||
public InventoryEntry(string item, int count)
|
||||
{
|
||||
Item = item;
|
||||
Count = count;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Inventory
|
||||
{
|
||||
public static InventoryItem GetInventoryItem(string itemName)
|
||||
{
|
||||
Object[] shopItems = Resources.LoadAll("ScriptableObjects/ShopItems");
|
||||
// Debug.Log("Searching thru " + shopItems.Length + " SOs");
|
||||
foreach (Object itemObj in shopItems)
|
||||
{
|
||||
InventoryItem item = itemObj as InventoryItem;
|
||||
if (item.itemName == itemName)
|
||||
{
|
||||
return item;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user