Files
UltimateFishing/Assets/Scripts/Assembly-CSharp/Mtree/GrowthInformation.cs
2026-02-21 16:45:37 +08:00

31 lines
560 B
C#

namespace Mtree
{
public struct GrowthInformation
{
public float remainingGrowth;
public float growthGoal;
public float initialRadius;
public bool canBeSplit;
public GrowthInformation(float goal = 0f, float remaining = 0f, float radius = 1f)
{
remainingGrowth = remaining;
growthGoal = goal;
initialRadius = radius;
canBeSplit = true;
}
public float GrowthPercentage(float additionalLength = 0f)
{
if (growthGoal == 0f)
{
return 0f;
}
return 1f - (remainingGrowth - additionalLength) / growthGoal;
}
}
}