OldBlueWater/BlueWater/Assets/02.Scripts/FishInfo.cs

31 lines
678 B
C#
Raw Normal View History

using System;
using UnityEngine;
// ReSharper disable once CheckNamespace
namespace BlueWaterProject
{
[Serializable]
public class FishInfo
{
[field: SerializeField] public string Name { get; private set; }
[field: SerializeField] public int Count { get; private set; }
public FishInfo(string name, int count)
{
Name = name;
Count = count;
}
public void AddCount(int? value = null)
{
if (value == null)
{
Count++;
}
else
{
Count += (int)value;
}
}
}
}