Merge branch 'claude/vibrant-tereshkova'
# Conflicts: # Assets/Scripts/Dice/DiceRoller.cs
This commit is contained in:
@@ -9,15 +9,12 @@ namespace YachtDice.Dice
|
||||
[Serializable]
|
||||
public struct Entry : IEquatable<Entry>
|
||||
{
|
||||
[SerializeField] private int value;
|
||||
[SerializeField] private Transform point;
|
||||
[field: SerializeField] public int Value { get; private set; }
|
||||
[field: SerializeField] public Transform Point { get; private set; }
|
||||
|
||||
public int Value => value;
|
||||
public Transform Point => point;
|
||||
|
||||
public bool Equals(Entry other) => point == other.point;
|
||||
public bool Equals(Entry other) => Point == other.Point;
|
||||
public override bool Equals(object obj) => obj is Entry other && Equals(other);
|
||||
public override int GetHashCode() => point != null ? point.GetHashCode() : 0;
|
||||
public override int GetHashCode() => Point != null ? Point.GetHashCode() : 0;
|
||||
}
|
||||
|
||||
[SerializeField] private List<Entry> entries = new();
|
||||
|
||||
@@ -9,20 +9,15 @@ namespace YachtDice.Dice
|
||||
/// </summary>
|
||||
public abstract class DiсeDefinition : ScriptableObject, IShopItem
|
||||
{
|
||||
[Header("Identity")]
|
||||
[SerializeField] private string id;
|
||||
[SerializeField] private string displayName;
|
||||
[SerializeField, TextArea] private string description;
|
||||
[SerializeField] private Sprite icon;
|
||||
[field: Header("Identity")]
|
||||
[field: SerializeField] public string Id { get; private set; }
|
||||
[field: SerializeField] public string DisplayName { get; private set; }
|
||||
[field: SerializeField, TextArea] public string Description { get; private set; }
|
||||
[field: SerializeField] public Sprite Icon { get; private set; }
|
||||
|
||||
[Header("Economy")]
|
||||
[SerializeField] private int shopPrice;
|
||||
[field: Header("Economy")]
|
||||
[field: SerializeField] public int ShopPrice { get; private set; }
|
||||
|
||||
public string Id => id;
|
||||
public string DisplayName => displayName;
|
||||
public string Description => description;
|
||||
public Sprite Icon => icon;
|
||||
public int ShopPrice => shopPrice;
|
||||
public bool IsRepurchasable => false;
|
||||
|
||||
/// <summary>Количество граней.</summary>
|
||||
@@ -36,10 +31,10 @@ namespace YachtDice.Dice
|
||||
int shopPrice = 0, string description = null) where T : DiсeDefinition
|
||||
{
|
||||
var so = CreateInstance<T>();
|
||||
so.id = id;
|
||||
so.displayName = displayName ?? id;
|
||||
so.description = description ?? id;
|
||||
so.shopPrice = shopPrice;
|
||||
so.Id = id;
|
||||
so.DisplayName = displayName ?? id;
|
||||
so.Description = description ?? id;
|
||||
so.ShopPrice = shopPrice;
|
||||
return so;
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user