Second commit
This commit is contained in:
commit
36840f3ad4
999 files changed
+61364
No files matched your search
@@ -0,0 +1,44 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Code.D.Cleaning.CleanTools
|
||||
{
|
||||
public class Tryapka : CleanTool
|
||||
{
|
||||
public Tryapka(float durabilityUsageStep, float cleanRadius, Texture2D brushTexture) : base(durabilityUsageStep, cleanRadius, brushTexture)
|
||||
{
|
||||
}
|
||||
|
||||
public override CleanToolType ToolType => CleanToolType.Tryapka;
|
||||
|
||||
public override TryapkaUsageInfo Use()
|
||||
{
|
||||
if (!IsDirty.CurrentValue)
|
||||
{
|
||||
CurrentDirtiness.Value += DurabilityUsageStep;
|
||||
|
||||
if (CurrentDirtiness.Value >= 1) IsDirty.Value = true;
|
||||
}
|
||||
|
||||
return new(CleanRadius, CurrentDirtiness.Value, IsDirty.CurrentValue, BrushTexture);
|
||||
}
|
||||
|
||||
public override void Clean()
|
||||
{
|
||||
CurrentDirtiness.Value = 0;
|
||||
IsDirty.Value = false;
|
||||
}
|
||||
}
|
||||
|
||||
public record TryapkaUsageInfo : ToolUsageInfo
|
||||
{
|
||||
public float Radius;
|
||||
|
||||
public TryapkaUsageInfo(float radius, float dirtiness, bool isDirty, Texture brush)
|
||||
{
|
||||
Radius = radius;
|
||||
Dirtiness = dirtiness;
|
||||
IsDirty = isDirty;
|
||||
BrushTexture = brush;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user