bracket system
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Enigmos.Modules.TerminalModules.TestingModules;
|
||||
|
||||
public abstract partial class RealReaderModule : BaseModule, ITerminalModule, IOperationModule
|
||||
{
|
||||
private AnimatedSprite2D? RealReader { get; set; }
|
||||
private AnimatedSprite2D RealReader { get; set; }
|
||||
public IDataInPort[] DataInPorts { get; set; } = Array.Empty<IDataInPort>();
|
||||
|
||||
public override void Init()
|
||||
@@ -29,7 +29,7 @@ public abstract partial class RealReaderModule : BaseModule, ITerminalModule, IO
|
||||
double min = DataInPorts[2].GetData.Get!.Real;
|
||||
double value = DataInPorts[1].GetData.Get!.Real;
|
||||
double range = max - min;
|
||||
double percentage = (range == 0 ? 0d : value / range).DoubleCut();
|
||||
double percentage = (range == 0 ? 0d : (value - min) / range).DoubleCut();
|
||||
int frame = Mathf.FloorToInt(percentage * 122);
|
||||
RealReader!.SpeedScale = (frame - RealReader.Frame) / 60f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user