91 lines
1.9 KiB
C#
91 lines
1.9 KiB
C#
using UnityEngine;
|
|
using System;
|
|
|
|
namespace Fruitomation.Game.Items
|
|
{
|
|
[Serializable] public enum CustomBehaviourType
|
|
{
|
|
None,
|
|
|
|
FruitBehaviour,
|
|
}
|
|
|
|
[Serializable] public enum ItemType
|
|
{
|
|
Apple,
|
|
Grape,
|
|
Banana,
|
|
Kiwi,
|
|
Mango,
|
|
Pitaya,
|
|
Durian,
|
|
BuddhasHand,
|
|
|
|
AppleSlices,
|
|
DriedAppleSlices,
|
|
AppleJuice,
|
|
|
|
GrapeJuice,
|
|
Wine,
|
|
Raisins,
|
|
|
|
BananaSlices,
|
|
DriedBananaSlices,
|
|
BananaSkin,
|
|
MushedBanana,
|
|
BananaBacon,
|
|
BananaIceCream,
|
|
|
|
KiwiJuice,
|
|
KiwiSeeds,
|
|
KiwiSeedOil,
|
|
KiwiVinegar,
|
|
SlicedKiwi,
|
|
|
|
MangoJuice,
|
|
MangoSlices,
|
|
|
|
DurianSlices,
|
|
DurainPowder,
|
|
|
|
BuddhasHandSlices,
|
|
|
|
PitayaSkin,
|
|
MushedPitaya,
|
|
PitayaFoodDye,
|
|
PitayaIceCream,
|
|
|
|
AppleAndMangoJuice,
|
|
DriedFruitSelection,
|
|
SpicedBananaIceCream,
|
|
SpicedPitayaIceCream,
|
|
}
|
|
|
|
[Serializable] public class ItemInfo
|
|
{
|
|
public ItemType Type;
|
|
|
|
[SerializeField] private CustomBehaviourType CustomBehaviour;
|
|
|
|
public GameObject Prefab;
|
|
public float MinMoney;
|
|
public float MaxMoney;
|
|
|
|
public CustomItemBehaviour GetCustomBehaviour()
|
|
{
|
|
return CustomBehaviour switch
|
|
{
|
|
CustomBehaviourType.None => null,
|
|
|
|
CustomBehaviourType.FruitBehaviour => new FruitBehaviour(),
|
|
|
|
var _ => throw new ArgumentOutOfRangeException()
|
|
};
|
|
}
|
|
}
|
|
|
|
[CreateAssetMenu] public class SerializedItemInfoRegistry : ScriptableObject
|
|
{
|
|
[SerializeField] public ItemInfo[] Registry;
|
|
}
|
|
} |