38 lines
709 B
C#
38 lines
709 B
C#
using System;
|
|
using UnityEngine;
|
|
|
|
[CreateAssetMenu(fileName = "ItemButtonParameters", menuName = "Scriptable Objects/ItemButtonParameters")]
|
|
public class ItemButtonParameters : ScriptableObject
|
|
{
|
|
[Serializable]
|
|
public struct DurabilityLevelDisplay
|
|
{
|
|
public float minDurability;
|
|
|
|
public Color color;
|
|
}
|
|
|
|
public DurabilityLevelDisplay good;
|
|
|
|
public DurabilityLevelDisplay average;
|
|
|
|
public DurabilityLevelDisplay bad;
|
|
|
|
public Color itemAvailableColor;
|
|
|
|
public Color itemBlockedColor;
|
|
|
|
public Color GetColor(float durability)
|
|
{
|
|
if (durability >= good.minDurability)
|
|
{
|
|
return good.color;
|
|
}
|
|
if (durability >= average.minDurability)
|
|
{
|
|
return average.color;
|
|
}
|
|
return bad.color;
|
|
}
|
|
}
|